Commit 6de8d270 by huahua

提交

parent 2d45064b
......@@ -17,23 +17,24 @@
<button type="balanced" open-type="chooseAvatar" @chooseavatar="onChooseavatar">
<image :src="avatarUrl" class="refreshIcon"></image>
</button>
<view style="margin: auto; width: 100%; text-align: center;color: #999; margin-top: 0upx; " >点击获取微信头像</view>
<view style="margin: auto; width: 100%; text-align: center;color: #999; margin-top: 0upx;">点击获取微信头像</view>
</view>
<!-- <view style="width: calc(100% - 100upx); height: 1upx; background: #eee; margin: auto; margin-top: 40upx;"> </view> -->
<view class="nickname" style="background: #61D119; margin-top: 40upx;">
<!--<text>昵称:</text> -->
<!-- <view class="nickname" style="background: #61D119; margin-top: 40upx;">
<input type="nickname" class="weui-input" style="color: #fff;" :value="nickName" @blur="bindblur" placeholder="点击获取微信昵称"
@input="bindinput" placeholder-class="my-input-placeholder"/>
</view>
</view> -->
<!-- <view style="width: calc(100% - 100upx); height: 1upx; background: #eee; margin: auto;"> </view>-->
<view class="btn">
<view class="btn-sub" @tap="getUserProfile">保存</view>
<view class="btn-sub" @tap="getUserProfile">确定</view>
</view>
<!--小程序登录、用户信息相关接口调整 -->
<!-- <button class="buttonGetUserInfo cssbut" hover-class="hover-class-bg" v-if="canIUseGetUserProfile" @tap="getUserProfile"> 获取头像昵称 </button>
<button v-else open-type="getUserInfo" @getuserinfo="getUserInfo" lang="zh_CN" class="buttonGetUserInfo cssbut" hover-class="hover-class-bg"> 获取头像昵称 </button> -->
</view>
</view>
</uni-popup>
......@@ -107,7 +108,6 @@
},
bindinput(e) {
//console.log('nickName', e)
this.nickName = e.detail.value;
},
......@@ -131,18 +131,6 @@
},
getUserProfile(e) {
if (this.nickName === '') {
uni.showToast({
icon: 'none',
title: '请输入昵称'
})
return false;
}
uni.getSetting({
success(res) {
}
})
let that = this;
wx.getUserProfile({
lang: 'zh_CN',
......@@ -156,7 +144,6 @@
uni.login({
provider: 'weixin',
success: (weixinres) => {
console.log(weixinres)
if (weixinres.code) {
that.loginInfo = Userres.userInfo;
that.loginInfo.encryptedData = Userres.encryptedData;
......@@ -177,9 +164,8 @@
machine_id: that.$base
.machine_id, //用户进入设备id
}).then(result => {
uni.setStorageSync('token', result.token)
uni.setStorageSync('uid', result.id)
uni.setStorageSync('uid', result.id)
uni.hideLoading();
uni.showToast({
title: '登录成功',
......@@ -189,7 +175,7 @@
}).catch(err => {
uni.hideLoading();
uni.showToast({
title: err.msg,
title: '登录失败!',
icon: 'none'
});
})
......@@ -337,9 +323,10 @@
</script>
<style lang="scss">
@import "./css/main.css";
/* 去除button默认样式 */
/*去除button默认样式 */
.cssbut {
background-color: transparent !important;
padding-left: 0 !important;
......
<template>
<view :style="{ height: height + 'px', background:background}" style="position: fixed; z-index: 999;">
<view class="head" :style="{ height: height + 'px', background:background}">
<view class="back" @click="back" v-if="backShow" :style="{ top: top + 'px', color:color }">
<image v-if="worksid > 0" src="../../../static/recommend/house.png" mode="aspectFit"
style="width: 39upx; height: 39upx; margin-top: calc((32px - 39upx)/2);margin-left: auto; margin-right: auto;"></image>
<image v-else src="../../../static/recommend/icon_back.png" mode="aspectFit" style="width: 42upx; height: 42upx;
margin-top: 20upx;
margin-left: auto; margin-right: auto;"></image>
</view>
<view class="title" v-if="titleShow" :style="{ top: (top ) + 'px', color:color, 'font-size': size + 'rpx' }">{{title}}</view>
</view>
</view>
</template>
<script>
export default {
props: {
worksid:{
type: Number,
default: null
},
title: {
type: String,
default: '自定义标题'
},
size:{
type: String,
default: '32'
},
color:{
type: String,
default: '#000'
},
titleShow: {
type: Boolean,
default: true
},
backShow: {
type: Boolean,
default: true
},
background:{
type: String,
default: "linear-gradient(to right, #43e97b 0%, #38f9d7 100%)"
}
},
data() {
return {
height :0,
top:0,
}
},
mounted() {
},
created() {
//console.log('设备信息')
//设备信息
let app = uni.getSystemInfoSync();
//胶囊信息
let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
this.height = app.statusBarHeight + menuButtonInfo.height + (menuButtonInfo.top - app.statusBarHeight)*2
this.top = menuButtonInfo.top;
},
methods: {
back(){
this.$emit('headBack')
}
},
onLoad(options) {
},
onShow() {
}
}
</script>
<style>
.head{
position: fixed;
width: 750rpx;
z-index: 888;
align-items: center;
}
.title{
position: fixed;
width: 750rpx;
text-align: center;
line-height: 32px;
height: 32px;
}
.back{
position: fixed;
width: 81rpx;
text-align: center;
line-height: 32px;
height: 32px;
font-size: 32rpx;
font-weight: 900;
z-index: 9;
align-items: center;
}
</style>
<template>
<!-- <myhead :color="'#61D119'" :titleShow="true" :backShow="true" :background="'#131319'" style=" "
:headBack="headBack()"></myhead> -->
<!-- 贴图 -->
<view v-if="showState" class="content" style="width: 100%; height: 100%; position: relative;overflow: hidden; "
<view v-if="showState" class="content" style="width: 100%; height: 100%; position: relative;overflow: hidden; background: #00ffff;"
:style="{height: windowHeight +'px',background: backColorVal}">
<refresh ref="refresh" @interrupt="interrupt" @pushToInterrupt="pushToInterrupt" @finished="finished"
@scrolltolower="g" :scrollHeight="windowHeight" :scrollTop="scrollViewTop" @scroll="scroll">
<template slot="top">
<view style="color: #FFFFFF;position: absolute; top: 0;width: 100%; text-align: center;"
:style="'height:' + 40 + 'px; line-height:' + 40 + 'px;'">{{tip}}</view>
:style="'height:' + 40 + 'px; line-height:' + 40 + 'px;'">scsacsa</view>
</template>
<template slot="content">
<view style="width:100%; margin: auto; height:calc(100% - 40upx); overflow: hidden;">
......@@ -29,7 +33,7 @@
v-if="datalist.length == 0">
<span class="iconfont icon-wushuju"
style="font-size: 100upx; text-align: center; color: #B2B2B2;"></span>
<view style="color: #B2B2B2; text-align: center; line-height: 50upx;font-size: 24upx;">啊嘞,还是一片荒漠
<view style="color: #B2B2B2; text-align: center; line-height: 50upx;font-size: 24upx;">啊嘞,还是一片荒漠
</view>
</view>
</view>
......@@ -44,6 +48,7 @@
</template>
<script>
import myhead from './head.vue'; // 页眉
import homeservice from '@/service/homeservice.js';
import refresh from '@/components/xing-refresh/xing-refresh.vue';
export default {
......@@ -54,7 +59,8 @@
}
},
components: {
refresh
refresh,
myhead
},
data() {
return {
......@@ -69,7 +75,7 @@
machine_id: null, //设备id=
material_category_id: "", //
material_series_id: "",
goods_feature_id:null,
goods_feature_id: null,
},
queryCollectionPage: {
......@@ -93,7 +99,7 @@
oldScrollViewTop: 0, //旧数据到顶部位置
e: 0, // 弹窗类型
isWork: false, //是否作品
backColorVal:""
backColorVal: ""
};
},
mounted() {
......@@ -104,6 +110,11 @@
*/
methods: {
headBack() {
this.$emit('Worksdetail', null)
},
scroll(e) {
if (e.detail.scrollTop > 1) {
this.oldScrollViewTop = e.detail.scrollTop - 0.01
......@@ -167,9 +178,9 @@
},
open(item) {
if(item.val){
if (item.val) {
this.backColorVal = item.val
}else{
} else {
this.backColorVal = "";
}
if (this.e != item.e) {
......@@ -215,8 +226,8 @@
is_hot: item.queryPage.is_hot, //热门
goods_id: item.queryPage.goods_id, //商品id
is_under: item.queryPage.is_under, //贴图是否为背景图
partner_id: item.queryPage.partner_id ,//代理
goods_feature_id:this.$base.goods_feature_id
partner_id: item.queryPage.partner_id, //代理
goods_feature_id: this.$base.goods_feature_id
}
if (item.e == 2) { //贴图
if (loadData) {
......@@ -289,7 +300,8 @@
icon: 'none'
});
} else {
this.Material_categorydatalist = this.Material_categorydatalist.concat(result.data.data);
this.Material_categorydatalist = this.Material_categorydatalist.concat(result.data
.data);
this.datalist = this.datalist.concat(result.data.data);
this.queryCollectionPage.page += 1;
if (Math.ceil(result.total / result.per_page) <= this.queryCollectionPage.page) {
......@@ -383,4 +395,4 @@
}
</script>
<style lang="scss">
</style>
</style>
\ No newline at end of file
<template>
<view :style="{ height: height + 'px', background:background}" style="position: fixed; z-index: 999;">
<view class="head" :style="{ height: height + 'px', background:background}">
<view class="back" @click="back" v-if="backShow" :style="{ top: top + 'px', color:color }">
<view class="back" @click="back" v-if="backShow" :style="{ top: top + 'px', color:color }">
<image v-if="worksid > 0" src="../../../static/recommend/house.png" mode="aspectFit"
style="width: 39upx; height: 39upx; margin-top: calc((32px - 39upx)/2);margin-left: auto; margin-right: auto;"></image>
<image v-else src="../../../static/recommend/icon_back.png" mode="aspectFit" style="width: 42upx; height: 42upx;
margin-top: 20upx;
margin-left: auto; margin-right: auto;"></image>
</view>
<view class="title" v-if="titleShow" :style="{ top: top + 'px', color:color, 'font-size': size + 'rpx' }">{{title}}</view>
<view class="title" v-if="titleShow" :style="{ top: (top + 4) + 'px', color:color, 'font-size': size + 'rpx' }">{{title}}</view>
</view>
</view>
</template>
......@@ -66,7 +67,9 @@
methods: {
back(){
if(this.worksid > 0){
// uni.redirectTo({ url: '../index/mall' })
if(this.worksid == 3111 ){
return;
}
uni.reLaunch({
url: '../index/mall'
});
......
......@@ -251,7 +251,7 @@
</view>
<!-- 计算字体大小 -->
<view class='item-box' style='top:-1000px;left:-1000px;'>
<view class='item-box' style='top:-1000px;left:-1000px; visibility: hidden;'>
<view class='item-box-in'
:style="{width:data.editorWidth + 'px' ,height: data.itemList[data.cidx].height +'px'}"
style="text-align: center;">
......@@ -262,9 +262,10 @@
{{data.itemList[data.cidx].content}}
</view>
</view>
<image :src="upLoadImageUrl" mode="scaleToFill" @load="upLoadIImageLoad" @error="upLoadIImageLoadErr"></image>
</view>
<view v-if="!guide_left"
<view v-if="!guide_left"
style="position: fixed; left:12upx; font-size: 25upx; color: #FFFFFF; bottom: 260upx;opacity: 0;">
<view>{{drag_text_context}}</view>
<view>{{cutting_text_context}}</view>
......@@ -316,7 +317,7 @@
</view>
<!-- 菜单栏目 -->
<view v-if="!active && !guide_left" class="toolRight" >
<!-- <view v-if="!active && !guide_left" class="toolRight" >
<view class="tool_li" @click="selectPicturePop()" style="margin-top: 22upx;">
<image class="tool_li_img" src="../../static/icon_make_diy_back_color.png"
style="width: 60upx;height: 60upx;" mode="aspectFit"></image>
......@@ -335,61 +336,86 @@
src="../../static/icon_diy_ai.png" mode="aspectFit" style="width: 50upx;height: 50upx;"></image>
<view class="tool_li_text">优化图片</view>
</view>
</view> -->
<view v-if="!active && !guide_left" class="toolRight" >
<view class="tool_li" @click="selectPicturePop()" >
<image class="tool_li_img" src="../../static/icon_make_diy_back_color.png"
mode="aspectFit"></image>
<view class="tool_li_text">上传相片</view>
</view>
<view class="tool_li" @click="showPopup(3)">
<image class="tool_li_img" src="../../static/icon/icon_typeface.png" mode="aspectFit"></image>
<view class="tool_li_text">添加文字</view>
</view>
<view class="tool_li" @click="showPopup(2)">
<image class="tool_li_img" src="../../static/icon/icon_stickers.png" mode="aspectFit"></image>
<view class="tool_li_text">推荐图片</view>
</view>
<view class="tool_li" @click="showAiChange()">
<image @click="cancel('share')" class="tool_li_img"
src="../../static/icon_diy_ai.png" mode="aspectFit"></image>
<view class="tool_li_text">优化图片</view>
</view>
</view>
<tuya ref="tuya" @tuyaimg="tuyaimg"></tuya>
<!-- 编辑文字跟图片按钮 -->
<view v-if="active && !guide_left" style="position: fixed;top: 718upx;right:0upx; z-index: 99999; width: 120upx;height: 130upx;">
<view style="width: 100%;height: 130upx;">
<view v-if="active && !guide_left" style="position: fixed;bottom: 0upx;left:0upx; z-index: 99999;height: 113upx;
width: calc(100% - 230upx); ">
<view style="width: 100%;height: 130upx; display: flex; flex-direction: row;justify-content: flex-end ">
<!-- 点击画布区域取消聚焦 -->
<view style="width: 100%;height: 60upx;margin-left: 36upx;" @click.stop="itemCancel">
<image style="width: 50upx; height: 70upx;"
<view style="width: 110upx;height: 60upx;margin-right: 0upx;" @click.stop="itemCancel">
<image style="width: 52upx; height: 70upx;margin-top: 15upx; "
src="../../static/icon_confirm.png" mode="aspectFit"></image>
</view>
</view>
<!-- AI图像 -->
<!-- <view v-if="data.itemList.length > 0">
<view style="height: 60upx;width: 100%;margin-left: 36upx;margin-top: 21upx;" @click="showAiChange()">
<image class="tool_li_img" style="width: 50upx; height: 70upx;"
src="../../static/icon_diy_ai.png" mode="aspectFit" ></image>
</view>
<view style="text-align: center;
color: #FFFFFF;
font-size: 22upx;
margin-top: 10upx;width: 100%;">优化图片</view>
</view> -->
<view v-if="data.itemList.length > 0">
<view style="height: 60upx;width: 100%;" @click="showPopup(4)" v-if="data.itemList[data.cidx].type == 1">
<image class="tool_li_img" style="width: 50upx; height: 50upx;"
<view v-if="data.itemList.length > 0 && data.itemList[data.cidx].type == 1" style="width: 110upx;margin-right: 10upx;">
<view style="height: 52upx;width: 100%;margin-left: 25upx;" @click="showPopup(4)">
<image class="tool_li_img" style="width: 50upx; height: 44upx; "
src="../../static/icon/diy_icon_editor_default.png" mode="aspectFit" ></image>
</view>
<view style="text-align: center;
color: #FFFFFF;
font-size: 22upx; width: 100upx;">编辑</view>
</view>
<view v-if="data.itemList.length > 0" style="width: 120upx; height: 100%;
display: flex; flex-direction: column;">
<view style="height: 52upx; margin-left: 19upx;" @click="showAiChange()">
<image class="tool_li_img" style="width: 44upx;height: 44upx; margin-left: 17upx;"
src="../../static/icon_diy_ai.png" mode="aspectFit" ></image>
</view>
<view style="text-align: right;
color: #FFFFFF;
font-size: 22upx; width: 100upx;">优化图片</view>
</view>
</view>
</view>
<view v-if="!active && !guide_left " @click="topagecategory(0)"
style="z-index: 99;position: fixed; left: 12upx; top: 200upx;">
<image style="width: 120upx; height: 150upx; display: block; margin: auto;"
style="z-index: 99;position: fixed; left: 12upx; top: 160upx;">
<image style="width: 115upx; height: 140upx; display: block; margin: auto;"
src="../../static/qiehuan.png" mode=""></image>
</view>
<view class="toolLeft" style="margin-left: 2upx; z-index: 999999;" @click.stop="removedeleteItem"
v-if="data.itemList.length > 0 && !guide_left">
<image style=" width: 50upx;
height: 50upx;
<!-- v-if="data.itemList.length > 0 && !guide_left" -->
<view class="toolLeft" style=" z-index: 99; top: 325upx; width: 80upx; margin-left: 4upx;" @click.stop="removedeleteItem">
<image style=" width: 48upx;
height: 48upx;
display: block;
margin: auto;" src="../../static/diy_icon_middle_default.png" mode=""></image>
<view style="text-align: center;
color: #F56364;
font-size: 20upx;
font-size: 18upx;
margin-top: 8upx;">移除图片</view>
</view>
<view class="toolLeft" style="margin-left: 10upx; margin-top: 130upx"
<!-- <view class="toolLeft" style="margin-left: 10upx; margin-top: 110upx"
v-if="(background_color && background_color != 'none') && (surface_type == 0 || surface_type == 2) && !guide_left"
@click.stop="eliminateBackgroundColor()">
<image style="width: 50upx;
......@@ -401,7 +427,7 @@
font-size: 20upx;
margin-top: 10upx;">清空底色</view>
</view>
-->
<view v-if="!guide_left" class="toolBottom" >
<view @click.stop="createWorks" hover-class="hover-class-bg"
:class="['tool_add',available == 0 ? 'grey' : '']"> {{createWorkstext}} </view>
......@@ -442,10 +468,27 @@
@click="cancel('share')"/>
<!-- <view style="position: absolute; bottom: 0upx; left: 0; height: 100%; width: calc(100% - 120upx); z-index: 998; background: linear-gradient(0deg, #1B294F, #4E2761, #E73231); opacity: 0.8;"></view> -->
<view
style="position: absolute; bottom: 0upx; left: 0; height: 100%; width: 120upx; z-index: 999; background: #1A1D33; overflow: hidden;">
<view style="width: 120upx; height: 188upx;"></view>
<!-- 一级分类 -->
<view style="width: 120upx;" :style="{height: (data.windowHeight - 188 * data.pixelRate) +'px'}"
style="
position: absolute;
bottom: 0upx;
left: 0;
height: 100%;
width: 120upx;
z-index: 999;
background: #1A1D33;
overflow: hidden;">
<view style="width: 120upx; height: 188upx;">
<view :style="{ height: headheight + 'px'}" style="width: 100%;">
<view class="back" @click="cancel('share')">
<image src="../../static/recommend/icon_back.png" mode="aspectFit" style="width: 42upx; height: 42upx;
margin-left: 20upx;" :style="{ marginTop: menuButtonInfoTop + 10 + 'px'}"></image>
</view>
</view>
</view>
<!-- 一级分类 -->
<view style="width: 120upx;" :style="{height: (data.windowHeight - 188 * data.pixelRate) +'px'}"
v-if="e_active == 2 || e_active == 23 || e_active == 99">
<scroll-view class="scroll-container"
:style="{height: (data.windowHeight - 188 * data.pixelRate) +'px'}" scroll-y
......@@ -457,21 +500,19 @@
style="width: 60upx; height: 60upx; display: block;margin:auto; padding: 18upx;"
:src="index == currentId ? item.icon_click : item.icon" mode="aspectFill">
</image>
<!-- <view v-if="item.update_flag == 1"
style="width: 20upx;
height: 20upx;
margin-left: 80upx;
background: #ff0000;
z-index:10;
border-radius: 50%;
margin-top: -80upx;
position: absolute;">
</view> -->
</view>
</scroll-view>
</view>
</view>
<view style="position: absolute; bottom: 0upx; left: 120upx; height: 100%; width: calc(100% - 240upx); z-index: 999; overflow: hidden; background: #282932;">
<view style="
position: absolute;
bottom: 0upx;
left: 120upx;
height: 100%;
width: calc(100% - 240upx);
z-index: 999;
overflow: hidden;
background: #282932;">
<!-- 轮播图 -->
<view style="position: relative; width: calc(100% - 30upx); z-index: 99; margin:30upx auto;">
<swiper :autoplay="true" :interval="3000" :duration="1000" :indicator-dots="true"
......@@ -582,7 +623,14 @@
style="z-index: 999999; width: 100%;background: #55ff7f; height: 100%; position: absolute; top: 0upx; left: 0upx" :style="{height: data.windowHeight +'px'}">
<view class="uni-share full-width" :style="{height: data.windowHeight +'px'}" style="background: #fff;">
<view style="position: absolute; bottom: 0upx; left: 0;height: 100%; width: 120upx; z-index: 7; overflow: hidden;">
<view style="width: 120upx; height: 190upx;"></view>
<view style="width: 120upx; height: 190upx;">
<view :style="{ height: headheight + 'px'}" style="width: 100%; z-index: 9999;">
<view class="back" @tap="cancel('share')">
<image src="../../static/recommend/icon_back.png" mode="aspectFit" style="width: 42upx; height: 42upx;
margin-left: 20upx;" :style="{ marginTop: menuButtonInfoTop + 10 + 'px'}"></image>
</view>
</view>
</view>
<view style="width: 112upx; padding-left: 8upx;" :style="{height: (data.windowHeight - 188 * data.pixelRate) +'px'}">
<scroll-view class="scroll-container"
:style="{height: (data.windowHeight - 160 * data.pixelRate) +'px'}" scroll-y
......@@ -598,10 +646,9 @@
</scroll-view>
</view>
</view>
<view style="position: absolute; bottom: 0upx; left: 116upx; height: 100%; width: 100%;
z-index: 8; overflow: hidden; ">
<view style="width: calc(100% - 150upx); height: calc(100% - 180upx); position: relative;overflow: hidden;
border: 5upx solid #61D119; margin-top: 140upx; margin-right: 10upx; ">
<view style="position: absolute; bottom: 0upx; left: 116upx; height: 100%; width: 100%;z-index: 8; overflow: hidden; ">
<view style="width: calc(100% - 150upx); height: calc(100% - 180upx); position: relative; overflow: hidden;
border: 5upx solid #61D119; margin-top: 140upx; margin-right: 10upx;">
<veiw>
<scroll-view scroll-y style="width:100%; margin: auto; height:calc(100% - 50upx); overflow: hidden; margin-top: 10upx;">
<view style="float: left; width: calc(100% / 4); margin: 5upx 0 5upx; "
......@@ -634,9 +681,12 @@
</scroll-view>
</veiw>
</view>
<view style="position: absolute; bottom: 0upx; left: 0;
height: 100%; width: 5upx;
z-index: 9;
<view style="position: absolute;
bottom: 0upx;
left: 0;
height: 100%;
width: 5upx;
z-index: 9;
overflow: hidden;">
<view style="width: 10upx; margin-top: 190upx; " :style="{height: (data.windowHeight - 188 * data.pixelRate) +'px'}">
<scroll-view class="scroll-container"
......@@ -902,17 +952,115 @@
goods_id_e:{},
datalist:[],
isShowPop:false,
brandCurrentId: 0
brandCurrentId: 0,
upLoadImageUrl:"",
menuButtonInfoTop:0
};
},
created() { //设备信息
let app = uni.getSystemInfoSync(); //设备信息
let menuButtonInfo = uni.getMenuButtonBoundingClientRect(); //胶囊信息
this.menuButtonInfoTop = menuButtonInfo.top;
this.textHeight = app.statusBarHeight + menuButtonInfo.height + (menuButtonInfo.top - app.statusBarHeight) * 2
},
methods: {
upLoadIImageLoadErr(e){
uni.showToast({
title: '上传失败',
icon: 'none',
duration: 3000
})
},
upLoadIImageLoad(e) {
if(this.upLoadImageUrl == "" || this.upLoadImageUrl == null ){
return;
}
uni.showToast({
title: '上传成功',
icon: 'none',
duration: 3000
})
var id = e.currentTarget.dataset.id;
var image = {
width : e.detail.width,
height: e.detail.height
}
let width = 0
let height = 0
let top = 0
let lef = 0
let ratio = image.width / image.height
let ratiowidth = (this.data.editorWidth * this.mix_scale) / image.width
let ratioheight = (this.data.editorHeight * this.mix_scale) /image.height
//if (ratio >= 1) { //长方形
//width = this.data.editorWidth * this.mix_scale * resultmix_scale
//height = image.height * ratiowidth * resultmix_scale
//} else if (ratio < 1) { //长高方形
height = this.data.editorHeight * this.mix_scale
width = image.width * ratioheight
//}
//width = this.data.editorWidth * this.mix_scale
//height = image.height * ratiowidth
if (height / 2 > this.editor_top) {
width = width * (this.editor_top * 2 / height)
height = this.editor_top * 2
}
this.isShowGif = true;
let index = items.length;
items.push({
support_zoom: 1, // 0是不支持缩放,为1时支持缩放
support_drag: 1, // 0是不支持拖动,为1时支持拖动
is_under: 0, //贴图是否为背景图
is_discount: 0, //贴图是否用卷
id: index + 1,
type: 0, //0为图片,1为文字,2为素材
material_id: 0,
original_id: 0,
index: index,
font_family: '',
font_style: '',
font_size: '',
font_color: '',
under_color: '',
content: this.upLoadImageUrl, // 图片地址
top: this.editor_top - height / 2, // 初始图片Y坐标,根据画布高/2-图片高/2
left: this.data.editorWidth / 2 - width / 2, // 初始图片X坐标,因为div是相对定位,所以计算是要多减一次移动的距离
x: this.data.editorWidth / 2, // 初始圆心位置,可再downImg之后又宽高和初始的图片位置得出
y: this.editor_top,
scale: 1, // 缩放比例 1为不缩放
lastScale: 1, // 上一次的绽放比例
oScale: 1, // 缩放比例 1为不缩放
angle: 0, // 旋转角度
rotate: 0, // 旋转值
active: false, // 判定点击状态
width: width, // 预设生成图片的宽度
height: height, // 预设生成图片的高度
rScale: 1, // 图片原始缩放比例
// 新增加默认属性
activeguide: false, // 开启辅助线
activescale: false, // 开启旋转状态
activehorn: false, // 开启角状态
activeedge: false, // 开启边状态
initialScale: 1, // 图片缩放比例
initialscaling: 1, // 图片初始时缩放比例
initialScalex: 1, // 图片宽缩放比例
initialScaley: 1, // 图片高缩放比例
initialWidth: width, // 图片原始宽度
initialHeight: height, // 图片原始高度
frame_left: null, // 裁剪窗口x
image_left: null, // 图片x
frame_top: null, // 裁剪窗口y
image_top: null, // 图片y
isUpLoadImage: true
})
this.data.itemList = items
this.isUpLoadImage = false;
this.saveSnapshot();
},
brandclick(index,item) {
this.brandCurrentId = index
......@@ -997,6 +1145,7 @@
});
return
}
if(this.data.itemList[this.data.itemList.length-1].type == 0 && this.data.itemList[this.data.itemList.length-1].isUpLoadImage){
this.selectChangeType = 1;
this.$refs["showAiChange"].open();
......@@ -1039,12 +1188,7 @@
if (res.statusCode === 200) {
that.uploadToTempOss(result.Data, res.tempFilePath, ".jpg",
function(resultImage) {
// if(that.selectChangeType == 3) {
// that.getStyleChange(resultImage)
// return;
// }
client.callRecognizeBankCard(resultImage, wx, that
.selectChangeType,
client.callRecognizeBankCard(resultImage, wx, that.selectChangeType,
function(result) {
uni.hideLoading();
if (result.Code) {
......@@ -1056,25 +1200,19 @@
} else {
if (result.Data) {
let imageURL = result.Data.ImageURL;
//console.log(imageURL)
// if (that.selectChangeType == 3) {
// that.getStyleChange(imageURL)
// } else {
imageURL = imageURL.replace("http:",
"https:")
imageURL = imageURL.replace("http:","https:")
if (!item.isChangeAi) {
item.contentOld = item.content;
}
item.content = imageURL;
item.isChangeAi = true
that.data.itemList[that.data.cidx];
// }
}
}
that.$refs["showAiChange"].close();
}.bind(this));
}
);
}
);
}
}
})
......@@ -1114,11 +1252,9 @@
return typeof callback == "function" && callback(error.data)
}
})
//this.callApi(endpoint, Action, API_VERSION, null, callback);
},
// 使用oss-client-sdk进行文件上传
//使用oss-client-sdk进行文件上传
uploadToTempOss(ossStsToken, tempFilePath, fileName, callback) {
const host = 'https://viapi-customer-temp.oss-cn-shanghai.aliyuncs.com';
let formDataParams = this.getFormDataParams(ossStsToken.AccessKeyId, ossStsToken.AccessKeySecret,ossStsToken.SecurityToken);
......@@ -1285,7 +1421,7 @@
}
},
// 壁纸推荐
//壁纸推荐
wallpaperOnclick() {
this.isShowGif = false;
var that = this
......@@ -1461,7 +1597,7 @@
success: function(res) {
//console.log(res)
if (res.statusCode != 200) {
// console.log({errCode: '599', msg:'其他错误'})
//console.log({errCode: '599', msg:'其他错误'})
return;
}
if (res.statusCode == 200) {
......@@ -1471,8 +1607,8 @@
icon: 'none',
duration: 3000
})
// console.log(atter.host + '/' + atter.dir +
// time + '.jpg')
//console.log(atter.host + '/' + atter.dir +
//time + '.jpg')
uni.getImageInfo({
src: tempFilePaths[0],
success: (image) => {
......@@ -1518,16 +1654,9 @@
'/' + atter
.dir + time +
'.jpg'
item.initialHeight =
item.height
item.initialWidth =
H1 / H2 * image
.width
item.image_left = -
(H1 / H2 *
image
.width - W1
) / 2
item.initialHeight = item.height
item.initialWidth = H1 / H2 * image.width
item.image_left = -(H1 / H2 * image.width - W1) / 2
} else {
item.content = atter.host + '/' + atter.dir + time + '.jpg'
}
......@@ -1582,16 +1711,25 @@
var size = res.tempFiles[0].size;
var path = res.tempFiles[0].path;
var formatImage = path.split(".")[(path.split(".")).length - 1];
if (formatImage != "png" && formatImage != "jpg" && formatImage != "jpeg") {
return wx.showToast({
title: '只能上传.png、.jpg、.jpep 格式',
icon: 'none',
image: '',
duration: 2000,
mask: true,
})
}
this.uploadDIY(tempFilePaths, 0, 0, 0, tempFilePaths.length);
//var formatImage = path.split(".")[(path.split(".")).length - 1];
if (formatImage != "png" &&
formatImage != "jpg" &&
formatImage != "jpeg" &&
formatImage != "webp" &&
formatImage != "gif" &&
formatImage != "bmp" &&
formatImage != "tiff" &&
formatImage != "tif"
) {
return uni.showToast({
title: '只能上传.png、.jpg、.jpep、.webp、.gif、. bmp、. tiff、. tif格式',
icon: 'none',
image: '',
duration: 2000,
mask: true,
})
}
this.uploadDIY(tempFilePaths, 0, 0, 0, tempFilePaths.length,formatImage);
}
})
},
......@@ -1613,16 +1751,24 @@
var size = res.tempFiles[0].size;
var path = res.tempFiles[0].path;
var formatImage = path.split(".")[(path.split(".")).length - 1];
if (formatImage != "png" && formatImage != "jpg" && formatImage != "jpeg") {
return wx.showToast({
title: '只能上传.png、.jpg、.jpep 格式',
if (formatImage != "png" &&
formatImage != "jpg" &&
formatImage != "jpeg" &&
formatImage != "webp" &&
formatImage != "gif" &&
formatImage != "bmp" &&
formatImage != "tiff" &&
formatImage != "tif"
) {
return uni.showToast({
title: '只能上传.png、.jpg、.jpep、.webp、.gif、. bmp、. tiff、. tif格式',
icon: 'none',
image: '',
duration: 2000,
mask: true,
})
}
this.uploadDIY(tempFilePaths, 0, 0, 0, tempFilePaths.length);
this.uploadDIY(tempFilePaths, 0, 0, 0, tempFilePaths.length,formatImage);
},fail(res) {
console.log(res);
}
......@@ -1643,20 +1789,28 @@
var size = res.tempFiles[0].size;
var path = res.tempFiles[0].path;
var formatImage = path.split(".")[(path.split(".")).length - 1];
if (formatImage != "png" && formatImage != "jpg" && formatImage != "jpeg") {
return wx.showToast({
title: '只能上传.png、.jpg、.jpep 格式',
if (formatImage != "png" &&
formatImage != "jpg" &&
formatImage != "jpeg" &&
formatImage != "webp" &&
formatImage != "gif" &&
formatImage != "bmp" &&
formatImage != "tiff" &&
formatImage != "tif"
) {
return uni.showToast({
title: '只能上传.png、.jpg、.jpep、.webp、.gif、. bmp、. tiff、. tif格式',
icon: 'none',
image: '',
duration: 2000,
mask: true,
})
}
this.uploadDIY(tempFilePaths, 0, 0, 0, tempFilePaths.length);
this.uploadDIY(tempFilePaths, 0, 0, 0, tempFilePaths.length,formatImage)
}
})
},
/* 上传图片重微信 */
/*上传图片重微信 */
addItemFromeWx: async function() {
this.isUpLoadImage = true;
this.showone = false
......@@ -1671,18 +1825,26 @@
var path = res.tempFiles[0].path;
tempFilePaths[0] = path;
var formatImage = path.split(".")[(path.split(".")).length - 1];
if (formatImage != "png" && formatImage != "jpg" && formatImage != "jpeg") {
return wx.showToast({
title: '只能上传.png、.jpg、.jpep 格式',
if (formatImage != "png" &&
formatImage != "jpg" &&
formatImage != "jpeg" &&
formatImage != "webp" &&
formatImage != "gif" &&
formatImage != "bmp" &&
formatImage != "tiff" &&
formatImage != "tif"
) {
return uni.showToast({
title: '只能上传.png、.jpg、.jpep、.webp、.gif、. bmp、. tiff、. tif格式',
icon: 'none',
image: '',
duration: 2000,
mask: true,
})
}
this.uploadDIY(tempFilePaths, 0, 0, 0, tempFilePaths.length);
this.uploadDIY(tempFilePaths, 0, 0, 0, tempFilePaths.length,formatImage);
},fail: (res)=>{
console.log(res)
//console.log(res)
}
})
},
......@@ -1705,7 +1867,7 @@
* i是文件路径数组的指标->0
* length是文件路径数组的长度
*/
uploadDIY(tempFilePaths, successUp, failUp, i, length) {
uploadDIY(tempFilePaths, successUp, failUp, i, length,formatImage) {
let machine_id = this.machine_id || 0
let user_id = userService.getUserInfo().id || 0
var _this = this
......@@ -1727,7 +1889,7 @@
filePath: tempFilePaths[i],
name: 'file',
formData: {
'key': atter.dir + time + '.jpg',
'key': atter.dir + time + '.' + formatImage,
'OSSAccessKeyId': atter.accessid,
'policy': atter.policy,
'Signature': atter.signature,
......@@ -1735,14 +1897,23 @@
'callback': atter.callback,
},
success: function(res) {
//console.log(res)
// console.log(res)
successUp++;
if (res.statusCode != 200) {
return;
}
if (res.statusCode == 200) {
_this.percent = 100
uni.showToast({
var imageUrl = atter.host + '/' + atter.dir + time + '.' + formatImage;
_this.upLoadImageUrl = imageUrl
if (
formatImage == "bmp" ||
formatImage == "tiff" ||
formatImage == "tif"){
_this.upLoadImageUrl = imageUrl + "?x-oss-process=image/format,png"
}
/*console.log(_this.upLoadImageUrl); */
/*uni.showToast({
title: '上传成功',
icon: 'none',
duration: 3000
......@@ -1815,10 +1986,11 @@
_this.isUpLoadImage = false;
_this.saveSnapshot();
}
});
}
});*/
}
},
fail: function(err) {
//console.log(err)
_this.isUpLoadImage = false;
failUp++;
uni.showToast({
......@@ -1828,7 +2000,7 @@
})
},
complete: function(err) {
console.log(err)
}
})
uploadTask.onProgressUpdate((res) => {
......@@ -1857,6 +2029,7 @@
this.goodslist() // 获取产品详情数据
this.orderNewLockAttrStock()
},
orderNewLockAttrStock() {
homeservice.queryList({ // 释放锁定库存
s: 'Order.newLockAttrStock',
......@@ -2007,20 +2180,16 @@
x: left + width / 2,
y: top + height / 2
}
item.x = item.centerPos.x;
item.y = item.centerPos.y;
if (item.angle != 0) {
scalePos = this.calRocatePos(scalePos, {
x: item.x,
y: item.y
}, item.angle);
}
let widScale = pixelRate * this.design_widthrate; //宽度比例
let heiScale = pixelRate * this.design_heightrate; //高度比例
var comlist = {
support_zoom: item.support_zoom, // 0是不支持缩放,为1时支持缩放
support_drag: item.support_drag, // 0是不支持拖动,为1时支持拖动
......@@ -2056,13 +2225,11 @@
center_x: item.x / widScale,
center_y: item.y / heiScale,
}
// type: 0, //0为图片,1为文字,2为素材
//type: 0, //0为图片,1为文字,2为素材
if (item.type == 0) {
//新添加的参数
comlist.image_left = item.image_left ? (item.image_left + item.left) / widScale : (
left / widScale) // 图片的x
comlist.image_top = item.image_top ? (item.image_top + item.top) / heiScale : (top /
heiScale) // 图片的y
comlist.image_left = item.image_left ? (item.image_left + item.left) / widScale : ( left / widScale) // 图片的x
comlist.image_top = item.image_top ? (item.image_top + item.top) / heiScale : (top / heiScale) // 图片的y
comlist.image_width = item.initialWidth * item.initialScale / widScale // 图片宽度
comlist.image_height = item.initialHeight * item.initialScale / heiScale // 图片高度
}
......@@ -2187,15 +2354,22 @@
},
self_help(loading, works_id) {
var type = 3;
var support_pay = 1;
if(this.baseSetting){
support_pay = this.baseSetting.support_pay
if(support_pay == 0){
type = 2
}
}
let data = {
s: 'Order.create',
//type: this.key, //1:配送版,2:单机版,3:自助版
type: 3, //1:配送版,2:单机版,3:自助版
type: type, //1:配送版,2:单机版,3:自助版
machine_id: this.machine_id, //设备
goods_id: this.data.goods_id, //产品
works_id: works_id, //作品
channel_no: this.channel_no , //货道
//dict_id: null, //属性字典id
dict_id: this.dict_id, //属性字典id
goods_size: this.sizetext, //产品尺寸
works_num: null, //作品
......@@ -2203,16 +2377,20 @@
sn: this.sn, //前端查询标志
coupon_id: null, //优惠券id,支付多个id( 1-2-3)
user_address: null, //地址
support_pay: 1, //单机版是否支付
support_pay: support_pay, //单机版是否支付
}
if (this.coupon.ids != undefined) {
data.coupon_id = this.coupon.ids.join("-")
}
homeservice.WorksList(data).then(result => {
//关闭当前页面,跳转到应用内的某个页面。
this.payment(result.pay, result.order_id)
if(support_pay == 1){
this.payment(result.pay, result.order_id)
}else{
uni.navigateTo({
url: '../mall/lineUp?machine_id=' + this.machine_id
})
}
setTimeout(function() {
isclick = true;
}, 1000)
......@@ -2260,7 +2438,6 @@
});
},
//切换手机
topagecategory(e) {
homeservice.queryList({
......@@ -2280,7 +2457,6 @@
});
},
onok(item) {
this.state = false
//赋值就移动了
......@@ -2373,6 +2549,9 @@
//获取作品详情
Worksdetail(item) {
if(item == null){
return;
}
this.delete_wrap_state = true
if (wx.pageScrollTo) {
wx.pageScrollTo({
......@@ -2455,7 +2634,8 @@
is_discount: item.is_discount, //贴图是否用卷
idone: item.id,
id: i + 1,
type: item.type.value,
//type: 0,
type: item.type.value ,
material_id: item.material_id,
index: item.index,
font_family: item.font_family,
......@@ -2531,13 +2711,13 @@
original_id = result.id;
material_id = result.id;
}
//读取主图遮罩
uni.getImageInfo({
src: urlData,
success: (image) => {
if (this.e_active == 23) {
// 清空历史记录
//清空历史记录
items = []; // 当前显示的图片列表
index = 0; // 所点击的图片的索引
snapshot = []; // 操作历史记录清空
......@@ -2554,11 +2734,11 @@
let ratioheight = (this.data.editorHeight * this.mix_scale) / image.height
let resultmix_scale = result.mix_scale || 1
//if (ratio >= 1) { //长方形
width = this.data.editorWidth * this.mix_scale * resultmix_scale
height = image.height * ratiowidth * resultmix_scale
//width = this.data.editorWidth * this.mix_scale * resultmix_scale
//height = image.height * ratiowidth * resultmix_scale
// } else if (ratio < 1) { //长高方形
// height = this.data.editorHeight * this.mix_scale * resultmix_scale
// width = image.width * ratioheight * resultmix_scale
height = this.data.editorHeight * this.mix_scale * resultmix_scale
width = image.width * ratioheight * resultmix_scale
// }
if (result.is_under == 1) {
let number_index = 0
......@@ -2957,6 +3137,7 @@
//关闭弹框
cancel(type) {
this.isShowPop = false
this.e_active = 0
this.$refs['showshare'].close()
this.$refs['textsettingsshare'].close();
......@@ -4335,8 +4516,7 @@
s: 'Material.category',
machine_id: this.machine_id,
key: 0,
surface_color_series_id: this.$base.surfaceData
.surface_color_series_id //色系编号
surface_color_series_id: this.$base.surfaceData.surface_color_series_id //色系编号
}).then(result => {
this.Material_category = result
this.Adlists = this.diy_bannerList
......@@ -4552,6 +4732,8 @@
let app = uni.getSystemInfoSync();
//胶囊信息
let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
//this.menuButtonInfo = menuButtonInfo;
this.menuButtonInfoTop = menuButtonInfo.top;
this.headheight = app.statusBarHeight + menuButtonInfo.height + (menuButtonInfo.top - app.statusBarHeight) * 2
items = []
let that = this;
......@@ -4578,19 +4760,6 @@
that.drag_text_context = "单指可拖拽";
that.cutting_text_context = "双指可伸缩";
that.itemClick(e)
/*var curTime = e.timeStamp
var lastTime = e.currentTarget.dataset.time //通过e.currentTarget.dataset.time 访问到绑定到该组件的自定义数据
if (curTime - lastTime > 0) {
if (curTime - lastTime < 300) { //是双击事件
if (items[index].type == 0) {
that.state = true
that.$refs.index.init();
}
} else {
that.itemClick(e);
}
} */
//that.lastTapTime = curTime
}
},
touchStart: function(e) { //拖拽开始
......@@ -5337,7 +5506,7 @@
.toolLeft {
position: fixed;
top: 400upx;
top: 340upx;
left: 0;
width: 100upx;
......@@ -5361,15 +5530,26 @@
}
}
//底部工具栏
.toolRight {
position: fixed;
/*position: fixed;
top: 440upx;
right: 0;
width: 120upx;
display: flex;
flex-direction: column; */
//底部工具栏
.toolRight {
position: fixed;
//top: 440upx;
height: 110upx;
left: 0;
bottom: 0;
width: calc(100% - 230upx);
display: flex;
flex-direction: row;
.tool_li {
width: 100%;
width: 130upx;
height: 110upx;
.tool_li_img {
......
......@@ -259,7 +259,8 @@ const drag = {
//四边伸缩
edgeMove(e, item, data, allLineListData, designWidth, designHeight) {
//console.log("四边伸缩")
//修改属性状态
item.active = true //辅助线
item.activeguide = false //辅助线
......@@ -290,7 +291,7 @@ const drag = {
y: 'top'
}
item.elmW += diffX * (-1) //计算宽度
} else if (item.typetext == "top") { //
} else if (item.typetext == "top") { //
fixed = {
x: 'left',
y: 'bottom'
......@@ -328,9 +329,9 @@ const drag = {
let newScale = 1;
if (item.typetext == "right") {
let right = designWidth - (item.left + item.width);
/* let right = designWidth - (item.left + item.width);
item.left = item.elmX; //重新赋值左上角x位置
item.width = item.elmW //重新设置宽度
item.width = item.elmW //重新设置宽度 */
newScale = item.elmW / item.lastElmW //计算新比例
if (newScale > 1) { //开始放大处理
let newWidthScale = Math.abs((item.elmW - item.lastElmW) / item.initialWidth);
......
<template>
<view class="full-width">
<!-- 登录弹框 -->
<Signin ref="Signin"></Signin>
<view class="full-width full-height">
<!-- 自定义头部 -->
<view class='flex commonHead' :style="{height: titleHeight +'px'}">
<view class='commonHead-wrap flex'>
<view class='commonHead_right flex'>
<view class='commonHead_right_text line1'>手机壳定制站</view>
</view>
<view v-if="showType == 0" @tap="doubleTap" @touchstart="touchStart" @touchend="touchEnd"
style="position: fixed; z-index: 99; right: 0; bottom: 550upx; display: flex;align-items: center;justify-content: center;
width: 100upx; height: 88upx; background: linear-gradient(92deg, #64DD17, #64DD17); border-radius: 44upx 0px 0px 44upx;">
<view style="font-size: 24upx; font-weight: 800; color: #FFFFFF;">
<view>定制</view>
<view>体验</view>
</view>
</view>
<!-- 无设备 -->
<view v-if="long && LoupanList.length == 0" style="min-height: 100%;">
<view class="start" style="padding-top: 200upx;">
<image src="../../static/home_icon_default_no.png" mode="aspectFill" class="start_img"></image>
<view class="start_title">啊嘞,附近没有手机壳定制站哦</view>
</view>
<image src="../../static/logo.jpg" mode="aspectFill" style="width: 664upx;
height: 757upx;opacity: 0.03; position: absolute; left: 0; bottom: 0;z-index: -1;"></image>
<view @click="experience()" style="width: 230upx; height: 70upx; line-height: 70upx; text-align: center; color: #FFFFFF;
margin:40upx auto 0; border-radius: 35upx; background: linear-gradient(to right,#834DC4,#1983D7);">
再找一找
</view>
<!-- 定制体验 -->
<view v-if="system_config.phone_diy.value == 0" @click="doubleTap" @touchstart="touchStart"
@touchend="touchEnd" style="width: 500upx; position: fixed; bottom:100upx; margin: auto;
height: 164upx; background: #131319; left: 0; right: 0; z-index: 99; border-radius: 20upx;
display: flex; align-items: center;">
<view style="background: #282A32; width: 120upx;
height: 120upx;border-radius: 50%; margin: 22upx 30upx 22upx 46upx;text-align: center;">
<image style="width: 63upx; height: 27upx; margin:46upx auto; display: inline-block;"
src="../../static/mine/icon_diy.png" mode=""></image>
</view>
<view style="color: #FFFFFF; font-size: 36upx;">定制体验</view>
<view style="display: flex; justify-content: center; height: 100%;">
<view style="margin-top: 231upx;">
<image src="../../static/icon_diy.png" mode="" style="width: 513upx; height: 251upx;"></image>
<view style="margin-top: 60upx; text-align: center; ">定制站必须扫码才能使用</view>
</view>
</view>
<!-- 有设备 -->
<view v-if="LoupanList.length > 0">
<view style="margin-top: 29upx;">
<view v-if="system_config.phone_diy.value == 0" @tap="doubleTap" @touchstart="touchStart"
@touchend="touchEnd"style="position: fixed; z-index: 99;
right: 0;
bottom: 524upx;
display: flex;
align-items: center;
justify-content: center;
width: 100upx; height: 88upx;
background: linear-gradient(92deg, #64DD17, #64DD17);
border-radius: 44upx 0px 0px 44upx;">
<view style="font-size: 24upx; font-weight: 800; color: #FFFFFF;">
<view>定制</view>
<view>体验</view>
</view>
</view>
<!-- 附近定制站 -->
<view style="font-size: 36upx; margin-top: 40upx; margin-left: 40upx; font-weight: bold; color: #FFFFFF;">附近定制站</view>
<view style="width: 690upx; margin: 30upx auto 0; background: #131319; border-radius: 10upx;">
<view v-for="(item, index) in LoupanList" :key="index" @click="goMachineDetail(item)">
<view v-if="index != 0" style="width: 689upx; height: 1upx; background: #CCCCCC; opacity: 0.1;">
</view>
<view
style="height: 160upx; display: flex; align-items: center; padding: 29upx 20upx 30upx 19upx;">
<image
style="width: 160upx; height: 164upx; margin: 0upx 21upx 0upx 0upx; border-radius: 10upx;"
mode="aspectFill" :src="item.image + '?x-oss-process=image/resize,lfit,w_375'"></image>
<view style="width: calc(100% - 281upx);">
<view style="margin: 5upx 0 10upx; font-size: 32upx; font-weight: 500; color: #FFFFFF;
width: 90%; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; word-break: break-all;"
:style="{opacity:item.status.value == 1 || item.status.value == 2 ? '1' : '0.4'}">
{{item.short_name || ''}}
</view>
<view style="font-size: 24upx; font-weight: 500; color: #FFFFFF; opacity: 0.4;">
营业时间:{{item.start_time || ''}}-{{item.end_time || ''}}
</view>
<view style="margin: 28upx 0 10upx;">
<!-- 设备状态 0:离线 1:正常 2:生产中 3:故障 4:调试 5:升级中 -->
<text v-if="item.status.value == 0" class="statuslist"
style="background:#F2A03E;">正在休息</text>
<text v-if="item.status.value == 1" class="statuslist"
style="background:#5CE6B5;">正在定制</text>
<text v-if="item.status.value == 2" class="statuslist"
style="background:#5CE6B5;">正在定制</text>
<text v-if="item.status.value == 3" class="statuslist"
style="background:#F2A03E;">正在休息</text>
<text v-if="item.status.value == 4" class="statuslist"
style="background:#F2A03E;">正在休息</text>
<text v-if="item.status.value == 5" class="statuslist"
style="background:#F2A03E;">正在休息</text>
</view>
</view>
<view @click.stop="toLocation(item)" v-if="item.distance"
style="width: 100upx;margin-left:auto;">
<view
style="width: 60upx; height: 60upx; background: #FFFFFF; border-radius: 50%; margin: auto;">
<view class="iconfont iconditu" style="color: #5E93F9; font-size: 32upx;
line-height: 60upx; text-align: center;"></view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 扫码定制 -->
<view @click="scanning" style="width: 460upx; position: fixed; bottom: 100upx; margin: auto;
height: 164upx; background: #F29F3D; left: 0; right: 0; z-index: 99; border-radius: 20upx;
display: flex; align-items: center;">
<view style="background: #FFFFFF;width: 120upx;
height: 120upx;border-radius: 50%; margin: 22upx 30upx;text-align: center;">
<image style="height: 61upx; width: 61upx;margin:32upx auto;" src="../../static/icon_saoyisao.png"
mode=""></image>
</view>
<view style="color: #FFFFFF; font-size: 36upx;">开始扫码定制</view>
</view>
<!-- 登录弹框 -->
<Signin ref="Signin"></Signin>
</view>
</template>
......@@ -118,7 +46,9 @@
Signin,
FrImage
},
computed: {},
computed: {
},
data() {
return {
titleHeight: null,
......@@ -139,11 +69,71 @@
imgheights: [],
imageLoadstate: false,
system_config: null,
portraitUrl: null //头像地址
portraitUrl: null ,//头像地址
showType: 1,
};
},
methods: {
scanning() {
let that = this;
/*允许从相机和相册扫码
QR_CODE 普通二维码
WX_CODE 小程序二维码
生成二维码链接
*/
uni.scanCode({
success: function(res) {
console.log(res)
if (res.scanType == 'QR_CODE') {
if (that.getQueryString(res.result, 'machine_id') && that.getQueryString(res
.result, 'machine_id') != "" && that.getQueryString(res.result,
'machine_id') != null && that.getQueryString(res.result,
'machine_id') != "null") {
uni.navigateTo({
url: '../index/start-up?machine_id=' + that
.getQueryString(
res.result, 'machine_id')
});
} else {
uni.showToast({
title: '扫码未能识别色彩站,请检查二维码',
icon: 'none',
duration: 2000
});
}
} else {
if (res.path) {
if (that.getQueryString(res.path, 'machine_id') && that.getQueryString(res
.path, 'machine_id') != "" && that.getQueryString(res
.path, 'machine_id') != null && that.getQueryString(res.path,
'machine_id') != "null") {
uni.navigateTo({
url: '../index/start-up?machine_id=' + that
.getQueryString(res.path, 'machine_id')
});
} else {
uni.showToast({
title: '扫码未能识别色彩站,请检查二维码',
icon: 'none',
duration: 2000
});
}
} else {
uni.showToast({
title: '扫码未能识别色彩站,请检查二维码',
icon: 'none',
duration: 2000
});
}
}
},
fail: function(err) {
console.log(err)
},
});
},
//调转色彩公园优惠券
toCoupon(item) {
......@@ -174,7 +164,7 @@
if (item.appid && item.go_url) {
var url = this.$Env.getBaseURL();
var envVersionName = "trial";
if (url.indexOf("colorpark") != -1) {
if (url.indexOf("kexiaozhan") != -1) {
envVersionName = "release";
}
wx.navigateToMiniProgram({
......@@ -282,24 +272,7 @@
})
},
coupons() {
var url = this.$Env.getBaseURL();
var envVersionName = "trial";
if (url.indexOf("colorpark") != -1) {
envVersionName = "release";
}
wx.navigateToMiniProgram({
appId: Env.getappId(),
path: '/pages/index/recommend?selectTitleType=2',
extraData: {
foo: 'bar'
},
envVersion: envVersionName,
success(res) {
// 打开成功
}
})
},
tomine() {
wx.navigateToMiniProgram({
......@@ -550,6 +523,14 @@
this.titleHeight = sys.statusBarHeight + 46
this.phone_mall()
this.systemConfig()
var url = this.$Env.getBaseURL();
if (url.indexOf("kexiaozhan") != -1) {
this.showType = 1
}else{
this.showType = 0
}
}
};
</script>
......@@ -563,7 +544,7 @@
}
page {
background: #282932 !important;
background: #fff !important;
width: 100%;
margin: 0;
padding: 0;
......
......@@ -7,22 +7,17 @@
<view style="margin: auto; width: 100%; text-align: center;color: #999; margin-top: 0upx; ">点击获取微信头像</view>
</view>
<view class="nickname" style="background: #61D119; margin-top: 40upx;">
<!--<text>昵称:</text> -->
<!-- <view class="nickname" style="background: #61D119; margin-top: 40upx;">
<input type="nickname" class="weui-input" style="color: #fff;" :value="nickName" @blur="bindblur"
placeholder="点击获取微信昵称" @input="bindinput" placeholder-class="my-input-placeholder" />
</view>
<!-- <view style="width: calc(100% - 100upx); height: 1upx; background: #eee; margin: auto;"> </view>-->
</view> -->
<view class="btn">
<view class="btn-sub" @tap="getUserProfile">保存</view>
</view>
<view class="btn">
<view class="btn-sub" @click="onSubmit">保存</view>
</view>
</view>
</template>
......
......@@ -18,7 +18,7 @@
</view>
<!-- 自定义头部 -->
<myhead :worksid="worksid" :title="myheadtext" :color="'#64DD17'" :titleShow="true" :backShow="true"
<myhead :worksid="worksid" :title="myheadtext" :color="'#64DD17'" :titleShow="true" :backShow="false"
:background="'none'"></myhead>
<view style="position: relative;width: 100%; height: 100%; z-index: 2;">
<!-- 轮播图 status-->
......@@ -67,20 +67,28 @@
</view>
<view v-if="statusloading == 2"
style="margin-top: -50upx;text-align: center;color: #888888; font-weight: 400; line-height: 40upx;">
<text style="font-size: 22upx;">深圳市瑞丰彩科技有限公司</text>
<text style="font-size: 22upx;">广州壳小站有限公司</text>
</view>
</view>
<view v-if="isShowPop"
style="z-index: 999999; width: 100%; height: 100%; position: absolute; top: 0upx; left: 0upx" :style="{height: data.windowHeight +'px'}">
<view class="uni-share full-width" :style="{height: data.windowHeight +'px'}" style="background: #fff;">
<view style="position: absolute; bottom: 0upx; left: 0;
height: 100%; width: 120upx;
z-index: 7;
overflow: hidden;">
<view style="width: 120upx; height: 190upx;"></view>
<view style="width: 120upx; height: 190upx;">
<view :style="{ height: headheight + 'px'}" style="width: 100%; z-index: 9999;">
<view class="back" @tap="cancel('share')">
<image src="../../static/recommend/icon_back.png" mode="aspectFit" style="width: 42upx; height: 42upx;
margin-left: 20upx;" :style="{ marginTop: menuButtonInfoTop + 10 + 'px'}"></image>
</view>
</view>
</view>
<view style="width: 112upx; padding-left: 8upx;" :style="{height: (data.windowHeight - 188 * data.pixelRate) +'px'}">
<scroll-view class="scroll-container"
:style="{height: (data.windowHeight - 160 * data.pixelRate) +'px'}" scroll-y
......@@ -98,8 +106,7 @@
</view>
<view style="position: absolute; bottom: 0upx; left: 116upx; height: 100%; width: 100%;
z-index: 8; overflow: hidden; ">
z-index: 8; overflow: hidden; ">
<view style="width: calc(100% - 150upx); height: calc(100% - 180upx); position: relative;overflow: hidden;
border: 4upx solid #61D119; margin-top: 140upx; margin-right: 10upx; ">
......@@ -133,15 +140,9 @@
</view>
</view>
</scroll-view>
</view>
</view>
<view style="position: absolute; bottom: 0upx; left: 0;
height: 100%; width: 5upx;
z-index: 9;
overflow: hidden;">
<view style="position: absolute; bottom: 0upx; left: 0;height: 100%; width: 5upx; z-index: 9; overflow: hidden;">
<view style="width: 5upx; padding-left: 0upx; margin-top: 190upx;" :style="{height: (data.windowHeight - 188 * data.pixelRate) +'px'}">
<scroll-view class="scroll-container"
......@@ -151,15 +152,12 @@
:class="[index == currentId ? 'scroll-item-buttom-select' : 'scroll-item-buttom-no-select']"
v-for="(item, index) in brandList" :key="index" @tap="brandclick(index,item)" >
<!-- <view style="width: 20upx; background: #fff;margin-left: 0upx ;height: 140upx" :style="{background: index == currentId ? '#fff' :'#00000000' }"> </view> -->
</view>
</scroll-view>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
</view>
<!-- 登录弹框 -->
......@@ -213,7 +211,7 @@
},
stockstatus: null,
msg: null,
worksid: 1,
worksid: 3111,
statusloading: null, //加载状态
phone: '18938664545',
isLoad: false, //是否加载
......@@ -230,7 +228,9 @@
classificationHeight: 0,
goods_id_e:{},
datalist:[],
isShowPop:false
isShowPop:false,
menuButtonInfoTop:0,
headheight:0
};
},
......@@ -725,6 +725,7 @@
}
return null;
}
},
//上拉刷新
......@@ -770,6 +771,10 @@
this.$base.promoter_id = this.getQueryString(qrUrl, 'promoter_id')
}
this.Adlist()
let app = uni.getSystemInfoSync();
let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
this.menuButtonInfoTop = menuButtonInfo.top;
this.headheight = app.statusBarHeight + menuButtonInfo.height + (menuButtonInfo.top - app.statusBarHeight) * 2
this.isLoad = true;
if (this.machine_id != null && this.machine_id != "") {
this.getDetail();
......
......@@ -5,8 +5,8 @@ if(!accountInfo.miniProgram.envVersion){
const baseApi = {
//开发版
//develop: "https://kxz.refinecolor.com",
develop: "https://print.kexiaozhan.cn",
develop: "https://kxz.refinecolor.com",
//develop: "https://print.kexiaozhan.cn",
//体验版
trial: "https://kxz.refinecolor.com",
//正式版
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment