tianyi 13 hours ago
parent
commit
4a21c31c37
  1. 1
      pages/index/index.vue
  2. 60
      pages/login/login.vue
  3. 2
      pages/login/regist.vue
  4. 8
      pages/shop/orderDetail.vue
  5. 51
      pages/worker/index.vue
  6. 2
      pages/worker/partTimeJobRegister.vue

1
pages/index/index.vue

@ -298,7 +298,6 @@
} }
}, },
onLoad() { onLoad() {
console.log('hahaha',uni.getStorageSync('shopId'))
if(!uni.getStorageSync('area') || !uni.getStorageSync('shopId')){ if(!uni.getStorageSync('area') || !uni.getStorageSync('shopId')){
uni.reLaunch({ uni.reLaunch({
url: '../login/login' url: '../login/login'

60
pages/login/login.vue

@ -7,8 +7,8 @@
</view> </view>
<!-- <view v-if="loginType == true" class="logintitle">{{i18n.login.shoujikuaijieLogin}}</view> <!-- <view v-if="loginType == true" class="logintitle">{{i18n.login.shoujikuaijieLogin}}</view>
<view v-if="loginType == false" class="logintitle">{{i18n.login.zhpassLogin}}</view> --> <view v-if="loginType == false" class="logintitle">{{i18n.login.zhpassLogin}}</view> -->
<view v-if="peisongyuan == true" class="logintitle">配送员登录</view> <view v-if="peisongyuan == true" class="logintitle">骑士登录</view>
<view v-if="peisongyuan == false" class="logintitle">账号密码登录</view> <view v-if="peisongyuan == false" class="logintitle">半径商家登录</view>
<view class="vview"></view> <view class="vview"></view>
<view class="codephoneinput row"> <view class="codephoneinput row">
@ -45,9 +45,9 @@
<view class="reg-btn" @click="peisongyuan = !peisongyuan"> <view class="reg-btn" @click="peisongyuan = !peisongyuan">
{{peisongyuan?'切换商家登录':'切换配送员登录'}} {{peisongyuan?'切换商家登录':'切换配送员登录'}}
</view> </view>
<!-- <navigator v-if="loginType == false" class="forget-pass" url="/pages/login/regist?type=3"> <navigator v-if="loginType == false" class="forget-pass" url="/pages/login/regist?type=3">
{{i18n.login.forgetPass}} {{i18n.login.forgetPass}}
</navigator> --> </navigator>
</view> </view>
<button enabled="enabled" class="login-btn" style="border-radius: 50rpx; border: 0;" type="primary" <button enabled="enabled" class="login-btn" style="border-radius: 50rpx; border: 0;" type="primary"
:class="{ opatity: enabled}" @click="submit"> :class="{ opatity: enabled}" @click="submit">
@ -81,7 +81,7 @@
wayValue: 0, wayValue: 0,
captchaImg: '', captchaImg: '',
top: 0, top: 0,
loginType: false, loginType: true,
codetimes: '获取验证码', codetimes: '获取验证码',
timer: null, timer: null,
canshowcode: false, canshowcode: false,
@ -127,7 +127,7 @@
}, },
computed: { computed: {
enabled: function() { enabled: function() {
if (this.mobile.length == 11 && this.password.length > 5 && this.code.length == 4) { if (this.mobile.length == 11 && this.codes.length == 6) {
return false; return false;
} }
return true; return true;
@ -370,27 +370,37 @@
}); });
return; return;
} }
if(this.code == uni.getStorageSync('yanzhengma')){ // if (this.code == uni.getStorageSync('yanzhengma')) {
uni.showToast({ // uni.showToast({
title: '验证码输入有误', // title: '',
icon: 'none' // icon: 'none'
}); // });
return; // return;
} // }
uni.setStorageSync('yanzhengma',this.code) // uni.setStorageSync('yanzhengma', this.code)
let url; let url;
let data; let data;
url = `/auth/login`; if (this.loginType == true) {
data = { url = "/auth/smsLogin";
username: this.mobile, data = {
password: this.password, mobile: this.mobile,
captchaId: this.captchaId, code: this.codes,
code: this.code, saveLogin: true,
saveLogin: true, type: this.wayValue,
type: 0, clientId: uni.getStorageSync('registerID')
clientId: uni.getStorageSync('registerID') };
}; } else {
url = `/auth/login`;
data = {
username: this.mobile,
password: this.password,
captchaId: this.captchaId,
code: this.code,
saveLogin: true,
type: 0
};
}
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: '加载中...', title: '加载中...',
@ -405,7 +415,7 @@
}); });
this.getCaptchaImg() this.getCaptchaImg()
} else { } else {
uni.removeStorageSync('code'); // uni.removeStorageSync('code');
if (res.result.accessToken) uni.setStorageSync('hiver_token', res.result.accessToken) if (res.result.accessToken) uni.setStorageSync('hiver_token', res.result.accessToken)
if (res.result.worker !== undefined) uni.setStorageSync('worker', res.result.worker) if (res.result.worker !== undefined) uni.setStorageSync('worker', res.result.worker)
uni.setStorageSync("wayValue", this.wayValue) uni.setStorageSync("wayValue", this.wayValue)

2
pages/login/regist.vue

@ -57,7 +57,7 @@
onReady() { onReady() {
this.codetimes = this.i18n.login.getcode this.codetimes = this.i18n.login.getcode
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.i18n.login.zhucezhanghao title: "修改密码"
}); });
}, },
computed: { computed: {

8
pages/shop/orderDetail.vue

@ -356,8 +356,8 @@
</view> </view>
</view> </view>
</view> </view>
<view class="bottom"> <view class="bottom" v-if="Ptype != 'work'">
<view v-if="data.status != 6 && data.status != 8 && Ptype != 'work'" style="height: 66rpx;line-height: 66rpx;display: flex;border-bottom: 1px solid #eee;font-size: 33rpx;"> <view v-if="data.status != 6 && data.status != 8" style="height: 66rpx;line-height: 66rpx;display: flex;border-bottom: 1px solid #eee;font-size: 33rpx;">
<view style="flex: 1;"> <view style="flex: 1;">
预计收入 预计收入
</view> </view>
@ -365,12 +365,12 @@
{{data.incomeSummary ? formatMoney(data.incomeSummary.expectedIncome) : (data.yujishouru?data.yujishouru:0)}} {{data.incomeSummary ? formatMoney(data.incomeSummary.expectedIncome) : (data.yujishouru?data.yujishouru:0)}}
</view> </view>
</view> </view>
<view v-if="Ptype != 'work'" style="margin-top: 20rpx;"> <view style="margin-top: 20rpx;">
<view @tap="printData(data)" class="btn" style="background: rgba(0, 35, 28, 1);color: rgba(166, 255, 234, 1);"> <view @tap="printData(data)" class="btn" style="background: rgba(0, 35, 28, 1);color: rgba(166, 255, 234, 1);">
打印小票 打印小票
</view> </view>
</view> </view>
<view v-if="Ptype != 'work'" style="margin-top: 20rpx;"> <view style="margin-top: 20rpx;">
<view @tap="mealServing(data)" v-if="(data.status == 3 && data.deliveryType == 1 && data.shopMakeTime == null) || (data.status == 3 && data.deliveryType == 2 && data.userRequireMake == 1)" class="btn" style="background: rgba(0, 35, 28, 1);color: rgba(166, 255, 234, 1);"> <view @tap="mealServing(data)" v-if="(data.status == 3 && data.deliveryType == 1 && data.shopMakeTime == null) || (data.status == 3 && data.deliveryType == 2 && data.userRequireMake == 1)" class="btn" style="background: rgba(0, 35, 28, 1);color: rgba(166, 255, 234, 1);">
已出餐 已出餐
</view> </view>

51
pages/worker/index.vue

@ -243,7 +243,7 @@
<de-livery ref="deLiveryPage" @tabbar-visible-change="setTabBarVisible"></de-livery> <de-livery ref="deLiveryPage" @tabbar-visible-change="setTabBarVisible"></de-livery>
</view> </view>
<view class="swiper-page" v-show="currentIndex == 2"> <view class="swiper-page" v-show="currentIndex == 2">
<my-center ref="myCenter"></my-center> <my-center ref="myCenterPage"></my-center>
</view> </view>
</view> </view>
<!-- 弹出区域选择 --> <!-- 弹出区域选择 -->
@ -500,33 +500,35 @@
} }
}, },
onShow() { onShow() {
this.indexInit() let that = this;
if (this.pendingTabIndex !== null) { that.indexInit()
const tabIndex = this.pendingTabIndex if (that.pendingTabIndex !== null) {
const shouldShowDeliveryRuleConfirm = this.pendingDeliveryRuleConfirm && tabIndex == 1 const tabIndex = that.pendingTabIndex
this.pendingTabIndex = null const shouldShowDeliveryRuleConfirm = that.pendingDeliveryRuleConfirm && tabIndex == 1
this.pendingDeliveryRuleConfirm = false that.pendingTabIndex = null
this.$nextTick(() => { that.pendingDeliveryRuleConfirm = false
Promise.resolve(this.refreshTabCounts()).then(() => { that.$nextTick(() => {
this.changeIndex(tabIndex) Promise.resolve(that.refreshTabCounts()).then(() => {
that.changeIndex(tabIndex)
if (shouldShowDeliveryRuleConfirm) { if (shouldShowDeliveryRuleConfirm) {
this.showDeliveryRuleEditedConfirm() that.showDeliveryRuleEditedConfirm()
} }
}) })
}) })
} else { } else {
this.$nextTick(() => { that.$nextTick(() => {
Promise.resolve(this.refreshTabCounts()).then(() => { Promise.resolve(that.refreshTabCounts()).then(() => {
if (this.currentIndex == 4 && this.$refs.myCenterPage) { if (that.currentIndex == 4 && that.$refs.myCenterPage) {
this.$refs.myCenterPage.init() that.$refs.myCenterPage.init()
} }
if (this.pendingDeliveryRuleConfirm && this.currentIndex == 1) { if (that.pendingDeliveryRuleConfirm && that.currentIndex == 1) {
this.pendingDeliveryRuleConfirm = false that.pendingDeliveryRuleConfirm = false
this.showDeliveryRuleEditedConfirm() that.showDeliveryRuleEditedConfirm()
} }
}) })
}) })
} }
that.$refs.myCenterPage.init()
}, },
onHide() { onHide() {
this.closeProductPopup() this.closeProductPopup()
@ -549,10 +551,11 @@
return Promise.resolve() return Promise.resolve()
}, },
showDeliveryRuleEditedConfirm() { showDeliveryRuleEditedConfirm() {
let that = this;
this.$nextTick(() => { this.$nextTick(() => {
setTimeout(() => { setTimeout(() => {
if (this.$refs.deLiveryPage && this.$refs.deLiveryPage.showRuleEditedConfirm) { if (that.$refs.deLiveryPage && that.$refs.deLiveryPage.showRuleEditedConfirm) {
this.$refs.deLiveryPage.showRuleEditedConfirm() that.$refs.deLiveryPage.showRuleEditedConfirm()
} }
}, 300) }, 300)
}) })
@ -1053,17 +1056,17 @@
//tab //tab
changeIndex(index, type) { changeIndex(index, type) {
let that = this; let that = this;
this.lastIndex = this.currentIndex that.lastIndex = that.currentIndex
this.currentIndex = index that.currentIndex = index
switch (index) { switch (index) {
case 0: case 0:
this.indexInit() that.indexInit()
break; break;
case 1: case 1:
that.$refs.deLiveryPage.init(type) that.$refs.deLiveryPage.init(type)
break; break;
case 2: case 2:
that.$refs.myCenter.init() that.$refs.myCenterPage.init()
break; break;
} }

2
pages/worker/partTimeJobRegister.vue

@ -1027,7 +1027,7 @@
let that = this; let that = this;
let hiver_token = uni.getStorageSync("hiver_token") let hiver_token = uni.getStorageSync("hiver_token")
await uni.uploadFile({ await uni.uploadFile({
url: that.tui.interfaceUrl() + '/upload/file', url: getApp().globalData.mainurl + '/upload/file',
filePath: path, filePath: path,
name: 'file', name: 'file',
header: { header: {

Loading…
Cancel
Save