Commit dffdd6f2 by huahua

修改头获取

parent 0cebc7b6
{ {
"name" : "mobile-phone-shell-applet", "name" : "壳小站打印机",
"appid" : "__UNI__AB0E0FC", "appid" : "__UNI__AB0E0FC",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",
"versionCode" : "100", "versionCode" : "100",
"transformPx" : false, "transformPx" : false,
"networkTimeout":{ "networkTimeout" : {
"uploadFile":60000, "uploadFile" : 60000,
"request":60000 "request" : 60000
}, },
"app-plus" : { "app-plus" : {
/* 5+App特有相关 */ /* 5+App特有相关 */
"usingComponents" : true, "usingComponents" : true,
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
/* 快应用特有相关 */ /* 快应用特有相关 */
"mp-weixin" : { "mp-weixin" : {
/* 小程序特有相关 */ /* 小程序特有相关 */
"appid" : "wxdca8810ccd426633", "appid" : "wx3d8b992243f6e678",
"setting" : { "setting" : {
"urlCheck" : true, "urlCheck" : true,
"postcss" : true, "postcss" : true,
...@@ -98,9 +98,9 @@ ...@@ -98,9 +98,9 @@
"desc" : "获取当前位置" "desc" : "获取当前位置"
} }
}, },
"requiredPrivateInfos": ["getLocation","chooseAddress"] "requiredPrivateInfos" : [ "getLocation", "chooseAddress" ]
}, },
//"requiredPrivateInfos": ["getLocation","chooseAddress"], //"requiredPrivateInfos": ["getLocation","chooseAddress"],
// "navigateToMiniProgramAppIdList":[ "wx55b5b6d95c648041"] // "navigateToMiniProgramAppIdList":[ "wx55b5b6d95c648041"]
"h5" : { "h5" : {
"devServer" : { "devServer" : {
......
{ {
"pages": [{ "pages": [
{
"path": "pages/index/mall", "path": "pages/index/mall",
"style": { "style": {
"navigationBarTitleText": "色彩公园手机壳", "navigationBarTitleText": "色彩公园手机壳",
...@@ -15,6 +16,12 @@ ...@@ -15,6 +16,12 @@
} }
}, },
{ {
"path": "pages/index/nick-name",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/index/start-up", "path": "pages/index/start-up",
"style": { "style": {
"navigationBarTitleText": "打印", "navigationBarTitleText": "打印",
...@@ -119,6 +126,7 @@ ...@@ -119,6 +126,7 @@
"navigationBarTitleText": "商品尺码" "navigationBarTitleText": "商品尺码"
} }
} }
] ]
} }
] ]
......
<template> <template>
<view class="full-width"> <view class="full-width">
<!-- 登录弹框 -->
<Signin ref="Signin"></Signin>
<!-- 自定义头部 --> <!-- 自定义头部 -->
<view class='flex commonHead' :style="{height: titleHeight +'px'}"> <view class='flex commonHead' :style="{height: titleHeight +'px'}">
<view class='commonHead-wrap flex'> <view class='commonHead-wrap flex'>
<view class='commonHead_left' @click="tomine()"> <view class='commonHead_left' @click="tomine()">
<view class='commonHead_left_back'> <view class='commonHead_left_back'>
<view class="commonHead_left_back_img"> <view class="commonHead_left_back_img">
<image :src="portraitUrl" style="width: 50upx; height: 50upx; border-radius: 30upx; margin-top: 10upx; background: #FFFFFF; " <image :src="portraitUrl" style="width: 50upx; height: 50upx; border-radius: 30upx; margin-top: 10upx; background: #FFFFFF;" mode="aspectFill"></image>
mode="aspectFill"></image>
</view> </view>
</view> </view>
</view> </view>
...@@ -44,41 +47,8 @@ ...@@ -44,41 +47,8 @@
<!-- 有设备 --> <!-- 有设备 -->
<view v-if="LoupanList.length > 0"> <view v-if="LoupanList.length > 0">
<view style="margin-top: 29upx;"> <view style="margin-top: 29upx;">
<view style="width: 690upx; margin:30upx auto 30upx; display: flex;">
<view>
<view style="position: relative; width: 320upx; height: 160upx;" @click="order()">
<image src="../../static/main/dingdan@3x.png" mode=""
style="width: 320upx; height: 160upx; position: absolute;z-index: -1;"></image>
<view
style="margin-left:26upx; padding-top: 27upx; font-size: 36upx; color: #FFFFFF;font-weight: bold;">
订单</view>
<view style="margin-top: 15upx;margin-left:26upx;font-size: 24upx;
font-weight: 400; color: #FFFFFF;">我的定制</view>
</view>
<view style="margin-top: 16upx; position: relative;width: 320upx; height: 160upx;"
@click="coupons()">
<image src="../../static/main/huayihua@3x.png" mode=""
style="width: 320upx; height: 160upx; position: absolute;z-index: -1;"></image>
<view
style="margin-left:26upx; padding-top: 27upx; font-size: 36upx; color: #FFFFFF;font-weight: bold;">
滑一滑</view>
</view>
</view>
<view style="margin-left: 15upx;width: 350upx; height: 340upx;" @click="tomine()">
<image src="../../static/main/wo@3x.png" mode=""
style="width: 350upx; height: 340upx; position: absolute;z-index: -1;"></image>
<view
style="margin-left:30upx; padding-top: 39upx; font-size: 36upx; color: #FFFFFF;font-weight: bold;">
个人中心</view>
<view style="margin-top: 15upx;margin-left:30upx;font-size: 24upx;
font-weight: 400; color: #FFFFFF;">更多作品更多精彩</view>
</view>
</view>
<!-- v-if="system_config.phone_diy.value == 0" -->
<view v-if="system_config.phone_diy.value == 0" @tap="doubleTap" @touchstart="touchStart" <view v-if="system_config.phone_diy.value == 0" @tap="doubleTap" @touchstart="touchStart"
@touchend="touchEnd" @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, #178CE6, #984ACE); border-radius: 44upx 0px 0px 44upx;">
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, #178CE6, #984ACE); border-radius: 44upx 0px 0px 44upx;">
<view style="font-size: 24upx; font-weight: 800; color: #FFFFFF;"> <view style="font-size: 24upx; font-weight: 800; color: #FFFFFF;">
<view>定制</view> <view>定制</view>
<view>体验</view> <view>体验</view>
...@@ -106,7 +76,6 @@ ...@@ -106,7 +76,6 @@
</view> </view>
<view style="margin: 28upx 0 10upx;"> <view style="margin: 28upx 0 10upx;">
<!-- 设备状态 0:离线 1:正常 2:生产中 3:故障 4:调试 5:升级中 --> <!-- 设备状态 0:离线 1:正常 2:生产中 3:故障 4:调试 5:升级中 -->
<!-- 正常、打印中:正在定制,其他的都是:休息中 -->
<text v-if="item.status.value == 0" class="statuslist" <text v-if="item.status.value == 0" class="statuslist"
style="background:#F2A03E;">正在休息</text> style="background:#F2A03E;">正在休息</text>
<text v-if="item.status.value == 1" class="statuslist" <text v-if="item.status.value == 1" class="statuslist"
...@@ -225,19 +194,23 @@ ...@@ -225,19 +194,23 @@
}) })
} }
}, },
swiperChange(e) { swiperChange(e) {
this.currentSwiper = e.detail.current this.currentSwiper = e.detail.current
}, },
experience() { experience() {
uni.navigateTo({ uni.navigateTo({
url: '../mall/experience' url: '../mall/experience'
}) })
}, },
tomyorder() { //订单列表 tomyorder() { //订单列表
uni.navigateTo({ uni.navigateTo({
url: '../mine/myorder' url: '../mine/myorder'
}) })
}, },
toLocation(item) { toLocation(item) {
uni.showLoading({ uni.showLoading({
title: '导航加载中...' title: '导航加载中...'
...@@ -258,6 +231,7 @@ ...@@ -258,6 +231,7 @@
} }
}); });
}, },
getQueryString(url, name) { getQueryString(url, name) {
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i') var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
var r = url.substr(1).match(reg) var r = url.substr(1).match(reg)
...@@ -289,7 +263,6 @@ ...@@ -289,7 +263,6 @@
}, },
order() { order() {
var url = this.$Env.getBaseURL(); var url = this.$Env.getBaseURL();
var envVersionName = "trial"; var envVersionName = "trial";
if (url.indexOf("colorpark") != -1) { if (url.indexOf("colorpark") != -1) {
...@@ -308,14 +281,13 @@ ...@@ -308,14 +281,13 @@
} }
}) })
}, },
/* path: '/pages/login/coupons', */
coupons() { coupons() {
var url = this.$Env.getBaseURL(); var url = this.$Env.getBaseURL();
var envVersionName = "trial"; var envVersionName = "trial";
if (url.indexOf("colorpark") != -1) { if (url.indexOf("colorpark") != -1) {
envVersionName = "release"; envVersionName = "release";
} }
//console.log("envVersionName="+envVersionName);
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
appId: Env.getappId(), appId: Env.getappId(),
path: '/pages/index/recommend?selectTitleType=2', path: '/pages/index/recommend?selectTitleType=2',
...@@ -328,6 +300,7 @@ ...@@ -328,6 +300,7 @@
} }
}) })
}, },
tomine() { tomine() {
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
appId: this.$Env.getappId(), appId: this.$Env.getappId(),
...@@ -342,13 +315,16 @@ ...@@ -342,13 +315,16 @@
} }
}) })
}, },
// 防止重复点击
//防止重复点击
touchStart(e) { touchStart(e) {
this.touchStartTime = e.timeStamp; this.touchStartTime = e.timeStamp;
}, },
touchEnd(e) { touchEnd(e) {
this.touchEndTime = e.timeStamp; this.touchEndTime = e.timeStamp;
}, },
doubleTap(e) { doubleTap(e) {
// 控制点击事件在350ms内触发,加这层判断是为了防止长按时会触发点击事件 // 控制点击事件在350ms内触发,加这层判断是为了防止长按时会触发点击事件
if (this.touchEndTime - this.touchStartTime < 350) { if (this.touchEndTime - this.touchStartTime < 350) {
...@@ -359,29 +335,31 @@ ...@@ -359,29 +335,31 @@
this.lastTapTime = currentTime; this.lastTapTime = currentTime;
// 如果两次点击时间在300毫秒内,则认为是双击事件 // 如果两次点击时间在300毫秒内,则认为是双击事件
if (currentTime - lastTapTime > 300) { if (currentTime - lastTapTime > 300) {
// console.log('防止重复点击') //console.log('防止重复点击')
if (!this.$AppContext.checkLogin()) { // uni.navigateTo({
// url: './nick-name?machine_id=' + this.$Env.getmachineId() + '&worksid=0'
// });
if(!this.$AppContext.checkLogin()) {
this.tologo('navigateTo') this.tologo('navigateTo')
} else { } else {
// this.showOrHide() uni.navigateTo({
// uni.navigateTo({url: '/pages/index/index?goods_id=21'})
uni.navigateTo({
url: './start-up?machine_id=' + this.$Env.getmachineId() + '&worksid=0' url: './start-up?machine_id=' + this.$Env.getmachineId() + '&worksid=0'
}); });
} }
} }
} }
}, },
// 加载数据
//加载数据
loadGoodsList() { loadGoodsList() {
uni.showLoading({ uni.showLoading({
title: '正在加载中...' title: '正在加载中...'
}) })
homeservice.queryList({ homeservice.queryList({
s: 'Machine.shopList', s: 'Machine.shopList',
longitude: this.$base.longitude || 0, /*longitude: this.$base.longitude || 0,
latitude: this.$base.latitude || 0, latitude: this.$base.latitude || 0,
distance: 5, distance: 5, */
}).then(result => { }).then(result => {
this.long = true this.long = true
result.data.forEach(item => { result.data.forEach(item => {
...@@ -393,12 +371,9 @@ ...@@ -393,12 +371,9 @@
}).catch(err => { }).catch(err => {
uni.hideLoading(); uni.hideLoading();
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
// uni.showToast({
// title: err.msg,
// icon: 'none'
// });
}); });
}, },
Account_newOrder() { Account_newOrder() {
homeservice.queryList({ homeservice.queryList({
s: 'Account.newOrder' s: 'Account.newOrder'
...@@ -411,33 +386,19 @@ ...@@ -411,33 +386,19 @@
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}).catch(err => { }).catch(err => {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
// uni.showToast({
// title: err.msg,
// icon: 'none'
// });
}); });
}, },
getSetting() { getSetting() {
this.loadGoodsList() this.loadGoodsList()
// const that = this
// uni.getSetting({
// success(res) {
// if (res.authSetting['scope.userLocation']) { //同意
// that.getLocation()
// } else { //拒绝
// that.getAuthorize()
// }
// }
// })
}, },
// 获取用户的地理位置,
//获取用户的地理位置,
getAuthorize() { getAuthorize() {
//uni.hideLoading();
// uni.showToast({title: '操作太频繁了,歇一歇',icon:'none',duration: 2000});
this.loadGoodsList() this.loadGoodsList()
}, },
// 用户授权
//用户授权
getAuthorize() { getAuthorize() {
const that = this const that = this
uni.authorize({ uni.authorize({
...@@ -467,15 +428,15 @@ ...@@ -467,15 +428,15 @@
} }
}) })
}, },
// 设备详情
//设备详情
goMachineDetail(item) { goMachineDetail(item) {
uni.navigateTo({ uni.navigateTo({
//url: './start-up?machine_id=' + item.id + '&worksid=0'
url: './start-up?machine_id=' + item.id + '&worksid=0' url: './start-up?machine_id=' + item.id + '&worksid=0'
}); });
}, },
tologo(e) { tologo(e) {
// 先登陆
let that = this; let that = this;
uni.login({ uni.login({
provider: 'weixin', provider: 'weixin',
...@@ -487,31 +448,24 @@ ...@@ -487,31 +448,24 @@
that.Account_newOrder(); that.Account_newOrder();
if (e == 'navigateTo') { if (e == 'navigateTo') {
uni.navigateTo({ uni.navigateTo({
url: './start-up?machine_id=' + that.$Env.getmachineId() + url: './start-up?machine_id=' + that.$Env.getmachineId() +'&worksid=0'
'&worksid=0'
}); });
} }
}).catch(err => { }).catch(err => {
that.$refs.Signin.init() that.$refs.Signin.init()
// uni.showToast({title: err.msg,icon: 'none'}) //console.log(that.$refs.Signin)
//that.$refs.Signin.getUserProfile()
//getUserProfile
//that.$refs.Signin.init()
}); });
}, },
fail: (res) => { fail: (res) => {
// uni.showToast({
// title: res.msg,
// icon: 'none'
// })
} }
}); });
}, },
phone_mall() { phone_mall() {
// homeservice.queryList({s: 'Ad.list',ad_position_key: 'phone_mall'}).then(result => {
// this.Adlists = result
// uni.stopPullDownRefresh();
// }).catch(err => {
// uni.stopPullDownRefresh();
// uni.showToast({title: err.msg,icon: 'none'});
// });
}, },
systemConfig() { systemConfig() {
var _this = this var _this = this
...@@ -588,7 +542,6 @@ ...@@ -588,7 +542,6 @@
if (appUser != null) { if (appUser != null) {
this.portraitUrl = appUser.portrait this.portraitUrl = appUser.portrait
} }
}, },
onShow() { onShow() {
let sys = this.$base.appInformation ? this.$base.appInformation : wx.getSystemInfoSync(); // 自定义页头适配 let sys = this.$base.appInformation ? this.$base.appInformation : wx.getSystemInfoSync(); // 自定义页头适配
......
<template>
<view class="containar">
<view class="avatarUrl">
<button type="balanced" open-type="chooseAvatar" @chooseavatar="onChooseavatar">
<image :src="avatarUrl" class="refreshIcon"></image>
</button>
</view>
<view class="nickname">
<text>昵称:</text>
<input type="nickname" class="weui-input" :value="nickName" @blur="bindblur" placeholder="请输入昵称"
@input="bindinput" />
</view>
<view class="btn">
<view class="btn-sub" @click="onSubmit">保存</view>
</view>
</view>
</template>
<script>
import Env from '@/util/Env.js';
export default {
data() {
return {
avatarUrl: 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0',
nickName: ''
};
},
onLoad(option) {
},
methods: {
bindblur(e) {
console.log('nickName', e)
this.nickName = e.detail.value;
},
bindinput(e) {
console.log('nickName', e)
this.nickName = e.detail.value;
},
onChooseavatar(e) {
this.avatarUrl = e.detail.avatarUrl;
},
onSubmit() {
if (this.nickName === '') {
uni.showToast({
icon: 'none',
title: '请输入昵称'
})
return false;
}
uni.showLoading({
title: '头像上传中...'
});
// uni.request({
// url: Env.getDevBaseURL() + '/api/AliossSign/getSign',
// method: 'GET',
// data: '',
// header: {
// 'content-type': 'application/x-www-form-urlencoded',
// 'Accept': 'application/json'
// },
// success: function(res) {
// },
// });
}
},
};
</script>
<style lang="scss">
.containar {
.avatarUrl {
padding: 80upx 0 40upx;
background: #fff;
button {
background: #fff;
line-height: 80upx;
height: auto;
width: auto;
padding: 20upx 30upx;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
.refreshIcon {
width: 160upx;
height: 160upx;
border-radius: 50%;
}
.jt {
width: 14upx;
height: 28upx;
}
}
}
//botton 去除边框
button::after {
border: none;
}
.nickname {
background: #fff;
padding: 20upx 30upx 80upx;
display: flex;
align-items: center;
justify-content: center;
.weui-input {
padding-left: 60upx;
}
}
.btn {
width: 100%;
.btn-sub {
width: 670upx;
margin: 80upx auto 0;
height: 90upx;
background: #DF8585;
border-radius: 45upx;
line-height: 90upx;
text-align: center;
font-size: 36upx;
color: #fff;
}
}
}
</style>
\ No newline at end of file
...@@ -9,15 +9,6 @@ ...@@ -9,15 +9,6 @@
</view> </view>
</view> </view>
<view @tap="toProxyApplet" v-if="list.is_open_manage == 1"
style="position: fixed; z-index: 99; right: 0; bottom: 400upx; display: flex;align-items: center;justify-content: center;
width: 100upx; height: 88upx; background: linear-gradient(92deg, #178CE6, #984ACE); border-radius: 44upx 0px 0px 44upx;">
<view style="font-size: 24upx; font-weight: 800; color: #FFFFFF;">
<view>运营</view>
<view>中心</view>
</view>
</view>
<!-- 自定义头部 --> <!-- 自定义头部 -->
<myhead :worksid="worksid" :title="myheadtext" :color="'#864BC3'" :titleShow="true" :backShow="true" <myhead :worksid="worksid" :title="myheadtext" :color="'#864BC3'" :titleShow="true" :backShow="true"
:background="'none'"></myhead> :background="'none'"></myhead>
...@@ -46,13 +37,6 @@ ...@@ -46,13 +37,6 @@
width: 420upx; height: 105upx; line-height: 105upx; border-radius: 53upx; font-size: 39upx;"> width: 420upx; height: 105upx; line-height: 105upx; border-radius: 53upx; font-size: 39upx;">
立即定制 立即定制
</view> </view>
<!-- <view @click="toProxyApplet()" v-if="list.is_open_manage == 1" style="position: fixed; bottom: 35upx;
text-align: center;left: 0; right: 0;font-size: 34upx;
margin: auto;
color: #fff;
line-height:64upx;
background: linear-gradient(to left, #834DC4, #1983D7);
width: 240upx; height: 60upx; border-radius: 30upx;">运营中心</view> -->
</view> </view>
<!-- 错误提示信息 --> <!-- 错误提示信息 -->
<view v-if="statusloading == 2" style="min-height: 100%;background: #131319 !important;"> <view v-if="statusloading == 2" style="min-height: 100%;background: #131319 !important;">
...@@ -335,7 +319,14 @@ ...@@ -335,7 +319,14 @@
userService.login({ userService.login({
s: 'Init.init', s: 'Init.init',
code: res.code code: res.code
}).then(r => { }).then(result => {
uni.setStorageSync('token', result.token)
/* uni.setStorage({
})
*/
that.getSetting(); that.getSetting();
}).catch(err => { }).catch(err => {
that.$refs.Signin.init(); that.$refs.Signin.init();
...@@ -478,7 +469,11 @@ ...@@ -478,7 +469,11 @@
this.isNowCustomized = false; this.isNowCustomized = false;
}.bind(this), 3000) }.bind(this), 3000)
let that = this; let that = this;
if (!this.$AppContext.checkLogin()) { this.tologo()
console.log(this.$AppContext.checkLogin());
/* if (!this.$AppContext.checkLogin()) {
this.tologo() this.tologo()
} else { } else {
if (this.list != null) { if (this.list != null) {
...@@ -508,7 +503,7 @@ ...@@ -508,7 +503,7 @@
} else { } else {
} }
} } */
}, },
changeChannel() { changeChannel() {
......
...@@ -16,16 +16,16 @@ ...@@ -16,16 +16,16 @@
<text style="margin-left: 13upx;">微信一键登录</text> <text style="margin-left: 13upx;">微信一键登录</text>
</button> --> </button> -->
<!-- 小程序登录、用户信息相关接口调整 --> <!-- 小程序登录、用户信息相关接口调整 -->
<button class="buttonGetUserInfo" hover-class="hover-class-bg" v-if="canIUseGetUserProfile" <button class="buttonGetUserInfo" hover-class="hover-class-bg"
@tap="getUserProfile"> @tap="getUserProfile">
<image src="../../static/icon_wechat.png" mode="aspectFill" class="icon_wechat"></image> <!-- <image src="../../static/icon_wechat.png" mode="aspectFill" class="icon_wechat"></image> -->
<text style="margin-left: 13upx;">获取头像昵称</text> <text style="margin-left: 13upx;">登录</text>
</button> </button>
<button v-else open-type="getUserInfo" @getuserinfo="getUserInfo" lang="zh_CN" <!-- <button v-else open-type="getUserInfo" @getuserinfo="getUserInfo" lang="zh_CN"
class="buttonGetUserInfo" hover-class="hover-class-bg"> class="buttonGetUserInfo" hover-class="hover-class-bg">
<image src="../../static/icon_wechat.png" mode="aspectFill" class="icon_wechat"></image> <image src="../../static/icon_wechat.png" mode="aspectFill" class="icon_wechat"></image>
<text style="margin-left: 13upx;">获取头像昵称</text> <text style="margin-left: 13upx;">获取头像昵称</text>
</button> </button> -->
</view> </view>
<image src="../../static/logo.jpg" mode="aspectFill" class="logoimage"></image> <image src="../../static/logo.jpg" mode="aspectFill" class="logoimage"></image>
</view> </view>
...@@ -93,15 +93,9 @@ ...@@ -93,15 +93,9 @@
userService.login({ userService.login({
s: 'Init.init', s: 'Init.init',
code: that.loginInfo.code, code: that.loginInfo.code,
nickname: that.loginInfo.nickName || '微信用户',
gender:that.loginInfo.gender,
portrait: that.loginInfo.avatarUrl,
encryptedData:that.loginInfo.encryptedData,
iv:that.loginInfo.iv,
promoter_id:that.$base.promoter_id ,// 推广的员的编号
machine_id:that.$base.machine_id,//用户进入设备id
}).then(result => { }).then(result => {
uni.hideLoading(); uni.hideLoading();
uni.setStorageSync('token', result.token)
uni.showToast({title: '登录成功',icon: 'none'}); uni.showToast({title: '登录成功',icon: 'none'});
if (that.code) { if (that.code) {
uni.redirectTo({ uni.redirectTo({
...@@ -242,8 +236,8 @@ ...@@ -242,8 +236,8 @@
} }
}, },
onShow() { onShow() {
console.log('wx.getUserProfile') //console.log('wx.getUserProfile')
console.log(wx.getUserProfile) //console.log(wx.getUserProfile)
if (wx.getUserProfile) { if (wx.getUserProfile) {
console.log('wx.getUserProfile可以使用') console.log('wx.getUserProfile可以使用')
this.canIUseGetUserProfile = true this.canIUseGetUserProfile = true
......
...@@ -21,12 +21,12 @@ ...@@ -21,12 +21,12 @@
<view v-if="designer.user_id != userId" class="border-image-pesudo-no"> <view v-if="designer.user_id != userId" class="border-image-pesudo-no">
<view class="border-image-pesudo-in-no"> <view class="border-image-pesudo-in-no">
<!-- <view style="margin:20upx 30upx;width: 141upx; height:132upx; background-size:contain; <!-- <view style="margin:20upx 30upx;width: 141upx; height:132upx; background-size:contain;
background-repeat:no-repeat; background-position: center; position: relative;" background-repeat:no-repeat; background-position: center; position: relative;"
:style="{'background-image':' url(' + designer.front_image + ')'}"> --> :style="{'background-image':' url(' + designer.front_image + ')'}"> -->
<!-- <image :src="designer.works_image + '?x-oss-process=image/resize,lfit,w_81'" mode="aspectFit" @click="previewImg(designer,0)" <!-- <image :src="designer.works_image + '?x-oss-process=image/resize,lfit,w_81'" mode="aspectFit" @click="previewImg(designer,0)"
style="width: 71upx; height:68upx; position: absolute; style="width: 71upx; height:68upx; position: absolute;
left:0; right:0; top:0; bottom:0; margin:auto;"> --> left:0; right:0; top:0; bottom:0; margin:auto;">-->
<image style="width: 100%;height: 100%;" src="../../static/img/icon_line_up_back.png" <image style="width: 100%;height: 100%;" src="../../static/img/icon_line_up_back.png"
mode="aspectFit"></image> mode="aspectFit"></image>
<image <image
...@@ -42,34 +42,32 @@ ...@@ -42,34 +42,32 @@
<view v-if="designer.user_id == userId" class="border-image-pesudo"> <view v-if="designer.user_id == userId" class="border-image-pesudo">
<view class="border-image-pesudo-in"> <view class="border-image-pesudo-in">
<!-- <view style="margin:20upx 30upx;width: 141upx; height:132upx; background-size:contain; <!-- <view style="margin:20upx 30upx;width: 141upx; height:132upx; background-size:contain;
background-repeat:no-repeat; background-position: center; position: relative;" background-repeat:no-repeat; background-position: center; position: relative;"
:style="{'background-image':' url(' + designer.front_image + ')'}"> --> :style="{'background-image':' url(' + designer.front_image + ')'}"> -->
<!-- <image :src="designer.works_image + '?x-oss-process=image/resize,lfit,w_81'" mode="aspectFit" @click="previewImg(designer,0)" <!-- <image :src="designer.works_image + '?x-oss-process=image/resize,lfit,w_81'" mode="aspectFit" @click="previewImg(designer,0)"
style="width: 71upx; height:68upx; position: absolute; style="width: 71upx; height:68upx; position: absolute;
left:0; right:0; top:0; bottom:0; margin:auto;"> --> left:0; right:0; top:0; bottom:0; margin:auto;">-->
<image style="width: 100%;height: 100%;" src="../../static/img/icon_line_up_back.png" <image style="width: 100%;height: 100%;" src="../../static/img/icon_line_up_back.png"
mode="aspectFit"></image> mode="aspectFit"></image>
<image <image
style="width: 141upx; height: 132upx; margin:auto; display: block;position: absolute; z-index: 10;" style="width: 141upx; height: 132upx; margin:auto; display: block;position: absolute; z-index: 10;"
:src="designer.front_image" mode="aspectFit"></image> :src="designer.front_image" mode="aspectFit"></image>
<image <image
style="width: 141upx; height: 132upx; position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto; z-index:8;" style="width: 141upx; height: 132upx; position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto; z-index:8;"
:src="designer.works_image + '?x-oss-process=image/resize,lfit,w_300'" :src="designer.works_image + '?x-oss-process=image/resize,lfit,w_300'"
mode="aspectFit"> mode="aspectFit">
</image> </image>
</view> </view>
</view> </view>
<view style="width: calc(100% - 360upx);"> <view style="width: calc(100% - 360upx);">
<view style="width: 90%;font-size: 28upx;"> <view style="width: 90%;font-size: 28upx;">
<text style="font-size: 40upx;font-weight: bold;">{{designer.id || ''}}</text> <text style="font-size: 40upx;font-weight: bold;">{{designer.id || ''}}</text>
</view> </view>
<view style="font-size: 24upx; color: #FFFFFF; margin-top: 30upx;"> <view style="font-size: 24upx; color: #FFFFFF; margin-top: 30upx;">
{{designer.goods_name || ''}} {{designer.goods_name || ''}}
</view> </view>
<!-- <view style="font-size: 24upx; color: #FFFFFF; margin-top: 10upx;">{{designer.goods_specs || ''}}</view> -->
</view> </view>
<view style="margin-right: 20upx; margin-left: auto; padding-top:75upx"> <view style="margin-right: 20upx; margin-left: auto; padding-top:75upx">
<view v-if="designer.status.value == 1" <view v-if="designer.status.value == 1"
...@@ -96,59 +94,13 @@ ...@@ -96,59 +94,13 @@
</view> </view>
</view> --> </view> -->
</view> </view>
</view> </view>
</view> </view>
<!-- 提示 -->
<view v-if="sighstate">
<view
style="position: fixed; z-index:999; width: 100%; height: 100%; background:rgba(0,0,0,0.6); top: 0;"
@click.stop="sighstate = false"></view>
<view style="position: fixed; z-index: 1000; top: 0; left: 0; bottom: 0; right: 0; margin: auto;
width: 558upx; height: 600upx; background: #FFFFFF; border-radius: 10upx;
display: flex; align-items: center; justify-content: center;">
<view style="position: absolute;
top: 0; right: 0;" @click.stop="sighstate = false">
<image src="../../static/icon_guanbi.png" mode=""
style="width: 26upx; height: 26upx; padding: 12upx 22upx;"></image>
</view>
<view style="width: 558upx;">
<view style="display: flex; align-items: center; justify-content: center;
width: 100%; height: 360upx; ">
<!-- <view
style="width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;flex-direction: column;"> -->
<!-- <image src="../../static/icon_paidui.png" mode="aspectFill"
style="width: 154upx; height: 154upx; margin: auto;"></image> -->
<image :src="designer.works_image + '?x-oss-process=image/resize,lfit,w_150'"
mode="aspectFit" style="width:150upx; "></image>
<image :src="designer.back_image + '?x-oss-process=image/resize,lfit,w_150'"
mode="aspectFit" style=" width: 150upx; margin-left: -150upx; "></image>
<!-- </view> -->
</view>
<view style="text-align: center; font-size: 36upx; margin-top: 5upx;">作品排队中</view>
<view style="text-align: center; font-size: 36upx;">如需要打印可与客服确认</view>
<view v-if="designer.user_id == userId " @click="toOrderDetail(designer)" style="width: 135upx; height: 55upx;background: #E7BC15;
border-radius: 40upx;
color: #FFFFFF;
margin:10upx auto;
text-align: center;
padding:auto;
padding-top: 15upx;">查看详情</view>
</view>
<!-- 查看详情 -->
<!-- <view style="width: 100%;" >
<view style="width: 136upx; height: 60upx;background: #E7BC15;border-radius: 30upx; color: #FFFFFF; text-align: center; ">查看详情</view>
</view> -->
</view>
</view> </view>
</view> </view>
<!-- 提示完 --> <!-- 提示完 -->
</view> </view>
</view> </view>
</template> </template>
...@@ -173,7 +125,6 @@ ...@@ -173,7 +125,6 @@
machine_id: null, machine_id: null,
page: 1, page: 1,
per_page: 15, per_page: 15,
// total: 0
}, },
stateindex: false, stateindex: false,
key: null, //1直营配送站 2 万能通用版 3色彩自助站 key: null, //1直营配送站 2 万能通用版 3色彩自助站
...@@ -186,38 +137,8 @@ ...@@ -186,38 +137,8 @@
}; };
}, },
methods: { methods: {
//调转订单详情
toOrderDetail(item) {
this.sighstate = false;
var url = this.$Env.getBaseURL();
var envVersionName = "trial";
if (url.indexOf("colorpark") != -1) {
envVersionName = "release";
}
//console.log("envVersionName="+envVersionName)
wx.navigateToMiniProgram({
appId: this.$Env.getappId(),
path: '/pages/mine/self_help_payment_details?orderId=' + item.order_id +
'&type=null&machine_id=' + item.machine_id,
extraData: {
foo: 'bar'
},
envVersion: envVersionName,
success(res) {
// 打开成功
},
fail(res) {
console.log("打开小程序失败")
}
});
},
self_help_payment(designer) { self_help_payment(designer) {
if (designer.user_id != this.userId) { if (designer.user_id != this.userId) {
return; return;
} }
...@@ -225,7 +146,6 @@ ...@@ -225,7 +146,6 @@
machine_id: this.queryPage.machine_id, machine_id: this.queryPage.machine_id,
s: 'machine.detail' s: 'machine.detail'
}).then(res => { }).then(res => {
if (this.key == 2) {
this.designer = designer this.designer = designer
if (designer.status.value == 1) { if (designer.status.value == 1) {
this.clearIntervalTime() this.clearIntervalTime()
...@@ -239,7 +159,6 @@ ...@@ -239,7 +159,6 @@
if (this.sighstate == true) return; if (this.sighstate == true) return;
this.sighstate = true this.sighstate = true
} }
}
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: '设备休息中', title: '设备休息中',
...@@ -259,7 +178,6 @@ ...@@ -259,7 +178,6 @@
}); });
}, },
loadGoodsList(direction) { loadGoodsList(direction) {
// uni.showLoading({ title: '加载中...' });
if (this.dataLoadState.pullDownRefresh || this.dataLoadState.reachBottom) return; if (this.dataLoadState.pullDownRefresh || this.dataLoadState.reachBottom) return;
this.dataLoadState.pullDownRefresh = direction === Enums.DATA_DIRECTION.UP; this.dataLoadState.pullDownRefresh = direction === Enums.DATA_DIRECTION.UP;
this.dataLoadState.reachBottom = direction === Enums.DATA_DIRECTION.DOWN; this.dataLoadState.reachBottom = direction === Enums.DATA_DIRECTION.DOWN;
...@@ -274,31 +192,14 @@ ...@@ -274,31 +192,14 @@
} }
} }
homeservice.queryList(this.queryPage).then(result => { homeservice.queryList(this.queryPage).then(result => {
/*result.forEach((item, index) => {
// console.log(index)
let obj = index + 1
item.lineup = obj < 10 ? "0" + obj : obj
// console.log(item.lineup)
}) */
this.stateindex = true this.stateindex = true
// (index + 1).padStart(2,'0')
// 触底更新时,当前列表+查询结果集
// let newList = this.LoupanList.concat(result)
// this.LoupanList = newList
/* let LoupanNewList = [];
result.forEach((item, index) => {
if (this.userId == item.user_id) {
LoupanNewList.push(item)
}
}) */
//this.LoupanList = LoupanNewList
this.LoupanList = result this.LoupanList = result
// 分页对象处理 //分页对象处理
this.queryPage.total = result.total; this.queryPage.total = result.total;
this.queryPage.per_page = result.per_page; this.queryPage.per_page = result.per_page;
// 停止当前页面下拉刷新 //停止当前页面下拉刷新
if (this.dataLoadState.pullDownRefresh) uni.stopPullDownRefresh(); if (this.dataLoadState.pullDownRefresh) uni.stopPullDownRefresh();
// 数据加载状态处理 false //数据加载状态处理 false
this.dataLoadState.pullDownRefresh = false; this.dataLoadState.pullDownRefresh = false;
this.dataLoadState.reachBottom = false; this.dataLoadState.reachBottom = false;
// uni.hideLoading(); // uni.hideLoading();
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
mode="aspectFit" @click="previewImg(designer,0)" mode="aspectFit" @click="previewImg(designer,0)"
style="width: 141upx; height:132upx; position: absolute; style="width: 141upx; height:132upx; position: absolute;
left:0; right:0; top:0; bottom:0; margin:auto;"> --> left:0; right:0; top:0; bottom:0; margin:auto;"> -->
</view> </view>
<view style="width: calc(100% - 141upx);"> <view style="width: calc(100% - 141upx);">
<view style="width: 90%;font-size: 28upx;"> <view style="width: 90%;font-size: 28upx;">
......
{ {
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "wechat_phone", "projectname": "kxz-app-phone",
"setting": { "setting": {
"compileHotReLoad": true, "compileHotReLoad": true,
"urlCheck": false "urlCheck": false
......
const accountInfo = wx.getAccountInfoSync(); const accountInfo = wx.getAccountInfoSync();
if(!accountInfo.miniProgram.envVersion){ if(!accountInfo.miniProgram.envVersion){
// console.error("获取运行环境失败!"); //console.error("获取运行环境失败!");
} }
const baseApi = { const baseApi = {
//开发版 //开发版
develop: "https://tprint.refinecolor.com", develop: "https://kxz.refinecolor.com",
//develop: "https://tprint.colorpark.cn", //develop: "https://tprint.colorpark.cn",
//体验版 //体验版
trial: "https://tprint.refinecolor.com", trial: "https://kxz.refinecolor.com",
//trial: "https://tprint.colorpark.cn",
//正式版 //正式版
release: "https://tprint.colorpark.cn", release: "https://kxz.colorpark.cn",
}; };
const baseURL = baseApi[accountInfo.miniProgram.envVersion] const baseURL = baseApi[accountInfo.miniProgram.envVersion]
const Env = { const Env = {
getDevBaseURL: () => baseURL, //开发版 getDevBaseURL: () => baseURL, //开发版
getBaseURL: () => baseURL, //上线版 getBaseURL: () => baseURL, //上线版
getmachineId: () => '100022', //'100022',//'100022' /* '100022', *///体验机器编码 getmachineId: () => '100022', //'100022',//'100022' /* '100022', *///体验机器编码
getmalltext: () => "色彩公园手机壳", getmalltext: () => "壳小站打印机",
getAppID: () => "wxdca8810ccd426633", getAppID: () => "wxdca8810ccd426633",
getcompany: () => "深圳市瑞丰彩科技有限公司", getcompany: () => "广州壳小站科技有限公司",
//跳转-色彩公园小程序
getappId: () => "wx55b5b6d95c648041", getappId: () => "wx55b5b6d95c648041",
//getenvVersion: () => "trial", //getenvVersion: () => "trial",
getenvVersion: () => "release", getenvVersion: () => "release",
......
...@@ -15,7 +15,9 @@ request.interceptors.request.use((config, promise) => { ...@@ -15,7 +15,9 @@ request.interceptors.request.use((config, promise) => {
// JSON格式化,未指定时,默认true // JSON格式化,未指定时,默认true
config.parseJson = $n._isNotNull(config.parseJson) ? config.parseJson : true config.parseJson = $n._isNotNull(config.parseJson) ? config.parseJson : true
// 如指定_token == true,则在headers中跟上相关token信息 // 如指定_token == true,则在headers中跟上相关token信息
if (config._token) config.headers['token'] = store.getters.appUser.token; if (config._token) config.headers['token'] = uni.getStorageSync('token');
//uni.getStorageSync('token');
console.warn('####### API Request: ', config) console.warn('####### API Request: ', config)
return config return config
}) })
......
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