首次提交
This commit is contained in:
770
pages/index/index.vue
Normal file
770
pages/index/index.vue
Normal file
@@ -0,0 +1,770 @@
|
||||
<template>
|
||||
<view style="padding-bottom: 80upx;">
|
||||
<view class=" u-flex padding-lr bg padding-top">
|
||||
<view class="u-m-r-10">
|
||||
<image :src="avatar" style="width: 100rpx;height: 100rpx;border-radius: 100rpx;"
|
||||
@click="goNav('/my/store/index')"></image>
|
||||
</view>
|
||||
<view class="u-flex-1 u-m-l-10" v-if="!isLogin">
|
||||
<view class="u-font-18 text-bold">
|
||||
<view class="margin-left-sm margin-top-xs">
|
||||
<view class="flex align-end">{{userName}}
|
||||
<view class="margin-left-sm" v-if="shop" @click="changePutaWayFlag">
|
||||
<image
|
||||
:src="shop.putawayFlag==0?'../../static/images/index/shangban.png':'../../static/images/index/dayang.png'"
|
||||
style="width: 30rpx;height: 30rpx;"></image>
|
||||
</view>
|
||||
<!-- <view>
|
||||
<image src="../../static/images/index/dayang.png" style="width: 30rpx;height: 30rpx;"></image>
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- <text @click="changePutaWayFlag"
|
||||
:style="shop.putawayFlag==0?'margin-left: 16upx;font-size: 28upx;color: #E10A07;':'margin-left: 16upx;font-size: 28upx;color: #999999;'"
|
||||
v-if="shop">{{shop.putawayFlag==0?'上班中':'打烊啦'}}
|
||||
|
||||
</text> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view v-else class="text-xl u-p-l-20 text-bold" @click="goLogin('/pages/my/loginphone')">
|
||||
登录
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="flex align-center padding-left">
|
||||
<image src="../../static/images/img/data.png" style="width: 26upx;height: 26upx;"></image>
|
||||
<view class="margin-left-xs flex align-center" style="color: #999999;">
|
||||
<view @click="bindData(1)">{{startTime?startTime:'开始时间'}}</view>
|
||||
至
|
||||
<view @click="bindData(2)">{{endTime?endTime:'结束时间'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex align-center box justify-between text-center">
|
||||
<view @click="goNav('/my/other/cashList')">
|
||||
¥<text class="text-bold text-xl">{{allMoney?allMoney:'0'}}</text>
|
||||
<view>总收益</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<text class="text-bold text-xl">{{allCount?allCount:'0'}}</text>
|
||||
<view>总销量</view>
|
||||
</view>
|
||||
<view @click="goNav('/my/store/pingjia')">
|
||||
<text class="text-bold text-xl">{{countTakingByUserId?countTakingByUserId:'0'}}</text>
|
||||
<view>用户评价</view>
|
||||
</view>
|
||||
<!-- <view class="">
|
||||
<text class="text-bold text-xl">{{putaway+soldOut}}</text>
|
||||
<view>用户发布</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="padding">
|
||||
<view class="text-bold text-lg margin-bottom-sm">订单数据</view>
|
||||
<view class="orderbox ">
|
||||
<view class="">
|
||||
¥<text class="text-bold text-xl">{{orderMoney?orderMoney:'0'}}</text>
|
||||
<view class="margin-top-xs">订单收入</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<text class="text-bold text-xl">{{sumCountOrder?sumCountOrder:'0'}}</text>
|
||||
<view class="margin-top-xs">总订单数</view>
|
||||
</view>
|
||||
<view class="">
|
||||
¥<text class="text-bold text-xl">{{refundMoney?refundMoney:'0'}}</text>
|
||||
<view class="margin-top-xs">退款金额</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<text class="text-bold text-xl">{{countByUserId?countByUserId:'0'}}</text>
|
||||
<view class="margin-top-xs">访客人数</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="padding: 0upx 30upx;">
|
||||
<view class="text-bold text-lg margin-bottom-sm flex justify-between">
|
||||
<view>订单管理</view>
|
||||
<view @click="goDetail(1)">
|
||||
<text style="color: #666666;font-size: 26upx;margin-right: 10upx;">查看全部</text>
|
||||
<image src="../../static/images/my/right.png" style="width: 12upx;height: 20upx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="orderbox ">
|
||||
<!-- <view class="">
|
||||
<text class="text-bold text-xl">{{i1}}</text>
|
||||
<view class="margin-top-xs">待付款</view>
|
||||
</view> -->
|
||||
<view class="">
|
||||
<text class="text-bold text-xl">{{i5}}</text>
|
||||
<view class="margin-top-xs">待接单</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<text class="text-bold text-xl">{{i2}}</text>
|
||||
<view class="margin-top-xs">制作中</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<text class="text-bold text-xl">{{i3}}</text>
|
||||
<view class="margin-top-xs">待取餐</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<text class="text-bold text-xl">{{i4}}</text>
|
||||
<view class="margin-top-xs">已完成</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding">
|
||||
<view class="text-bold text-lg margin-bottom-sm flex justify-between">
|
||||
<view>我的商品</view>
|
||||
<view @click="goDetail(2)">
|
||||
<text style="color: #666666;font-size: 26upx;margin-right: 10upx;">查看全部</text>
|
||||
<image src="../../static/images/my/right.png" style="width: 12upx;height: 20upx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="orderbox ">
|
||||
<view class="">
|
||||
<text class="text-bold text-xl">{{putawayCount}}</text>
|
||||
<view class="margin-top-sm">上架中</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<text class="text-bold text-xl">{{soldoutCount}}</text>
|
||||
<view class="margin-top-sm">已下架</view>
|
||||
</view>
|
||||
<view @click="bindFb()">
|
||||
<image src="../../static/images/index/add.png" style="width: 46upx;height: 46upx;"></image>
|
||||
<view class="margin-top-xs">添加商品</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<u-popup v-model="Authorization" mode="center" close-icon="close-circle" close-icon-pos="top-right"
|
||||
close-icon-color="#8f9298" close-icon-size="50">
|
||||
<view class="contentview">
|
||||
<view class="title">隐私保护指引</view>
|
||||
<view class="des" @click="openPrivacyContract">
|
||||
在使用当前小程序服务之前,请仔细阅读<text
|
||||
style="color: #FF7F00;">{{privacyContractName}}</text>。如你同意{{privacyContractName}},请点击“同意”开始使用。
|
||||
</view>
|
||||
<view class="btns">
|
||||
<button class="item reject" @click="exitMiniProgram">拒绝</button>
|
||||
<button id="agree-btn" class="item agree" open-type="agreePrivacyAuthorization"
|
||||
@agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<!-- 开始时间 -->
|
||||
<u-picker v-model="startshow" mode="time" :params="paramsStart" @confirm="startData"></u-picker>
|
||||
<!-- 结束时间 -->
|
||||
<u-picker v-model="endshow" mode="time" :params="paramsEnd" @confirm="endData"></u-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
Authorization: false,
|
||||
privacyContractName: '',
|
||||
avatar: '../../static/logo.png',
|
||||
isLogin: true,
|
||||
userName: '匿名',
|
||||
|
||||
startshow: false,
|
||||
endshow: false,
|
||||
paramsStart: {
|
||||
year: true,
|
||||
month: true,
|
||||
day: true,
|
||||
hour: false,
|
||||
minute: false,
|
||||
second: false
|
||||
},
|
||||
paramsEnd: {
|
||||
year: true,
|
||||
month: true,
|
||||
day: true,
|
||||
hour: false,
|
||||
minute: false,
|
||||
second: false
|
||||
},
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
|
||||
allMoney: 0, //总收益
|
||||
allCount: 0, //总销量
|
||||
countTakingByUserId: 0, //用户评价数
|
||||
orderMoney: 0, //订单收入
|
||||
sumCountOrder: 0, //总订单数
|
||||
refundMoney: 0, //退款金额
|
||||
countByUserId: 0, //访客人数
|
||||
i1: 0, //待付款
|
||||
i2: 0, //制作中
|
||||
i3: 0, //待取餐
|
||||
i4: 0, //已完成
|
||||
i5: 0, //商家待接单
|
||||
putawayCount: 0, //上架中
|
||||
soldoutCount: 0, //下架中
|
||||
page: 1,
|
||||
limit: 10,
|
||||
longitude: '',
|
||||
latitude: '',
|
||||
userId: '',
|
||||
shop: '',
|
||||
arr:[],
|
||||
errCount: 0
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.userId = uni.getStorageSync('userId')
|
||||
if (this.userId) {
|
||||
this.getFb()
|
||||
}
|
||||
this.$Request.getT('/app/common/type/354').then(res => { //订单取消通知
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.arr.push(res.data.value)
|
||||
}
|
||||
}
|
||||
})
|
||||
this.$Request.getT('/app/common/type/353').then(res => { //订单取消通知
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.arr.push(res.data.value)
|
||||
}
|
||||
}
|
||||
})
|
||||
this.$Request.getT('/app/common/type/352').then(res => { //新订单通知
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.arr.push(res.data.value)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
try {
|
||||
let that = this;
|
||||
wx.getPrivacySetting({
|
||||
success: res => {
|
||||
console.log("是否需要授权:", res.needAuthorization, "隐私协议的名称为:", res.privacyContractName)
|
||||
if (res.needAuthorization) {
|
||||
that.privacyContractName = res.privacyContractName;
|
||||
// this.$refs.popusAuthorization.open();
|
||||
that.Authorization = true;
|
||||
}
|
||||
},
|
||||
fail: () => {},
|
||||
complete: () => {},
|
||||
})
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
onShow() {
|
||||
this.userId = uni.getStorageSync('userId')
|
||||
if (this.userId) {
|
||||
this.isLogin = false
|
||||
this.getUserInfo()
|
||||
this.getFb()
|
||||
// this.getTodayOrder()
|
||||
this.getcity()
|
||||
this.getShopInfo();
|
||||
// #ifdef MP-WEIXIN
|
||||
//订阅
|
||||
if (!uni.getStorageSync('sendindexMsg')) {
|
||||
this.openMsg();
|
||||
}
|
||||
// #endif
|
||||
} else {
|
||||
this.isLogin = true
|
||||
// this.userName = '匿名'
|
||||
this.avatar = '../../static/logo.png'
|
||||
this.allMoney = 0 //总收益
|
||||
this.putawayCount = 0 //上架中
|
||||
this.soldoutCount = 0 //下架中
|
||||
this.allCount = 0 //总销量
|
||||
this.countTakingByUserId = 0 //用户评价
|
||||
this.orderMoney = 0 //订单收入
|
||||
this.sumCountOrder = 0 //总订单数
|
||||
this.refundMoney = 0 //退款金额
|
||||
this.countByUserId = 0 //访客人数
|
||||
this.i1 = 0 //待付款
|
||||
this.i3 = 0 //待取餐
|
||||
this.i2 = 0 //制作中
|
||||
this.i4 = 0 //已完成
|
||||
this.i5 = 0 //商家待接单
|
||||
}
|
||||
let that = this
|
||||
if (that.userId) {
|
||||
setInterval(function() {
|
||||
// 订单消息提醒
|
||||
// newsSelect() {
|
||||
let data = {
|
||||
shopIds: that.$queue.getData("shopId")
|
||||
}
|
||||
that.$Request.post('/admin/ordermessage/selectReadFlagCount', data).then(res => {
|
||||
if (res.code === 0) {
|
||||
// that.errCount = res.data
|
||||
if (res.data > 0) {
|
||||
if (that.errCount != res.data) {
|
||||
that.errCount = res.data
|
||||
that.aplayAudio()
|
||||
uni.showModal({
|
||||
title: '消息',
|
||||
content: '有' + res.data + '条订单,请前往订单中心处理。',
|
||||
success: (ret) => {
|
||||
if (ret.confirm) {
|
||||
uni.switchTab({
|
||||
url: '/pages/order/index'
|
||||
})
|
||||
|
||||
} else {
|
||||
console.log('else', ret)
|
||||
that.defineCallBack()
|
||||
}
|
||||
}
|
||||
});
|
||||
// this.chatNum = data.data
|
||||
}
|
||||
} else {
|
||||
that.errCount = 0
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 10000)
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 打开隐私协议页面
|
||||
openPrivacyContract() {
|
||||
let that = this;
|
||||
wx.openPrivacyContract({
|
||||
fail: () => {
|
||||
that.$queue.showToast('遇到错误无法打开!');
|
||||
}
|
||||
})
|
||||
},
|
||||
// 拒绝隐私协议
|
||||
exitMiniProgram() {
|
||||
// 直接退出小程序
|
||||
wx.exitMiniProgram()
|
||||
},
|
||||
// 同意隐私协议
|
||||
handleAgreePrivacyAuthorization() {
|
||||
this.Authorization = false;
|
||||
},
|
||||
openMsg() {
|
||||
var that = this
|
||||
wx.getSetting({
|
||||
withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回
|
||||
success(ret) {
|
||||
if (ret.subscriptionsSetting.itemSettings) {
|
||||
uni.setStorageSync('sendindexMsg', true)
|
||||
uni.openSetting({ // 打开设置页
|
||||
success(rea) {
|
||||
console.log(rea.authSetting)
|
||||
}
|
||||
});
|
||||
} else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
|
||||
uni.setStorageSync('sendindexMsg', false)
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '为了更好的体验,请绑定消息推送',
|
||||
confirmText: '确定',
|
||||
cancelText: '取消',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: that.arr,
|
||||
success(re) {
|
||||
// console.log(re,'**********')
|
||||
var datas = JSON.stringify(re);
|
||||
if (datas.indexOf("accept") != -1) {
|
||||
console.log(re)
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
that.showModal = false
|
||||
} else if (res.cancel) {
|
||||
that.showModal = true
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//切换店铺状态
|
||||
changePutaWayFlag() {
|
||||
|
||||
if (this.shop.putawayFlag == 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要打烊了吗?',
|
||||
showCancel: true,
|
||||
cancelText: '取消',
|
||||
confirmText: '确定',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.shop.putawayFlag = 1
|
||||
this.updateShopInfo();
|
||||
}
|
||||
},
|
||||
fail: () => {},
|
||||
complete: () => {}
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
this.shop.putawayFlag = 0
|
||||
this.updateShopInfo();
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
updateShopInfo() {
|
||||
this.$Request.postJsonA("/app/shop/updateShopMessage", this.shop).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.getShopInfo()
|
||||
} else {
|
||||
this.shop.putawayFlag = 1
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
getShopInfo() {
|
||||
if (this.$queue.getData('shopId')) {
|
||||
let data = {
|
||||
shopId: this.$queue.getData('shopId')
|
||||
}
|
||||
this.$Request.getA("/app/shop/selectShopMessage", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.hideLoading()
|
||||
|
||||
this.shop = res.data
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
aplayAudio() {
|
||||
// const audio = document.getElementById('audio')
|
||||
|
||||
// audio.play()
|
||||
// console.log('语音提示')
|
||||
const innerAudioContext = uni.createInnerAudioContext();
|
||||
innerAudioContext.autoplay = true;
|
||||
// innerAudioContext.src ='../../static/mpc/order.mp3';
|
||||
innerAudioContext.src =
|
||||
'https://pw.xianmxkj.com/file/uploadPath/2022/01/19/0753211f78d718d44ee6372e33eae9ee.mp3';
|
||||
innerAudioContext.onPlay(() => {
|
||||
console.log('开始播放');
|
||||
});
|
||||
innerAudioContext.onError((res) => {
|
||||
console.log(res.errMsg);
|
||||
console.log(res.errCode);
|
||||
});
|
||||
},
|
||||
defineCallBack() {
|
||||
let that = this
|
||||
let data = {
|
||||
shopIds: that.$queue.getData("shopId")
|
||||
}
|
||||
that.$Request.post('/admin/ordermessage/allcheckOrderMessage', data).then(res => {
|
||||
if (res.code === 0) {
|
||||
that.errCount = 0
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
getcity() {
|
||||
let that = this
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
success: function(res) {
|
||||
// console.log('当前位置的经度:' + res.longitude);
|
||||
// console.log('当前位置的纬度:' + res.latitude);
|
||||
that.latitude = res.latitude
|
||||
that.longitude = res.longitude
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取用户发布
|
||||
getFb() {
|
||||
let data = {
|
||||
startTime: this.startTime,
|
||||
endTime: this.endTime,
|
||||
shopId: this.$queue.getData("shopId")
|
||||
}
|
||||
this.$Request.getA("/app/shop/shopHomePage", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.allMoney = res.data.allMoney //总收益
|
||||
this.putawayCount = res.data.putawayCount //上架中
|
||||
this.soldoutCount = res.data.soldoutCount //下架中
|
||||
this.allCount = res.data.allCount //总销量
|
||||
this.countTakingByUserId = res.data.countTakingByUserId //用户评价
|
||||
this.orderMoney = res.data.orderMoney //订单收入
|
||||
this.sumCountOrder = res.data.sumCountOrder //总订单数
|
||||
this.refundMoney = res.data.refundMoney //退款金额
|
||||
this.countByUserId = res.data.countByUserId //访客人数
|
||||
this.i1 = res.data.i1 //待付款
|
||||
this.i3 = res.data.i3 //待取餐
|
||||
this.i2 = res.data.i2 //制作中
|
||||
this.i4 = res.data.i4 //已完成
|
||||
this.i5 = res.data.i5 //商家待接单
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
goDetail(index) {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (uni.getStorageSync('sendindexMsg')) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: this.arr,
|
||||
success(re) {
|
||||
// console.log(re,'**********')
|
||||
var datas = JSON.stringify(re);
|
||||
if (datas.indexOf("accept") != -1) {
|
||||
console.log(re)
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
if (index == 1) {
|
||||
uni.switchTab({
|
||||
url: '/pages/order/index'
|
||||
})
|
||||
} else if (index == 2) {
|
||||
uni.navigateTo({
|
||||
url: '/my/store/addgood'
|
||||
})
|
||||
}
|
||||
},
|
||||
bindFb() {
|
||||
let userId = uni.getStorageSync('userId')
|
||||
if (userId) {
|
||||
uni.navigateTo({
|
||||
url: '/my/publish/goods'
|
||||
})
|
||||
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未登录,请先登录',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
// console.log('用户点击确定');
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/loginphone'
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
// console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
//时间弹框开关
|
||||
bindData(index) {
|
||||
if (index == 1) {
|
||||
this.startshow = true
|
||||
} else if (index == 2) {
|
||||
this.endshow = true
|
||||
|
||||
}
|
||||
},
|
||||
//开始时间
|
||||
startData(e) {
|
||||
|
||||
this.startTime = e.year + '-' + e.month + '-' + e.day
|
||||
},
|
||||
// 结束时间
|
||||
endData(e) {
|
||||
this.endTime = e.year + '-' + e.month + '-' + e.day
|
||||
|
||||
this.getFb()
|
||||
},
|
||||
goNav(e, name) {
|
||||
if (this.userId) {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (uni.getStorageSync('sendindexMsg')) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: this.arr,
|
||||
success(re) {
|
||||
// console.log(re,'**********')
|
||||
var datas = JSON.stringify(re);
|
||||
if (datas.indexOf("accept") != -1) {
|
||||
console.log(re)
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
uni.navigateTo({
|
||||
url: e
|
||||
})
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未登录,请先登录',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/loginphone'
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getUserInfo() {
|
||||
this.$Request.getA("/sys/user/info").then(res => {
|
||||
if (res.code == 0) {
|
||||
|
||||
// this.userName = res.user.userEntity.userName
|
||||
this.userName = res.user.shopList[0].shopName
|
||||
// this.avatar = res.user.userEntity.avatar ? res.user.userEntity.avatar : '../../static/logo.png'
|
||||
this.avatar = res.user.shopList[0].shopCover ? res.user.shopList[0].shopCover :
|
||||
'../../static/logo.png'
|
||||
this.$queue.setData("userId", res.user.userId);
|
||||
this.$queue.setData("shopId", res.user.shopList[0].shopId);
|
||||
this.$queue.setData("mobile", res.user.mobile);
|
||||
if (res.user.userEntity) {
|
||||
this.$queue.setData("shopUserName", res.user.userEntity.userName);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
goLogin(e) {
|
||||
uni.navigateTo({
|
||||
url: e
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.bg {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.box {
|
||||
width: 690upx;
|
||||
margin: 0 auto;
|
||||
height: 120rpx;
|
||||
background: #FCD202;
|
||||
border-radius: 16upx 16upx 0px 0px;
|
||||
color: #333333;
|
||||
padding: 0upx 30upx;
|
||||
margin-top: 20upx;
|
||||
}
|
||||
|
||||
.orderbox {
|
||||
width: 690upx;
|
||||
margin: 0 auto;
|
||||
height: 153upx;
|
||||
background: #FAFAFA;
|
||||
border-radius: 16upx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
text-align: center;
|
||||
padding: 0upx 30upx;
|
||||
}
|
||||
|
||||
.privacy {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background: rgba(0, 0, 0, .5);
|
||||
z-index: 9999999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.contentview {
|
||||
width: 632rpx;
|
||||
padding: 48rpx;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.contentview .title {
|
||||
text-align: center;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.contentview .des {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
margin-top: 40rpx;
|
||||
text-align: justify;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.contentview .des .link {
|
||||
color: #07c160;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
button::after {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.btns {
|
||||
margin-top: 48rpx;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.btns .item {
|
||||
justify-content: space-between;
|
||||
width: 244rpx;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 16rpx;
|
||||
box-sizing: border-box;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.btns .reject {
|
||||
background: #f4f4f5;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.btns .agree {
|
||||
background: #07c160;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
643
pages/my/chat.vue
Normal file
643
pages/my/chat.vue
Normal file
@@ -0,0 +1,643 @@
|
||||
<template>
|
||||
<view>
|
||||
<view style="width: 100%;padding-bottom: 140rpx;">
|
||||
<view style="display: flex;flex-direction: column;" v-for="(item,index) in ListItem" :key='index' >
|
||||
<view style="margin-top: 15rpx;width: 100%;text-align: center;font-size: 26rpx;color: #999999;">
|
||||
{{item.createTime}}</view>
|
||||
<view v-if="item.sendType === 2" style="width: 83%;margin-right: 15%;">
|
||||
<view class="chat-listitem" style="float: left;margin-left: 10rpx;">
|
||||
<view>
|
||||
<image src="../../static/images/img/kefu.png" class="chat-listitem-image"></image>
|
||||
</view>
|
||||
<view v-if="item.content && item.type === 1" class="chat-listitem-text"
|
||||
style="margin-left: 20rpx;">{{item.content}}</view>
|
||||
<image @tap="viewImg(item.content)" v-if="item.content && item.type === 2" :src="item.content"
|
||||
style="height: 200rpx;width: 200rpx;margin-left: 20rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="item.sendType === 1" style="width: 83%;margin-left: 15%;">
|
||||
<view class="chat-listitem" style="float: right;">
|
||||
<view v-if="item.content && item.type === 1" @longpress="copy(item.content)"
|
||||
class="chat-listitem-text" style="margin-right: 20rpx;">{{item.content}}</view>
|
||||
<view v-if="item.content && item.type === 4" @click="goShop(item.content[3])"
|
||||
style="width: 400rpx;background: #FFFFFF;height: max-content;margin-right: 20rpx;margin-top: 10rpx;border-radius: 20rpx;">
|
||||
<image :src="item.content[0]" class="chat-listitem-image-type4"
|
||||
style="width: 400rpx;height: 350rpx;"></image>
|
||||
<view style="padding: 10rpx;padding-bottom: 20rpx;">
|
||||
<view style="color: #ed5732;font-size: 34rpx;"><text style="font-size: 22rpx;">¥ </text>
|
||||
{{item.content[2]}}</view>
|
||||
<view
|
||||
style="overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;width: 100%;height: 75upx;">
|
||||
{{item.content[1]}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.content && item.type === 3"
|
||||
style="width: 500rpx;background: #FFFFFF;height: max-content;margin-right: 20rpx;margin-top: 10rpx;border-radius: 20rpx;padding: 15rpx 10rpx;">
|
||||
<view style="color: #000000;font-weight: 600;margin-left: 10rpx;">你正在咨询的订单</view>
|
||||
<view style="display: flex;">
|
||||
<image :src="item.content[0]" class="chat-listitem-image-type4"
|
||||
style="margin-left: 7rpx;margin-top: 20rpx;width: 110rpx;height: 110rpx;"></image>
|
||||
<view
|
||||
style="margin-top: 15rpx;padding: 10rpx 0rpx 5rpx 10rpx;width: 75%;background: #f5f5f5;margin-left: 10rpx;">
|
||||
<view
|
||||
style="font-size: 28rpx;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;height: 75upx;width: 100%;">
|
||||
{{item.content[1]}}</view>
|
||||
<view style="color: #ed5732;font-size: 28rpx;"><text style="font-size: 22rpx;">¥
|
||||
</text>{{item.content[5]}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="color: #999999;margin-top: 10rpx;margin-left: 12rpx;">
|
||||
<view>订单编号:{{item.content[3]}}</view>
|
||||
<view style="margin-top: 10rpx;">创建时间:{{item.content[4]}}</view>
|
||||
</view>
|
||||
<view
|
||||
style="float: right;margin-right: 10rpx;margin-top: 15rpx;background: #F9221D;color: #FFFFFF;border-radius: 50rpx;width: 150rpx;height: 50rpx;font-size: 24rpx;text-align: center;line-height: 50rpx;"
|
||||
@click="goDingdanDetail(item.content[2])">查看</view>
|
||||
</view>
|
||||
<image @tap="viewImg(item.content)" v-if="item.content && item.type === 2" :src="item.content"
|
||||
style="height: 200rpx;width: 200rpx;margin-right: 20rpx;"></image>
|
||||
<view>
|
||||
<image v-if="item.chat.userHead" :src="item.chat.userHead" class="chat-listitem-image">
|
||||
</image>
|
||||
<image v-else src="../../static/logo.png" class="chat-listitem-image"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view v-if="item.sendType === 4" style="width: 83%;margin-left: 15%;">
|
||||
<view class="chat-listitem" style="float: right;">
|
||||
<view style="height: max-content;">
|
||||
<image :src="type4[0]" mode=""></image>
|
||||
</view>
|
||||
<image @tap="viewImg(item.content)" v-if="item.content && item.type === 2" :src="item.content" style="height: 200rpx;width: 170rpx;margin-right: 20rpx;"></image>
|
||||
<view>
|
||||
<image :src="item.chat.userHead" class="chat-listitem-image"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="ShopState"
|
||||
style="width: 95%;margin-left: 20rpx;height: 150upx;position: fixed;bottom: 120upx;z-index: 99;background-color: #FFFFFF;border-radius: 20rpx;">
|
||||
<view style="display: flex;width: 100%;color: #000000;padding: 20rpx;">
|
||||
<image :src="Shopimage" style="width: 110rpx;height: 110rpx;"></image>
|
||||
<view style="margin-left: 20rpx;width: 400rpx;">
|
||||
<view
|
||||
style="font-size: 34rpx;color: #000000;overflow: hidden;text-overflow: ellipsis;flex-wrap: nowrap;white-space: nowrap;width: 98%;">
|
||||
{{ShopTitle}}</view>
|
||||
<view style="margin-top: 20rpx;color: #ed5732;font-size: 34rpx;">¥{{Shopmoney}}</view>
|
||||
</view>
|
||||
<view style="text-align: right;">
|
||||
<image @click="ShopClose" src="../../static/images/img/close.png"
|
||||
style="width: 30rpx;height: 30rpx;"></image>
|
||||
<view
|
||||
style="margin-top: 20rpx;background: #F9221D;color: #FFFFFF;border-radius: 50rpx;width: 150rpx;height: 50rpx;font-size: 24rpx;text-align: center;line-height: 50rpx;"
|
||||
@click="goMaijia">发送给商家</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="orderState"
|
||||
style="width: 95%;margin-left: 20rpx;height: 150upx;position: fixed;bottom: 120upx;z-index: 99;background-color: #FFFFFF;border-radius: 20rpx;">
|
||||
<view style="display: flex;width: 100%;color: #000000;padding: 20rpx;">
|
||||
<image :src="orderimage" style="width: 110rpx;height: 110rpx;"></image>
|
||||
<view style="margin-left: 20rpx;width: 400rpx;">
|
||||
<view
|
||||
style="font-size: 34rpx;color: #000000;overflow: hidden;text-overflow: ellipsis;flex-wrap: nowrap;white-space: nowrap;width: 98%;">
|
||||
你可能想咨询该订单</view>
|
||||
<view style="margin-top: 20rpx;color: #ed5732;font-size: 34rpx;">¥{{ordermoney}}</view>
|
||||
</view>
|
||||
<view style="text-align: right;">
|
||||
<image @click="orderClose" src="../../static/images/img/close.png"
|
||||
style="width: 30rpx;height: 30rpx;"></image>
|
||||
<view
|
||||
style="margin-top: 20rpx;background: #F9221D;color: #000000;border-radius: 50rpx;width: 150rpx;height: 50rpx;font-size: 24rpx;text-align: center;line-height: 50rpx;"
|
||||
@click="goDingdan">发送订单</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部聊天输入框 -->
|
||||
<view class="input-box">
|
||||
<view class="justify-between padding-lr" style="display: flex;margin-top: 15rpx;width: 100%;background-color: #eee;padding-top: 4upx;">
|
||||
<image src="../../static/images/img/add.png" @click="chooseImage(['album'])"
|
||||
style="width: 50rpx;height: 50rpx;margin-top: 8rpx;margin-right: 12rpx;border-radius: 52upx;"></image>
|
||||
<input confirm-type="send" @confirm='setChatSave(1)' type="text" v-model="content"
|
||||
style="width: 72%;height: 70rpx;background: #fff;margin: 4rpx 10rpx 0;border-radius: 70rpx;padding-left: 10rpx;color: #000000;" />
|
||||
<view class="save" @tap='setChatSave(1)'>发送</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import configdata from '../../common/config.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
connected: false,
|
||||
connecting: false,
|
||||
msg: false,
|
||||
type4: [],
|
||||
listRight: {
|
||||
chat: {
|
||||
userHead: ""
|
||||
},
|
||||
content: "",
|
||||
sendType: 1,
|
||||
type: 1
|
||||
},
|
||||
content: '',
|
||||
chatId: '',
|
||||
type: 1,
|
||||
ListItem: [],
|
||||
ShopState: false,
|
||||
ShopordersId: '',
|
||||
Shopimage: '',
|
||||
Shopmoney: '',
|
||||
ShopTitle: '',
|
||||
orderState: false,
|
||||
ordersId: '',
|
||||
orderimage: '',
|
||||
orderNum: '',
|
||||
ordermoney: '',
|
||||
orderTitle: '',
|
||||
orderCreateTime: '',
|
||||
className: '',
|
||||
Shopsales: '',
|
||||
hand: 1,
|
||||
index: 0,
|
||||
page: 0,
|
||||
size: 1000,
|
||||
countDown: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
showMsg() {
|
||||
if (this.connected) {
|
||||
if (this.msg) {
|
||||
return '收到消息:' + this.msg
|
||||
} else {
|
||||
return '等待接收消息'
|
||||
}
|
||||
} else {
|
||||
return '尚未连接'
|
||||
}
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
uni.closeSocket()
|
||||
uni.hideLoading()
|
||||
},
|
||||
onLoad(d) {
|
||||
if (d.className) {
|
||||
this.className = d.className;
|
||||
if (d.className === 'shop') {
|
||||
this.ShopState = true;
|
||||
this.ShopordersId = d.ordersId;
|
||||
this.Shopimage = d.image;
|
||||
this.Shopmoney = d.money;
|
||||
this.Shopsales = d.sales;
|
||||
this.ShopTitle = d.title;
|
||||
} else if (d.className === 'order') {
|
||||
this.orderState = true;
|
||||
this.ordersId = d.id;
|
||||
this.orderimage = d.image;
|
||||
this.ordermoney = d.money;
|
||||
this.orderTitle = d.title;
|
||||
this.orderNum = d.orderNum;
|
||||
this.orderCreateTime = d.createTime;
|
||||
}
|
||||
}
|
||||
this.getChatSave();
|
||||
this.connect();
|
||||
},
|
||||
onShow() {
|
||||
if (this.connected || this.connecting) {
|
||||
|
||||
} else {
|
||||
this.connect();
|
||||
}
|
||||
},
|
||||
onHide() {
|
||||
uni.closeSocket()
|
||||
},
|
||||
methods: {
|
||||
copy(content) {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '确认要复制此文字吗?',
|
||||
showCancel: true,
|
||||
cancelText: '取消',
|
||||
confirmText: '确认',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setClipboardData({
|
||||
data: content,
|
||||
success: r => {
|
||||
this.$queue.showToast('复制成功');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
h5Copy(content) {
|
||||
if (!document.queryCommandSupported('copy')) {
|
||||
// 不支持
|
||||
return false
|
||||
}
|
||||
let textarea = document.createElement("textarea")
|
||||
textarea.value = content
|
||||
textarea.readOnly = "readOnly"
|
||||
document.body.appendChild(textarea)
|
||||
textarea.select() // 选择对象
|
||||
textarea.setSelectionRange(0, content.length) //核心
|
||||
let result = document.execCommand("copy") // 执行浏览器复制命令
|
||||
textarea.remove()
|
||||
return result
|
||||
},
|
||||
getDateDiff(data) {
|
||||
// 传进来的data必须是日期格式,不能是时间戳
|
||||
//var str = data;
|
||||
//将字符串转换成时间格式
|
||||
var timePublish = new Date(data);
|
||||
var timeNow = new Date();
|
||||
var minute = 1000 * 60;
|
||||
var hour = minute * 60;
|
||||
var day = hour * 24;
|
||||
var month = day * 30;
|
||||
var result = "2";
|
||||
|
||||
var diffValue = timeNow - timePublish;
|
||||
var diffMonth = diffValue / month;
|
||||
var diffWeek = diffValue / (7 * day);
|
||||
var diffDay = diffValue / day;
|
||||
var diffHour = diffValue / hour;
|
||||
var diffMinute = diffValue / minute;
|
||||
|
||||
|
||||
if (diffMonth > 3) {
|
||||
result = timePublish.getFullYear() + "-";
|
||||
result += timePublish.getMonth() + "-";
|
||||
result += timePublish.getDate();
|
||||
} else if (diffMonth > 1) { //月
|
||||
result = data.substring(0, 10);
|
||||
} else if (diffWeek > 1) { //周
|
||||
result = data.substring(0, 10);
|
||||
} else if (diffDay > 1) { //天
|
||||
result = data.substring(0, 10);
|
||||
} else if (diffHour > 1) { //小时
|
||||
result = parseInt(diffHour) + "小时前";
|
||||
} else if (diffMinute > 1) { //分钟
|
||||
result = parseInt(diffMinute) + "分钟前";
|
||||
} else {
|
||||
result = "刚刚";
|
||||
}
|
||||
return result;
|
||||
},
|
||||
goDingdanDetail(id) {
|
||||
uni.navigateTo({
|
||||
url: '../member/orderdetail?id=' + id
|
||||
});
|
||||
},
|
||||
goShop(ordersId) {
|
||||
uni.navigateTo({
|
||||
url: './commoditydetail?ordersId=' + ordersId
|
||||
});
|
||||
},
|
||||
ShopClose() {
|
||||
this.ShopState = false;
|
||||
},
|
||||
orderClose() {
|
||||
this.orderState = false;
|
||||
},
|
||||
goDingdan() {
|
||||
this.orderState = false;
|
||||
this.setChatSave(3);
|
||||
},
|
||||
goMaijia() {
|
||||
this.ShopState = false;
|
||||
this.setChatSave(4);
|
||||
},
|
||||
connect() {
|
||||
let userId = this.$queue.getData('userId');
|
||||
if (this.connected || this.connecting) {
|
||||
uni.showModal({
|
||||
content: '正在连接或者已经连接,请勿重复连接',
|
||||
showCancel: false
|
||||
})
|
||||
return false
|
||||
}
|
||||
let token = uni.getStorageSync('token')
|
||||
this.connecting = true
|
||||
uni.showLoading({
|
||||
title: '连接中...'
|
||||
})
|
||||
uni.connectSocket({
|
||||
// url: 'wss://game.shengqianxiong.com.cn/wss/websocket/' + userId,
|
||||
// url: 'ws://74165o0188.uicp.fun/sqx_fast/websocket/' + userId,
|
||||
url: this.config("WSHOST") + userId,
|
||||
data() {
|
||||
return {
|
||||
msg: 'Hello'
|
||||
}
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/json',
|
||||
'token': token
|
||||
},
|
||||
method: 'GET',
|
||||
success(res) {
|
||||
// 这里是接口调用成功的回调,不是连接成功的回调,请注意
|
||||
},
|
||||
fail(err) {
|
||||
// 这里是接口调用失败的回调,不是连接失败的回调,请注意
|
||||
}
|
||||
})
|
||||
uni.onSocketOpen((res) => {
|
||||
this.connecting = false
|
||||
this.connected = true
|
||||
uni.hideLoading()
|
||||
// uni.showToast({
|
||||
// icon: 'none',
|
||||
// title: '连接成功'
|
||||
// })
|
||||
console.log('onOpen', res);
|
||||
})
|
||||
uni.onSocketError((err) => {
|
||||
this.connecting = false
|
||||
this.connected = false
|
||||
uni.hideLoading()
|
||||
uni.showModal({
|
||||
content: '网络较差,请稍后再试',
|
||||
showCancel: false
|
||||
})
|
||||
console.log('onError', err);
|
||||
})
|
||||
uni.onSocketMessage((res) => {
|
||||
// let that = this;
|
||||
// let datas = JSON.parse(res.data)
|
||||
// let data = {
|
||||
// chat: {
|
||||
// userHead: '../../static/logo.png'
|
||||
// },
|
||||
// content: datas.content,
|
||||
// type: datas.type,
|
||||
// sendType: datas.sendType
|
||||
// }
|
||||
// that.ListItem.push(data);
|
||||
this.getTimeOrListItem1();
|
||||
console.log('onMessage', res)
|
||||
})
|
||||
uni.onSocketClose((res) => {
|
||||
this.connected = false
|
||||
this.startRecive = false
|
||||
this.msg = false
|
||||
console.log('onClose', res)
|
||||
})
|
||||
},
|
||||
close() {
|
||||
uni.closeSocket()
|
||||
},
|
||||
getTimeOrListItem1() {
|
||||
this.$Request.getT('/app/chats/list?chatId=' + this.chatId).then(
|
||||
res => {
|
||||
this.ListItem = [];
|
||||
if (res.data) {
|
||||
var time = '';
|
||||
res.data.forEach(d => {
|
||||
d.createTime = this.getDateDiff(d.createTime);
|
||||
if (d.createTime === time) {
|
||||
d.createTime = '';
|
||||
} else {
|
||||
time = d.createTime;
|
||||
}
|
||||
if (!d.chat.userHead) {
|
||||
// d.chat.userHead = '../../static/logo.png';
|
||||
let avatar = this.$queue.getData('avatar');
|
||||
d.chat.userHead = avatar
|
||||
}
|
||||
if (d.type === 4) {
|
||||
let data = d.content.split(',');
|
||||
d.content = data;
|
||||
}
|
||||
if (d.type === 3) {
|
||||
let data = d.content.split(',');
|
||||
d.content = data;
|
||||
}
|
||||
this.ListItem.push(d);
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 99999,
|
||||
duration: 0
|
||||
});
|
||||
}, 50);
|
||||
}
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
getChatSave() {
|
||||
let userId = this.$queue.getData('userId');
|
||||
let phone = this.$queue.getData('phone');
|
||||
let userName = this.$queue.getData('userName');
|
||||
if (!phone) {
|
||||
phone = this.$queue.getData('userName');
|
||||
}
|
||||
let avatar = this.$queue.getData('avatar') ? this.$queue.getData('avatar') : '';
|
||||
let shopUserName = this.$queue.getData('shopUserName') ? this.$queue.getData('shopUserName'): '';
|
||||
let data = {
|
||||
userId: userId,
|
||||
userHead: avatar,
|
||||
userName: shopUserName,
|
||||
storeId: '0',
|
||||
storeHead: '',
|
||||
storeName: ''
|
||||
}
|
||||
this.$Request.postJson('/app/chats/save', data).then(res => {
|
||||
if (res.status === 0) {
|
||||
this.chatId = res.data.chatId;
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
this.getTimeOrListItem1();
|
||||
}
|
||||
});
|
||||
},
|
||||
setChatSave(type) {
|
||||
//type:1文字 2图片
|
||||
if (type === 1 && this.content == '') {
|
||||
this.$queue.showToast('请输入聊天内容');
|
||||
return;
|
||||
}
|
||||
if (this.chatId == '' || this.chatId == undefined) {
|
||||
this.$queue.showToast('网络较差,请稍后再试');
|
||||
return;
|
||||
}
|
||||
let userId = this.$queue.getData('userId');
|
||||
if (type === 4) {
|
||||
this.content = this.Shopimage + ',' + this.ShopTitle + ',' + this.Shopmoney + ',' + this.ShopordersId;
|
||||
}
|
||||
if (type === 3) {
|
||||
this.content = this.orderimage + ',' + this.orderTitle + ',' + this.ordersId + ',' + this.orderNum +
|
||||
',' + this.orderCreateTime +
|
||||
',' + this.ordermoney
|
||||
}
|
||||
let avatar = this.$queue.getData('avatar') ? this.$queue.getData('avatar') : '';
|
||||
let shopUserName = this.$queue.getData('shopUserName') ? this.$queue.getData('shopUserName'): '';
|
||||
let data = {
|
||||
userId: userId,
|
||||
userHead: avatar,
|
||||
userName: shopUserName,
|
||||
content: this.content,
|
||||
chatId: this.chatId,
|
||||
type: type,
|
||||
storeId: '0',
|
||||
sendType: '1',
|
||||
storeName: ''
|
||||
}
|
||||
data = JSON.stringify(data);
|
||||
let that = this;
|
||||
uni.sendSocketMessage({
|
||||
data: data,
|
||||
success(res) {
|
||||
let avatar = that.$queue.getData('avatar');
|
||||
if (!avatar) {
|
||||
avatar = '../../static/logo.png';
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
that.getTimeOrListItem1();
|
||||
}, 50);
|
||||
console.log(that.content);
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
this.content = '';
|
||||
},
|
||||
//发送图片
|
||||
chooseImage(sourceType) {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sourceType: ['album', 'camera'],
|
||||
success: res => {
|
||||
for (let i = 0; i < res.tempFilePaths.length; i++) {
|
||||
this.$queue.showLoading("上传中...");
|
||||
uni.uploadFile({ // 上传接口
|
||||
url: this.config("APIHOST") + '/alioss/upload', //真实的接口地址
|
||||
filePath: res.tempFilePaths[i],
|
||||
name: 'file',
|
||||
success: (uploadFileRes) => {
|
||||
this.content = JSON.parse(uploadFileRes.data).data;
|
||||
this.setChatSave(2);
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
config: function(name) {
|
||||
var info = null;
|
||||
if (name) {
|
||||
var name2 = name.split("."); //字符分割
|
||||
if (name2.length > 1) {
|
||||
info = configdata[name2[0]][name2[1]] || null;
|
||||
} else {
|
||||
info = configdata[name] || null;
|
||||
}
|
||||
if (info == null) {
|
||||
// let web_config = cache.get("web_config");
|
||||
// if (web_config) {
|
||||
// if (name2.length > 1) {
|
||||
// info = web_config[name2[0]][name2[1]] || null;
|
||||
// } else {
|
||||
// info = web_config[name] || null;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
return info;
|
||||
},
|
||||
//查看大图
|
||||
viewImg(item) {
|
||||
let imgsArray = [];
|
||||
imgsArray[0] = item;
|
||||
uni.previewImage({
|
||||
current: 0,
|
||||
urls: imgsArray
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
/* background: #1c1b20; */
|
||||
}
|
||||
|
||||
.input-box {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: 100rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
box-sizing: content-box;
|
||||
z-index: 999;
|
||||
/* background-color: #ececec; */
|
||||
/* padding: 0 5rpx; */
|
||||
}
|
||||
|
||||
.chat-listitem {
|
||||
display: flex;
|
||||
margin-top: 20rpx;
|
||||
padding: 10rpx;
|
||||
}
|
||||
|
||||
.chat-listitem-text {
|
||||
color: #000000;
|
||||
background: #FFFFFF;
|
||||
margin-top: 10rpx;
|
||||
width: fit-content;
|
||||
padding: 15rpx;
|
||||
font-size: 30rpx;
|
||||
height: max-content;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.chat-listitem-image-type4 {
|
||||
color: #000000;
|
||||
background: #FFFFFF;
|
||||
width: fit-content;
|
||||
font-size: 30rpx;
|
||||
height: max-content;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
border-top-left-radius: 20rpx;
|
||||
border-top-right-radius: 20rpx;
|
||||
}
|
||||
|
||||
.chat-listitem-image {
|
||||
margin-top: 5rpx;
|
||||
width: 75rpx;
|
||||
height: 75rpx;
|
||||
border-radius: 5rpx;
|
||||
}
|
||||
|
||||
.save {
|
||||
width: 130rpx;
|
||||
text-align: center;
|
||||
border-radius: 10rpx;
|
||||
height: 70rpx;
|
||||
color: #FFF;
|
||||
background: #1789FD;
|
||||
margin: 5rpx 10rpx 0;
|
||||
line-height: 70rpx;
|
||||
}
|
||||
</style>
|
||||
188
pages/my/comments.vue
Normal file
188
pages/my/comments.vue
Normal file
@@ -0,0 +1,188 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="online_box">
|
||||
<view class="part1">
|
||||
<view class="online_left">投诉类型</view>
|
||||
<view class="online_right" @click="show = true">
|
||||
{{complaintName?complaintName:'请选择投诉类型'}}
|
||||
<image src="../../static/images/img/go.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
<u-line color="#E6E6E6" />
|
||||
<view class="online">
|
||||
<view class="tit">投诉理由</view>
|
||||
<view class="text_box" style="margin-top: 20rpx;">
|
||||
<u-input v-model="value" height="300" :type="type" :border="border" :clearable="false"
|
||||
placeholder="请描述问题发生的情况" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn" @click="bindorder">立即提交</view>
|
||||
|
||||
<u-picker v-model="show" mode="selector" :range="typeList" range-key="illegal" @confirm='select'></u-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
value: '',
|
||||
type: 'textarea',
|
||||
border: true,
|
||||
indentNumber: '',
|
||||
complaintName: '',
|
||||
typeList: [],
|
||||
IllegalId: ''
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log(options)
|
||||
this.indentNumber = options.indentNumber
|
||||
console.log(options.indentNumber)
|
||||
this.getTypeList()
|
||||
},
|
||||
methods: {
|
||||
select(e) {
|
||||
console.log(e)
|
||||
this.complaintName = this.typeList[e].illegal
|
||||
this.IllegalId = this.typeList[e].id
|
||||
|
||||
},
|
||||
getTypeList() {
|
||||
this.$Request.get('/shop/illegalType/selectIllegalTypeList').then(res => {
|
||||
if (res.code == 0) {
|
||||
this.typeList = res.data
|
||||
}
|
||||
});
|
||||
},
|
||||
bindorder() {
|
||||
if (this.IllegalId == '') {
|
||||
uni.showToast({
|
||||
title: '请选择投诉类型',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.value == '') {
|
||||
uni.showToast({
|
||||
title: '请填写投诉原因',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.$Request.postJson('/app/tbindent/insertComplaint', {
|
||||
// indentNumber:this.indentNumber,
|
||||
indentNumber: this.indentNumber,
|
||||
wrongExplain: this.value,
|
||||
shopIllegalId: this.IllegalId,
|
||||
type: '2',
|
||||
indentType: '5',
|
||||
shopId: uni.getStorageSync('shopId')
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '提交成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(function() {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
} else {
|
||||
console.log('失败:', res.data)
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.online_box {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
margin-top: 30rpx;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.part1 {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.online_left {
|
||||
flex: 1;
|
||||
font-size: 27rpx;
|
||||
font-weight: bold;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.online_right {
|
||||
color: #999999;
|
||||
font-size: 22rpx;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.online_right image {
|
||||
width: 12rpx;
|
||||
height: 21rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.online_title {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
letter-spacing: 2rpx;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
|
||||
.online {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
padding-bottom: 34rpx;
|
||||
}
|
||||
|
||||
.tit {
|
||||
font-size: 27rpx;
|
||||
font-weight: bold;
|
||||
letter-spacing: 2rpx;
|
||||
margin-top: 19rpx;
|
||||
}
|
||||
|
||||
.u-input--border {
|
||||
border: none !important;
|
||||
background: #F5F5F5 !important;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
background: #FF7F00;
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
color: white;
|
||||
border-radius: 15rpx;
|
||||
margin-top: 20rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
</style>
|
||||
259
pages/my/earnings.vue
Normal file
259
pages/my/earnings.vue
Normal file
@@ -0,0 +1,259 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="bg padding-tb-xl">
|
||||
<view class="box padding">
|
||||
<view>
|
||||
<!-- <view class="lins"></view> -->
|
||||
<view class="margin-top marginlr" style="display: flex;font-size:32upx;">
|
||||
<view style="width: 50%;">订单总金额</view>
|
||||
<view style="width: 50%;">{{dataCentre.money?dataCentre.money:0}}<text class="text-sm">元</text></view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="margin-top marginlr" style="display: flex;font-size:32upx;">
|
||||
<view style="width: 50%;">订 单 数 量</view>
|
||||
<view style="width: 50%;">{{dataCentre.count?dataCentre.count:0}}<text class="text-sm">单</text></view>
|
||||
|
||||
</view>
|
||||
<view class="margin-top marginlr" style="display: flex;font-size:32upx;">
|
||||
<view style="width: 50%;">外卖订单金额</view>
|
||||
<view style="width: 50%;">{{dataCentre.takeMoney1?dataCentre.takeMoney1:0}}<text class="text-sm">元</text></view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="margin-top marginlr" style="display: flex;font-size:32upx;">
|
||||
<view style="width: 50%;">外卖订单数</view>
|
||||
<view style="width: 50%;">{{dataCentre.takeCount2?dataCentre.takeCount2:0}}<text class="text-sm">单</text></view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="margin-top marginlr" style="display: flex;font-size:32upx;">
|
||||
<view style="width: 50%;">退款订单金额</view>
|
||||
<view style="width: 50%;">{{dataCentre.cancelOrderMoney?dataCentre.cancelOrderMoney:0}}<text class="text-sm">元</text></view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="margin-top marginlr" style="display: flex;font-size:32upx;">
|
||||
<view style="width: 50%;">退款订单数</view>
|
||||
<view style="width: 50%;">{{dataCentre.cancelOrderCount?dataCentre.cancelOrderCount:0}}<text class="text-sm">单</text></view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="margin-top marginlr" style="display: flex;font-size:32upx;">
|
||||
<view style="width: 50%;">到店单金额</view>
|
||||
<view style="width: 50%;">{{dataCentre.takeMoney?dataCentre.takeMoney:0}}<text class="text-sm">元</text></view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="margin-top marginlr" style="display: flex;font-size:32upx;">
|
||||
<view style="width: 50%;">到店订单数</view>
|
||||
<view style="width: 50%;">{{dataCentre.takeCount?dataCentre.takeCount:0}}<text class="text-sm">单</text></view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="page-box" v-if="orderList.length == 0" >
|
||||
<view class="centre">
|
||||
<image src="../../static/images/empty.png" mode=""></image>
|
||||
<view class="tips">暂无内容</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view style="margin: 10upx;">
|
||||
<view class="boxs" v-for="(item,index) in orderList" :key='index' >
|
||||
<view class="flex justify-between align-center padding">
|
||||
<view class="textRed">已完成</view>
|
||||
<view style="color:#999999;">{{item.payTime}}</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="padding">
|
||||
<view style="color:#333333;" class="text-lg text-bold">{{item.orderGoodsList[0].goodsName}}</view>
|
||||
<view style="color:#333333;" class="padding-tb-sm"><text
|
||||
style="color:#999999;">规格:</text>{{item.orderGoodsList[0].skuMessage}}</view>
|
||||
<view style="color:#333333;"><text style="color:#999999;">取餐号:</text>{{item.orderCode}}</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="flex justify-between padding">
|
||||
<view style="color:#333333;" class="text-lg">
|
||||
<text style="color:#999999;" class="text-df">实收:</text>¥{{item.payMoney}}
|
||||
</view>
|
||||
<view class="look" @click="getDet(item)" >查看详情</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataCentre: {},
|
||||
page: 1,
|
||||
limit: 10,
|
||||
orderList: [],
|
||||
shopId: '',
|
||||
totalCount: 0
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.shopId = option.shopId
|
||||
this.getDataCentre()
|
||||
this.getOrderList()
|
||||
},
|
||||
methods: {
|
||||
getDet(item) {
|
||||
uni.navigateTo({
|
||||
url: '/shop/orderDet?orderNumber=' + item.orderNumber
|
||||
})
|
||||
},
|
||||
// 收入
|
||||
getDataCentre() {
|
||||
this.$Request.getA("/admin/goodsShop/selectStoreData?shopId=" + this.shopId).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.dataCentre = res.hashMap
|
||||
}
|
||||
});
|
||||
},
|
||||
getOrderList() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
status: 4,
|
||||
shopId: this.shopId
|
||||
}
|
||||
this.$Request.getA("/admin/order/selectAllOrder",data).then(res => {
|
||||
if (res.code == 0) {
|
||||
if(this.page == 1) {
|
||||
this.orderList = res.data.list
|
||||
} else {
|
||||
this.orderList = [...this.orderList, ...res.data.list]
|
||||
}
|
||||
this.totalCount = res.data.totalCount
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
uni.hideLoading()
|
||||
});
|
||||
}
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.page = this.page + 1;
|
||||
this.getOrderList();
|
||||
if(this.totalCount == this.orderList.length) {
|
||||
uni.showToast({
|
||||
title: '已经到底了~',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
this.page = 1;
|
||||
this.getOrderList();
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #EDF1F7;
|
||||
}
|
||||
|
||||
.bg {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.box {
|
||||
width: 686upx;
|
||||
// height: 329upx;
|
||||
background: linear-gradient(90deg, #D0AA72 0%, #DBB984 100%);
|
||||
border-radius: 16upx;
|
||||
margin: 0 auto;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.lins {
|
||||
width: 1upx;
|
||||
height: 60upx;
|
||||
border: 1upx solid #FFFFFF;
|
||||
}
|
||||
|
||||
.boxs {
|
||||
// width: 686upx;
|
||||
/* height: 363upx; */
|
||||
|
||||
background: #FFFFFF;
|
||||
border-radius: 20upx;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.textRed {
|
||||
font-size: 30upx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #D80204;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 686upx;
|
||||
height: 1upx;
|
||||
border: 1upx solid #E6E6E6;
|
||||
}
|
||||
|
||||
.look {
|
||||
width: 150upx;
|
||||
height: 50upx;
|
||||
background: #FCD202;
|
||||
border-radius: 25upx;
|
||||
line-height: 50upx;
|
||||
text-align: center;
|
||||
font-size: 24upx;
|
||||
}
|
||||
.page-box {
|
||||
position: relative;
|
||||
// left: 0;
|
||||
height: 50vh;
|
||||
z-index: 0;
|
||||
top: 70px;
|
||||
}
|
||||
|
||||
.centre {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
height: 400rpx;
|
||||
text-align: center;
|
||||
// padding: 200rpx auto;
|
||||
font-size: 32rpx;
|
||||
|
||||
image {
|
||||
width: 387rpx;
|
||||
height: 341rpx;
|
||||
// margin-bottom: 20rpx;
|
||||
margin: 0 auto 20rpx;
|
||||
// border: 1px dotted #000000;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 32rpx;
|
||||
color: #2F3044;
|
||||
margin-top: 20rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 80rpx auto;
|
||||
width: 600rpx;
|
||||
border-radius: 32rpx;
|
||||
line-height: 90rpx;
|
||||
color: #ffffff;
|
||||
font-size: 34rpx;
|
||||
background: #5074FF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
189
pages/my/forgetPwd.vue
Normal file
189
pages/my/forgetPwd.vue
Normal file
@@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="wrapper">
|
||||
<view class="input-content">
|
||||
<view class="cu-form-group" style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
|
||||
<view class="title text-black">手机号</view>
|
||||
<input type="number" :value="phone" placeholder="请输入手机号" maxlength="11" data-key="phone" @input="inputChange" />
|
||||
</view>
|
||||
<view class="cu-form-group" style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
|
||||
<text class="title text-black">验证码</text>
|
||||
<input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code" @input="inputChange"
|
||||
@confirm="toLogin" />
|
||||
<button class="send-msg" @click="sendMsg" :disabled="sending">{{sendTime}}</button>
|
||||
</view>
|
||||
<view class="cu-form-group" style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
|
||||
<text class="title text-black">设置密码</text>
|
||||
<input type="password" :value="password" placeholder="请设置新密码" placeholder-class="input-empty" maxlength="20"
|
||||
minlength="6" data-key="password" @input="inputChange" @confirm="toLogin" />
|
||||
</view>
|
||||
</view>
|
||||
<button class="confirm-btn" @click="toLogin">立即找回</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
code: '',
|
||||
phone: '',
|
||||
password: '',
|
||||
sending: false,
|
||||
sendTime: '获取验证码',
|
||||
count: 60,
|
||||
logining: false
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
sendMsg() {
|
||||
const {
|
||||
phone
|
||||
} = this;
|
||||
if (!phone) {
|
||||
this.$queue.showToast("请输入手机号");
|
||||
} else if (phone.length !== 11) {
|
||||
this.$queue.showToast("请输入正确的手机号");
|
||||
} else {
|
||||
this.$queue.showLoading("正在发送验证码...");
|
||||
this.$Request.getT("/app/Login/sendMsg/" + phone + "/forget").then(res => {
|
||||
if (res.code === 0) {
|
||||
this.sending = true;
|
||||
this.$queue.showToast('验证码发送成功请注意查收');
|
||||
this.countDown();
|
||||
uni.hideLoading();
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
title: '短信发送失败',
|
||||
content: res.msg ? res.msg : '请一分钟后再获取验证码'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
countDown() {
|
||||
const {
|
||||
count
|
||||
} = this;
|
||||
if (count === 1) {
|
||||
this.count = 60;
|
||||
this.sending = false;
|
||||
this.sendTime = '获取验证码'
|
||||
} else {
|
||||
this.count = count - 1;
|
||||
this.sending = true;
|
||||
this.sendTime = count - 1 + '秒后重新获取';
|
||||
setTimeout(this.countDown.bind(this), 1000);
|
||||
}
|
||||
},
|
||||
inputChange(e) {
|
||||
const key = e.currentTarget.dataset.key;
|
||||
this[key] = e.detail.value;
|
||||
},
|
||||
navBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
|
||||
|
||||
navTo(url) {
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
},
|
||||
toLogin() {
|
||||
const {
|
||||
phone,
|
||||
password,
|
||||
code
|
||||
} = this;
|
||||
if (!phone) {
|
||||
this.$queue.showToast("请输入手机号");
|
||||
} else if (!password) {
|
||||
this.$queue.showToast("请设置密码");
|
||||
} else if (password.length < 6) {
|
||||
this.$queue.showToast("密码位数必须大于六位");
|
||||
} else {
|
||||
this.logining = true;
|
||||
this.$queue.showLoading("正在修改密码中...");
|
||||
this.$Request.post("/app/Login/forgetPwd", {
|
||||
pwd: password,
|
||||
phone: phone,
|
||||
msg: code
|
||||
}).then(res => {
|
||||
uni.hideLoading();
|
||||
if (res.code === 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/public/loginphone'
|
||||
});
|
||||
} else {
|
||||
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
title: '密码找回失败',
|
||||
content: res.msg,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
page {
|
||||
background: #F5F5F5 !important;
|
||||
}
|
||||
|
||||
.send-msg {
|
||||
border-radius: 30px;
|
||||
/* color: white; */
|
||||
height: 30px;
|
||||
font-size: 14px;
|
||||
line-height: 30px;
|
||||
background: #FCD202;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding-top: 32upx;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
position: relative;
|
||||
z-index: 90;
|
||||
background: #FFFFFF;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
|
||||
.input-content {
|
||||
padding: 32upx 80upx;
|
||||
}
|
||||
|
||||
|
||||
.confirm-btn {
|
||||
width: 600upx;
|
||||
height: 80upx;
|
||||
line-height: 80upx;
|
||||
border-radius: 60upx;
|
||||
margin-top: 32upx;
|
||||
background: #FCD202;
|
||||
/* color: #fff; */
|
||||
font-size: 32upx;
|
||||
|
||||
&:after {
|
||||
border-radius: 60px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
534
pages/my/im.vue
Normal file
534
pages/my/im.vue
Normal file
@@ -0,0 +1,534 @@
|
||||
<template>
|
||||
<view>
|
||||
<view style="width: 100%;padding-bottom: 140rpx;">
|
||||
<view style="display: flex;flex-direction: column;" v-for="(item,index) in ListItem" :key='index'>
|
||||
<view style="margin-top: 15rpx;width: 100%;text-align: center;font-size: 26rpx;color: #999999;">
|
||||
{{item.createTime}}
|
||||
</view>
|
||||
|
||||
<view v-if="item.shopId" style="width: 83%;margin-left: 15%;">
|
||||
<view class="chat-listitem" style="float: right;">
|
||||
<view v-if="item.content && item.messageType === 1" @longpress="copy(item.content)"
|
||||
class="chat-listitem-text" style="margin-right: 20rpx;">{{item.content}}</view>
|
||||
<image @tap="viewImg(item.content)" v-if="item.content && item.messageType === 2"
|
||||
:src="item.content" style="height: 200rpx;width: 200rpx;margin-right: 20rpx;"></image>
|
||||
<view>
|
||||
<image v-if="item.shopCover" :src="item.shopCover" class="chat-listitem-image"></image>
|
||||
<image v-else src="../../static/logo.png" class="chat-listitem-image"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="!item.shopId" style="width: 83%;margin-right: 15%;">
|
||||
<view class="chat-listitem" style="float: left;margin-left: 10rpx;">
|
||||
<view v-if="item.userId">
|
||||
<image :src="item.userAvatar" class="chat-listitem-image"></image>
|
||||
</view>
|
||||
<view v-if="item.riderId">
|
||||
<image :src="item.riderAvatar" class="chat-listitem-image"></image>
|
||||
</view>
|
||||
<view>
|
||||
<!-- <view class="margin-left">{{item.userName}}</view> -->
|
||||
<view v-if="item.content && item.messageType === 1" class="chat-listitem-text"
|
||||
style="margin-left: 20rpx;">{{item.content}}</view>
|
||||
<image @tap="viewImg(item.content)" v-if="item.content && item.messageType === 2"
|
||||
:src="item.content" style="height: 200rpx;width: 200rpx;margin-left: 20rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 跳转订单 -->
|
||||
<view class="order" @click="bindorder()">
|
||||
<image src="../../static/images/img/order.png"></image>
|
||||
</view>
|
||||
<!-- 底部聊天输入框 -->
|
||||
<view class="input-box ">
|
||||
<view class="justify-between padding-lr align-center"
|
||||
style="display: flex;width: 100%;background-color: #EEEEEE;">
|
||||
<image src="../../static/images/img/add.png" @click="chooseImage(['album'])"
|
||||
style="width: 50rpx;height: 50rpx;margin-right: 12rpx;border-radius: 50upx;"></image>
|
||||
<input confirm-type="send" @confirm='setChatSave(1)' type="text" v-model="content"
|
||||
style="width: 72%;height: 70rpx;background: #fff;margin: 0 10rpx;border-radius: 5rpx;padding-left: 10rpx;" />
|
||||
<view class="save" @tap='setChatSave(1)'>发送</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import configdata from '../../common/config.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
connected: false,
|
||||
connecting: false,
|
||||
msg: false,
|
||||
type4: [],
|
||||
listRight: {
|
||||
chat: {
|
||||
userHead: ""
|
||||
},
|
||||
content: "",
|
||||
sendType: 1,
|
||||
type: 1
|
||||
},
|
||||
content: '',
|
||||
chatId: '',
|
||||
type: 1,
|
||||
ListItem: [],
|
||||
ShopState: false,
|
||||
ShopordersId: '',
|
||||
Shopimage: '',
|
||||
Shopmoney: '',
|
||||
ShopTitle: '',
|
||||
orderState: false,
|
||||
ordersId: '',
|
||||
userId: '',
|
||||
orderimage: '',
|
||||
orderNum: '',
|
||||
teamId: '',
|
||||
hand: 1,
|
||||
index: 0,
|
||||
page: 0,
|
||||
size: 1000,
|
||||
countDown: '',
|
||||
ordersId: '',
|
||||
byUserId: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
showMsg() {
|
||||
if (this.connected) {
|
||||
if (this.msg) {
|
||||
return '收到消息:' + this.msg
|
||||
} else {
|
||||
return '等待接收消息'
|
||||
}
|
||||
} else {
|
||||
return '尚未连接'
|
||||
}
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
// uni.closeSocket()
|
||||
uni.hideLoading()
|
||||
},
|
||||
onLoad(d) {
|
||||
|
||||
this.userId = this.$queue.getData('userId');
|
||||
// this.byUserId = d.byUserId
|
||||
this.ordersId = d.orderId;
|
||||
console.log(this.ordersId)
|
||||
this.connect();
|
||||
|
||||
// if (d.teamName) {
|
||||
// uni.setNavigationBarTitle({
|
||||
// title: d.teamName
|
||||
// });
|
||||
// }
|
||||
},
|
||||
onShow() {
|
||||
if (this.connected || this.connecting) {
|
||||
|
||||
} else {
|
||||
this.connect();
|
||||
}
|
||||
},
|
||||
onHide() {
|
||||
// uni.closeSocket()
|
||||
},
|
||||
onUnload() {
|
||||
this.close()
|
||||
},
|
||||
methods: {
|
||||
// 跳转订单
|
||||
bindorder() {
|
||||
console.log(this.ordersId)
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/orderDet?orderId=' + this.ordersId
|
||||
})
|
||||
},
|
||||
copy(content) {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '确认要复制此文字吗?',
|
||||
showCancel: true,
|
||||
cancelText: '取消',
|
||||
confirmText: '确认',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setClipboardData({
|
||||
data: content,
|
||||
success: r => {
|
||||
this.$queue.showToast('复制成功');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
getDateDiff(data) {
|
||||
// 传进来的data必须是日期格式,不能是时间戳
|
||||
//var str = data;
|
||||
//将字符串转换成时间格式
|
||||
var timePublish = new Date(data);
|
||||
var timeNow = new Date();
|
||||
var minute = 1000 * 60;
|
||||
var hour = minute * 60;
|
||||
var day = hour * 24;
|
||||
var month = day * 30;
|
||||
var result = "2";
|
||||
|
||||
var diffValue = timeNow - timePublish;
|
||||
var diffMonth = diffValue / month;
|
||||
var diffWeek = diffValue / (7 * day);
|
||||
var diffDay = diffValue / day;
|
||||
var diffHour = diffValue / hour;
|
||||
var diffMinute = diffValue / minute;
|
||||
|
||||
|
||||
if (diffMonth > 3) {
|
||||
result = timePublish.getFullYear() + "-";
|
||||
result += timePublish.getMonth() + "-";
|
||||
result += timePublish.getDate();
|
||||
} else if (diffMonth > 1) { //月
|
||||
result = data.substring(0, 10);
|
||||
} else if (diffWeek > 1) { //周
|
||||
result = data.substring(0, 10);
|
||||
} else if (diffDay > 1) { //天
|
||||
result = data.substring(0, 10);
|
||||
} else if (diffHour > 1) { //小时
|
||||
result = parseInt(diffHour) + "小时前";
|
||||
} else if (diffMinute > 1) { //分钟
|
||||
result = parseInt(diffMinute) + "分钟前";
|
||||
} else {
|
||||
result = "刚刚";
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
connect() {
|
||||
let that = this;
|
||||
let userId = that.$queue.getData('userId');
|
||||
if (that.connected || that.connecting) {
|
||||
uni.showModal({
|
||||
content: '正在连接或者已经连接,请勿重复连接',
|
||||
showCancel: false
|
||||
})
|
||||
return false
|
||||
}
|
||||
that.connecting = true
|
||||
uni.showLoading({
|
||||
title: '连接中...'
|
||||
})
|
||||
console.log(userId, '*******************')
|
||||
uni.connectSocket({
|
||||
// url: 'ws://192.168.1.17:8881/gameTeamChat/' + userId + '_' + this.teamId,
|
||||
// url: 'wss://game.shengqianxiong.com.cn/wss/gameTeamChat/' + userId + '_' + this.teamId,
|
||||
// url: 'ws://74165o0188.uicp.fun/sqx_fast/chatSocket/' + userId,
|
||||
url: this.config("WSHOST1") + this.ordersId,
|
||||
data() {
|
||||
return {
|
||||
msg: 'Hello'
|
||||
}
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
method: 'GET',
|
||||
success(res) {
|
||||
uni.hideLoading();
|
||||
that.getTimeOrListItem1();
|
||||
// 这里是接口调用成功的回调,不是连接成功的回调,请注意
|
||||
},
|
||||
fail(err) {
|
||||
// 这里是接口调用失败的回调,不是连接失败的回调,请注意
|
||||
console.log("--------------" + JSON.stringify(err))
|
||||
}
|
||||
});
|
||||
uni.onSocketOpen((res) => {
|
||||
that.connecting = false
|
||||
that.connected = true
|
||||
uni.hideLoading()
|
||||
// uni.showToast({
|
||||
// icon: 'none',
|
||||
// title: '连接成功'
|
||||
// })
|
||||
console.log('onOpen', res);
|
||||
});
|
||||
uni.onSocketError((err) => {
|
||||
that.connecting = false
|
||||
that.connected = false
|
||||
uni.hideLoading()
|
||||
uni.showModal({
|
||||
content: '网络较差,请稍后再试',
|
||||
showCancel: false
|
||||
})
|
||||
console.log('onError', err);
|
||||
});
|
||||
uni.onSocketMessage(function(res) {
|
||||
console.log('收到服务器内容:' + JSON.stringify(res));
|
||||
|
||||
setTimeout(() => {
|
||||
that.getTimeOrListItem1();
|
||||
}, 50);
|
||||
|
||||
});
|
||||
uni.onSocketClose((res) => {
|
||||
that.connected = false
|
||||
that.startRecive = false
|
||||
that.msg = false
|
||||
console.log('onClose', res)
|
||||
});
|
||||
},
|
||||
close() {
|
||||
uni.closeSocket()
|
||||
},
|
||||
getTimeOrListItem1() {
|
||||
console.log(this.ordersId)
|
||||
this.$Request.get('/shop/ordersChat/selectGameChatDetails?page=1&limit=1000&ordersId=' +
|
||||
this.ordersId).then(
|
||||
res => {
|
||||
this.ListItem = [];
|
||||
if (res.data) {
|
||||
var time = '';
|
||||
res.data.list.forEach(d => {
|
||||
if (!d.avatar) {
|
||||
// d.chat.userHead = '../../static/logo.png';
|
||||
let avatar = this.$queue.getData('avatar');
|
||||
d.avatar = avatar
|
||||
}
|
||||
this.ListItem.push(d);
|
||||
});
|
||||
this.ListItem = this.ListItem.reverse();
|
||||
setTimeout(() => {
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 99999,
|
||||
duration: 0
|
||||
});
|
||||
}, 50);
|
||||
}
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
getChatSave() {
|
||||
let userId = this.$queue.getData('userId');
|
||||
let phone = this.$queue.getData('phone');
|
||||
let userName = this.$queue.getData('userName');
|
||||
if (!phone) {
|
||||
phone = this.$queue.getData('userName');
|
||||
}
|
||||
let avatar = this.$queue.getData('avatar');
|
||||
let data = {
|
||||
userId: userId,
|
||||
userHead: avatar,
|
||||
userName: userName,
|
||||
storeId: '0',
|
||||
storeHead: '同城外卖商家',
|
||||
storeName: ''
|
||||
}
|
||||
this.$Request.postJson('/chat/save', data).then(res => {
|
||||
if (res.status === 0) {
|
||||
this.chatId = res.data.chatId;
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
this.getTimeOrListItem1();
|
||||
}
|
||||
});
|
||||
},
|
||||
setChatSave(type) {
|
||||
//type:1文字 2图片
|
||||
if (type === 1 && this.content == '') {
|
||||
this.$queue.showToast('请输入聊天内容');
|
||||
return;
|
||||
}
|
||||
// if (this.chatId == '' || this.chatId == undefined) {
|
||||
// this.$queue.showToast('网络较差,请稍后再试');
|
||||
// return;
|
||||
// }
|
||||
let shopId = this.$queue.getData('shopId');
|
||||
let userId = this.$queue.getData('userId');
|
||||
let avatar = this.$queue.getData('avatar');
|
||||
let phone = this.$queue.getData('phone');
|
||||
let userName = this.$queue.getData('userName');
|
||||
if (!phone) {
|
||||
phone = this.$queue.getData('userName');
|
||||
}
|
||||
// console.log(this.byUserId)
|
||||
let data = {
|
||||
content: this.content,
|
||||
messageType: type,
|
||||
shopId: shopId,
|
||||
ordersId: this.ordersId,
|
||||
chatConversationId: this.chatConversationId,
|
||||
userId: userId,
|
||||
}
|
||||
data = JSON.stringify(data);
|
||||
let that = this;
|
||||
uni.sendSocketMessage({
|
||||
data: data,
|
||||
success(res) {
|
||||
|
||||
let avatar = that.$queue.getData('avatar');
|
||||
if (!avatar) {
|
||||
avatar = '../../static/logo.png';
|
||||
}
|
||||
let data = {
|
||||
chat: {
|
||||
userHead: avatar
|
||||
},
|
||||
content: that.content,
|
||||
type: type,
|
||||
userId: userId
|
||||
}
|
||||
console.log(data, 'data99999999999999999')
|
||||
// that.ListItem.push(data);
|
||||
setTimeout(() => {
|
||||
that.getTimeOrListItem1();
|
||||
}, 50);
|
||||
console.log(that.content);
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
this.content = '';
|
||||
},
|
||||
//发送图片
|
||||
chooseImage(sourceType) {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sourceType: ['album', 'camera'],
|
||||
success: res => {
|
||||
for (let i = 0; i < res.tempFilePaths.length; i++) {
|
||||
this.$queue.showLoading("上传中...");
|
||||
uni.uploadFile({ // 上传接口
|
||||
url: this.config("APIHOST1") + '/alioss/upload', //真实的接口地址
|
||||
filePath: res.tempFilePaths[i],
|
||||
name: 'file',
|
||||
success: (uploadFileRes) => {
|
||||
console.log(uploadFileRes)
|
||||
this.content = JSON.parse(uploadFileRes.data).data;
|
||||
this.setChatSave(2);
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
config: function(name) {
|
||||
var info = null;
|
||||
if (name) {
|
||||
var name2 = name.split("."); //字符分割
|
||||
if (name2.length > 1) {
|
||||
info = configdata[name2[0]][name2[1]] || null;
|
||||
} else {
|
||||
info = configdata[name] || null;
|
||||
}
|
||||
if (info == null) {
|
||||
// let web_config = cache.get("web_config");
|
||||
// if (web_config) {
|
||||
// if (name2.length > 1) {
|
||||
// info = web_config[name2[0]][name2[1]] || null;
|
||||
// } else {
|
||||
// info = web_config[name] || null;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
return info;
|
||||
},
|
||||
//查看大图
|
||||
viewImg(item) {
|
||||
let imgsArray = [];
|
||||
imgsArray[0] = item;
|
||||
uni.previewImage({
|
||||
current: 0,
|
||||
urls: imgsArray
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
/* background: #1c1b20; */
|
||||
}
|
||||
|
||||
.input-box {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: 120rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
box-sizing: content-box;
|
||||
z-index: 999;
|
||||
/* background-color: #ececec; */
|
||||
/* padding: 0 5rpx; */
|
||||
}
|
||||
|
||||
.chat-listitem {
|
||||
display: flex;
|
||||
margin-top: 20rpx;
|
||||
padding: 10rpx;
|
||||
}
|
||||
|
||||
.chat-listitem-text {
|
||||
color: #000000;
|
||||
background: #FFFFFF;
|
||||
margin-top: 10rpx;
|
||||
width: fit-content;
|
||||
padding: 15rpx;
|
||||
font-size: 30rpx;
|
||||
height: max-content;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.chat-listitem-image-type4 {
|
||||
color: #000000;
|
||||
background: #FFFFFF;
|
||||
width: fit-content;
|
||||
font-size: 30rpx;
|
||||
height: max-content;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
border-top-left-radius: 20rpx;
|
||||
border-top-right-radius: 20rpx;
|
||||
}
|
||||
|
||||
.chat-listitem-image {
|
||||
margin-top: 5rpx;
|
||||
width: 75rpx;
|
||||
height: 75rpx;
|
||||
border-radius: 5rpx;
|
||||
}
|
||||
|
||||
.save {
|
||||
width: 130rpx;
|
||||
text-align: center;
|
||||
border-radius: 70rpx;
|
||||
height: 70rpx;
|
||||
color: #FFF;
|
||||
background: #1789FD;
|
||||
margin: 5rpx 10rpx 0;
|
||||
line-height: 70rpx;
|
||||
}
|
||||
|
||||
.order {
|
||||
position: fixed;
|
||||
bottom: 65px;
|
||||
right: 15px;
|
||||
}
|
||||
|
||||
.order image {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
</style>
|
||||
741
pages/my/index.vue
Normal file
741
pages/my/index.vue
Normal file
@@ -0,0 +1,741 @@
|
||||
<template>
|
||||
<view style="padding-bottom: 100upx;">
|
||||
<view class="bg padding-bottom">
|
||||
<view class=" u-flex padding ">
|
||||
<view class="u-m-r-10">
|
||||
<!-- @click="goNav('/pages/my/userinfo')" -->
|
||||
<image :src="shopCover" style="width: 100rpx;height: 100rpx;border-radius: 100rpx;"
|
||||
@click="goNavs(list[0].url)"></image>
|
||||
</view>
|
||||
<view class="u-flex-1 u-m-l-10 flex justify-between align-center" v-if="!isLogin">
|
||||
<view class="u-font-18 text-bold">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="margin-left-sm margin-top-xs" style="width: 180px;">{{shopName}}</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<view class="margin-left-sm margin-top-xs" style="width: 180px;">{{shopName}}</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view class="erweima" @click="shopQr()">生成二维码</view>
|
||||
</view>
|
||||
<view v-else class="text-xl u-p-l-20 text-bold" @click="goLogin('/pages/my/loginphone')">
|
||||
登录
|
||||
</view>
|
||||
</view>
|
||||
<view class="moneybox" v-if="XCXIsSelect != '否'">
|
||||
<view class="padding" style="background: #FCD202;border-radius: 20upx 20upx 0upx 0upx;">
|
||||
<view class="flex justify-between">
|
||||
<view>
|
||||
<view>累计收益(元)</view>
|
||||
<view class="margin-top-xs" style="font-size: 40upx;">
|
||||
¥<text style="font-size: 55upx;">{{sumMoney}}</text></view>
|
||||
</view>
|
||||
<view class="btn" @click="goQian()">立即提现</view>
|
||||
</view>
|
||||
<view class="flex justify-between align-center text-center margin-top">
|
||||
<view>
|
||||
<view>今日收益</view>
|
||||
<view class="margin-top-xs" style="font-size: 38upx;">
|
||||
¥<text style="font-size: 48upx;">{{dayMoney?dayMoney:'0'}}</text></view>
|
||||
</view>
|
||||
<view>
|
||||
<view>本月收益</view>
|
||||
<view class="margin-top-xs" style="font-size: 38upx;">
|
||||
¥<text style="font-size: 48upx;">{{monthMoney?monthMoney:'0'}}</text></view>
|
||||
</view>
|
||||
<view>
|
||||
<view>本月提现</view>
|
||||
<view class="margin-top-xs" style="font-size: 38upx;">
|
||||
¥<text style="font-size: 48upx;">{{cashMoney?cashMoney:'0'}}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex align-center justify-between padding-lr padding-tb-sm"
|
||||
style="background: #FCB202;border-radius: 0upx 0upx 20upx 20upx;">
|
||||
<view class="">每次提现平台将扣除相应手续费</view>
|
||||
<view class="xflist" @click="goNav('/my/other/cashList')">钱包明细</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="bg margin-top-sm">
|
||||
<!-- 店铺管理 -->
|
||||
<view class="flex padding-lr padding-tb dfs" @click="goNavs(list[0].url)">
|
||||
<image :src="list[0].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[0].title}}</view>
|
||||
<image src="../../static/images/my/right.png" class="images" mode=""></image>
|
||||
</view>
|
||||
<!-- 商品管理 -->
|
||||
<view class="flex padding-lr padding-tb dfs" @click="goNavs(list[1].url)">
|
||||
<image :src="list[1].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[1].title}}</view>
|
||||
<image src="../../static/images/my/right.png" class="images" mode=""></image>
|
||||
</view>
|
||||
<!-- 订单管理 -->
|
||||
<view class="flex padding-lr padding-tb" @click="goOrder()">
|
||||
<image :src="list[2].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[2].title}}</view>
|
||||
<image src="../../static/images/my/right.png" class="images" mode=""></image>
|
||||
</view>
|
||||
<!-- 分类管理 -->
|
||||
<view class="flex padding-lr padding-tb" @click="goNavs(list[3].url)">
|
||||
<image :src="list[3].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[3].title}}</view>
|
||||
<image src="../../static/images/my/right.png" class="images" mode=""></image>
|
||||
</view>
|
||||
<!-- 规格管理 -->
|
||||
<view class="flex padding-lr padding-tb" @click="goNavs(list[4].url)">
|
||||
<image :src="list[4].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[4].title}}</view>
|
||||
<image src="../../static/images/my/right.png" class="images" mode=""></image>
|
||||
</view>
|
||||
<!-- 保证金 -->
|
||||
<view class="flex padding-lr padding-tb" @click="goNav(list[5].url)" v-if="XCXIsSelect != '否'">
|
||||
<image :src="list[5].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[5].title}}</view>
|
||||
<image src="../../static/images/my/right.png" class="images" mode=""></image>
|
||||
</view>
|
||||
<!-- 规格管理 -->
|
||||
<view class="flex padding-lr padding-tb" @click="goNavs(list[13].url)">
|
||||
<image :src="list[13].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[13].title}}</view>
|
||||
<image src="../../static/images/my/right.png" class="images" mode=""></image>
|
||||
</view>
|
||||
<!-- 精选活动 -->
|
||||
<view class="flex padding-lr padding-tb" @click="goNavs(list[14].url)">
|
||||
<image :src="list[14].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[14].title}}</view>
|
||||
<image src="../../static/images/my/right.png" class="images" mode=""></image>
|
||||
</view>
|
||||
<!-- 优惠券管理 -->
|
||||
<view class="flex padding-lr padding-tb" @click="goNavs(list[15].url)">
|
||||
<image :src="list[15].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[15].title}}</view>
|
||||
<image src="../../static/images/my/right.png" class="images" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="bg margin-top-sm">
|
||||
<!-- 聊天中心 -->
|
||||
<view class="flex padding-lr padding-tb dfs" @click="goNav(list[12].url)">
|
||||
<image :src="list[12].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[12].title}}</view>
|
||||
<view class="flex align-center">
|
||||
<view v-if="messageCount" class="bott">{{messageCount}}</view>
|
||||
<image src="../../static/images/my/right.png" class="images" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 联系客服 -->
|
||||
<view class="flex padding-lr padding-tb dfs" @click="goNav(list[6].url)">
|
||||
<image :src="list[6].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[6].title}}</view>
|
||||
<image src="../../static/images/my/right.png" class="images" mode=""></image>
|
||||
</view>
|
||||
<!-- 关于我们 -->
|
||||
<!-- <view class="flex padding-lr padding-tb dfs" @click="goNav(list[7].url)">
|
||||
<image :src="list[7].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[7].title}}</view>
|
||||
<image src="../../static/images/my/right.png" class="images" mode=""></image>
|
||||
</view> -->
|
||||
<!-- 意见反馈 -->
|
||||
<view class="flex padding-lr padding-tb dfs" @click="goNav(list[8].url)" v-if="XCXIsSelect != '否'">
|
||||
<image :src="list[8].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[8].title}}</view>
|
||||
<image src="../../static/images/my/right.png" class="images" mode=""></image>
|
||||
</view>
|
||||
<!-- 我的投诉 -->
|
||||
<view class="flex padding-lr padding-tb dfs" @click="goNav(list[9].url)">
|
||||
<image :src="list[9].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[9].title}}</view>
|
||||
<image src="../../static/images/my/right.png" class="images" mode=""></image>
|
||||
</view>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="flex padding-lr padding-tb dfs" @click="gouser()">
|
||||
<image :src="list[10].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[10].title}}</view>
|
||||
<image src="../../static/images/my/right.png" class="images" mode=""></image>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- 系统设置 -->
|
||||
<view class="flex padding-lr padding-tb dfs" @click="goset()">
|
||||
<image :src="list[11].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[11].title}}</view>
|
||||
<image src="../../static/images/my/right.png" class="images" mode=""></image>
|
||||
</view>
|
||||
|
||||
<!-- 退出登录 -->
|
||||
<!-- <view class="flex padding-lr padding-tb dfs" @click="TuiLogin()" v-if="!isLogin">
|
||||
<image :src="list[10].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
||||
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[10].title}}</view>
|
||||
<image src="../../static/images/my/right.png" class="images" mode=""></image>
|
||||
</view> -->
|
||||
</view>
|
||||
<u-popup v-model="show" mode="center" border-radius="14" width="500rpx" height="500rpx" :closeable="closeable">
|
||||
<view style="width: 180px;height: 180px;margin: 40px auto;">
|
||||
<image :src="shopQrImg" style="width: 100%;height: 100%;" @click="previewImage"></image>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
shopCover: '../../static/logo.png',
|
||||
isLogin: true,
|
||||
shopName: '匿名',
|
||||
sumMoney: 0, //累计余额
|
||||
dayMoney: 0, //今日收益
|
||||
monthMoney: 0, //本月预估收益
|
||||
cashMoney: 0, // 本月预估提现
|
||||
shopToken: '',
|
||||
isVip: false,
|
||||
invitationCode: '', //邀请码
|
||||
list: [{
|
||||
image: '../../static/images/my/dianpu.png',
|
||||
title: '店铺管理',
|
||||
url: '/my/store/index'
|
||||
}, {
|
||||
image: '../../static/images/my/shangpin.png',
|
||||
title: '商品管理',
|
||||
url: '/my/store/addgood'
|
||||
}, {
|
||||
image: '../../static/images/my/order.png',
|
||||
title: '订单管理',
|
||||
url: '/pages/order/index'
|
||||
}, {
|
||||
image: '../../static/images/my/fenlei.png',
|
||||
title: '分类管理',
|
||||
url: '/my/store/fenlei'
|
||||
}, {
|
||||
image: '../../static/images/my/guige.png',
|
||||
title: '规格管理',
|
||||
url: '/my/store/guige'
|
||||
}, {
|
||||
image: '../../static/images/my/baozhengjin.png',
|
||||
title: '保证金',
|
||||
url: '/my/other/money'
|
||||
}, {
|
||||
image: '../../static/images/my/kefu.png',
|
||||
title: '联系客服',
|
||||
url: '/pages/my/chat'
|
||||
}, {
|
||||
image: '../../static/images/my/guanyu.png',
|
||||
title: '关于我们',
|
||||
url: '/my/other/about'
|
||||
}, {
|
||||
image: '../../static/images/my/yijian.png',
|
||||
title: '意见反馈',
|
||||
url: '/my/feedback/index'
|
||||
}, {
|
||||
image: '../../static/images/my/00.png',
|
||||
title: '我的投诉',
|
||||
url: '/my/other/tousu'
|
||||
}, {
|
||||
image: '../../static/images/my/user.png',
|
||||
title: '前往用户端',
|
||||
url: ''
|
||||
}, {
|
||||
image: '../../static/images/my/set1.png',
|
||||
title: '系统设置',
|
||||
url: '/my/other/set'
|
||||
}, {
|
||||
image: '../../static/images/my/liaotian.png',
|
||||
title: '聊天中心',
|
||||
url: '/pages/my/liaotian'
|
||||
}, {
|
||||
image: '../../static/images/order/pinglun.png',
|
||||
title: '店铺评价',
|
||||
url: '/my/store/pingjia'
|
||||
}, {
|
||||
image: '../../static/images/order/hd.png',
|
||||
title: '精选活动',
|
||||
url: '/my/store/huodong'
|
||||
}, {
|
||||
image: '../../static/images/order/yhq.png',
|
||||
title: '优惠券管理',
|
||||
url: '/my/yhq/yhq'
|
||||
}],
|
||||
renzheng: 0,
|
||||
XCXIsSelect: '是',
|
||||
isCashDeposit: '',
|
||||
show: false,
|
||||
shopQrImg: '',
|
||||
closeable: true,
|
||||
open: true,
|
||||
arr:[],
|
||||
messageCount: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// this.messageCount = uni.getStorageSync('messageCount')
|
||||
this.XCXIsSelect = this.$queue.getData("XCXIsSelect");
|
||||
this.shopToken = uni.getStorageSync('shopToken') ? uni.getStorageSync('shopToken') : ''
|
||||
this.userId = uni.getStorageSync('userId')
|
||||
this.open = uni.getStorageSync('open')
|
||||
this.$Request.getT('/app/common/type/354').then(res => { //订单取消通知
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.arr.push(res.data.value)
|
||||
}
|
||||
}
|
||||
})
|
||||
this.$Request.getT('/app/common/type/353').then(res => { //订单取消通知
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.arr.push(res.data.value)
|
||||
}
|
||||
}
|
||||
})
|
||||
this.$Request.getT('/app/common/type/352').then(res => { //新订单通知
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.arr.push(res.data.value)
|
||||
}
|
||||
}
|
||||
})
|
||||
// let that= this
|
||||
// if (this.open = true) {
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '请先去完善店铺信息,上线店铺后同城外卖用户端首页展示您的店铺。',
|
||||
// success: function(res) {
|
||||
// if (res.confirm) {
|
||||
// console.log('用户点击确定');
|
||||
// that.open = false
|
||||
// that.$queue.setData("open", that.open);
|
||||
// } else if (res.cancel) {
|
||||
// console.log('用户点击取消');
|
||||
// that.open = false
|
||||
// that.$queue.setData("open", that.open);
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
},
|
||||
onShow() {
|
||||
this.shopToken = uni.getStorageSync('shopToken') ? uni.getStorageSync('shopToken') : ''
|
||||
if (this.shopToken) {
|
||||
this.messageCount = uni.getStorageSync('messageCount')
|
||||
this.isLogin = false
|
||||
this.getUserInfo()
|
||||
this.getshanghuinfo()
|
||||
this.getAmount()
|
||||
} else {
|
||||
this.isLogin = true
|
||||
this.shopName = '匿名'
|
||||
this.shopCover = '../../static/logo.png'
|
||||
this.sumMoney = 0 //累计余额
|
||||
this.dayMoney = 0 //今日收益
|
||||
this.monthMoney = 0 //本月收益
|
||||
this.cashMoney = 0 //本月提现
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
previewImage() {
|
||||
var arr = [];
|
||||
arr.push(this.shopQrImg);
|
||||
//uniapp预览轮播图方法
|
||||
uni.previewImage({
|
||||
current: 0, //预览图片的下标
|
||||
urls: arr //预览图片的地址,必须要数组形式
|
||||
})
|
||||
},
|
||||
//跳转设置
|
||||
goset() {
|
||||
uni.navigateTo({
|
||||
url: '/my/other/set'
|
||||
})
|
||||
},
|
||||
//生成二维码
|
||||
shopQr() {
|
||||
// uni.showLoading({
|
||||
// title: '二维码生成中',
|
||||
// duration: 1000,
|
||||
// icon: 'none'
|
||||
// });
|
||||
this.show = true
|
||||
|
||||
this.shopQrImg = 'https://tcwm.xianmaxiong.com/sqx_fast/invite/shopQr?shopId=' + uni.getStorageSync(
|
||||
'shopId')
|
||||
},
|
||||
//跳转用户端
|
||||
gouser() {
|
||||
wx.navigateToMiniProgram({
|
||||
appId: 'wxd6a3bf45c999d9cd',
|
||||
path: '/pages/index/index',
|
||||
envVersion: 'release', // 打开正式版
|
||||
success(res) {
|
||||
// 打开成功
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
},
|
||||
goQian() {
|
||||
if (this.shopToken) {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (uni.getStorageSync('sendindexMsg')) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: this.arr,
|
||||
success(re) {
|
||||
// console.log(re,'**********')
|
||||
var datas = JSON.stringify(re);
|
||||
if (datas.indexOf("accept") != -1) {
|
||||
console.log(re)
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
uni.navigateTo({
|
||||
url: '/my/other/wallet'
|
||||
})
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未登录,请先登录',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/loginphone'
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
bindFb() {
|
||||
let renzheng = uni.getStorageSync('renzheng')
|
||||
console.log(this.userId, renzheng)
|
||||
|
||||
if (this.shopToken) {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (uni.getStorageSync('sendindexMsg')) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: this.arr,
|
||||
success(re) {
|
||||
// console.log(re,'**********')
|
||||
var datas = JSON.stringify(re);
|
||||
if (datas.indexOf("accept") != -1) {
|
||||
console.log(re)
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
uni.navigateTo({
|
||||
url: '/my/publish/editor'
|
||||
})
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未登录,请先登录',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/loginphone'
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
goOrder() {
|
||||
uni.switchTab({
|
||||
url: '/pages/order/index'
|
||||
})
|
||||
},
|
||||
//列表跳转
|
||||
goNav(e, name) {
|
||||
console.log(e)
|
||||
if (this.shopToken) {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (uni.getStorageSync('sendindexMsg')) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: this.arr,
|
||||
success(re) {
|
||||
// console.log(re,'**********')
|
||||
var datas = JSON.stringify(re);
|
||||
if (datas.indexOf("accept") != -1) {
|
||||
console.log(re)
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
uni.navigateTo({
|
||||
url: e
|
||||
})
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未登录,请先登录',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/loginphone'
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
//列表跳转
|
||||
goNavs(e, name) {
|
||||
console.log(e)
|
||||
let cashDeposit = uni.getStorageSync("cashDeposit")
|
||||
if (this.shopToken) {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (uni.getStorageSync('sendindexMsg')) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: this.arr,
|
||||
success(re) {
|
||||
// console.log(re,'**********')
|
||||
var datas = JSON.stringify(re);
|
||||
if (datas.indexOf("accept") != -1) {
|
||||
console.log(re)
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
if (cashDeposit == 0 || cashDeposit == 'null') {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未缴纳保证金,请先去缴纳保证金',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
uni.navigateTo({
|
||||
url: '/my/other/money'
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: e
|
||||
})
|
||||
}
|
||||
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未登录,请先登录',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/loginphone'
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
goLogin(e) {
|
||||
uni.navigateTo({
|
||||
url: e
|
||||
})
|
||||
},
|
||||
//我的收益
|
||||
getAmount() {
|
||||
let data = {
|
||||
shopId: uni.getStorageSync('shopId')
|
||||
}
|
||||
this.$Request.get("/app/shop/shopEarnings", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.sumMoney = parseFloat(res.data.shopAllEarnings).toFixed(2) //累计余额
|
||||
this.dayMoney = parseFloat(res.data.shopEarningsDay).toFixed(2) //今日收益
|
||||
this.monthMoney = parseFloat(res.data.shopEarningsMonth).toFixed(2) //本月收益
|
||||
this.cashMoney = parseFloat(res.data.cashMoney).toFixed(2) //本月提现
|
||||
}
|
||||
});
|
||||
},
|
||||
getshanghuinfo() {
|
||||
let data = {
|
||||
shopId: uni.getStorageSync('shopId')
|
||||
}
|
||||
this.$Request.get("/app/shop/selectShopMessage", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.setStorageSync('cashDeposit', res.data.cashDeposit)
|
||||
}
|
||||
});
|
||||
},
|
||||
selectShop(e) {
|
||||
this.shop = e
|
||||
this.show = false
|
||||
|
||||
},
|
||||
|
||||
goNav(url) {
|
||||
if (this.shopToken) {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (uni.getStorageSync('sendindexMsg')) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: this.arr,
|
||||
success(re) {
|
||||
// console.log(re,'**********')
|
||||
var datas = JSON.stringify(re);
|
||||
if (datas.indexOf("accept") != -1) {
|
||||
console.log(re)
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/loginphone'
|
||||
})
|
||||
}
|
||||
},
|
||||
getUserInfo() {
|
||||
this.$Request.getA("/sys/user/info").then(res => {
|
||||
if (res.code == 0) {
|
||||
this.shopName = res.user.shopList[0].shopName
|
||||
this.shopCover = res.user.shopList[0].shopCover ? res.user.shopList[0].shopCover :
|
||||
'../../static/logo.png'
|
||||
this.$queue.setData('avatar',res.user.shopList[0].shopCover);
|
||||
this.$queue.setData("userId", res.user.userId);
|
||||
this.$queue.setData("shopId", res.user.shopList[0].shopId);
|
||||
this.$queue.setData("mobile", res.user.mobile);
|
||||
this.$queue.setData("shopUserName", res.user.shopList[0].shopName);
|
||||
if (res.user.userEntity) {
|
||||
this.$queue.setData("zhiFuBao", res.user.userEntity.zhiFuBao);
|
||||
this.$queue.setData("zhiFuBaoName", res.user.userEntity.zhiFuBaoName);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #F2F2F2;
|
||||
}
|
||||
|
||||
.bg {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.camera {
|
||||
width: 54px;
|
||||
height: 44px;
|
||||
|
||||
&:active {
|
||||
background-color: #ededed;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-bg {
|
||||
width: 64px;
|
||||
height: 28px;
|
||||
background: linear-gradient(90deg, #CDA26E 0%, #DCB78A 100%);
|
||||
border-radius: 28px;
|
||||
text-align: center;
|
||||
line-height: 28px;
|
||||
margin-top: 4px;
|
||||
color: '#604320'
|
||||
}
|
||||
|
||||
.images {
|
||||
width: 18rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
|
||||
.dfs {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.moneybox {
|
||||
width: 690upx;
|
||||
margin: 0 auto;
|
||||
// height: 369upx;
|
||||
// background: #2FB57A;
|
||||
border-radius: 20upx 20upx 20upx 20upx;
|
||||
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 160upx;
|
||||
height: 60upx;
|
||||
background: linear-gradient(90deg, #3D3734 0%, #252323 100%);
|
||||
border-radius: 50upx;
|
||||
text-align: center;
|
||||
line-height: 60upx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.xflist {
|
||||
width: 150upx;
|
||||
height: 50upx;
|
||||
background: #211D2C;
|
||||
color: #FFFFFF;
|
||||
border-radius: 5upx;
|
||||
text-align: center;
|
||||
line-height: 50upx;
|
||||
}
|
||||
|
||||
.erweima {
|
||||
background: #FCD202;
|
||||
padding: 5px 10px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.bott {
|
||||
background: red;
|
||||
color: #ffffff;
|
||||
width: 30upx;
|
||||
height: 30upx;
|
||||
text-align: center;
|
||||
line-height: 26upx;
|
||||
padding: 5rpx;
|
||||
border-radius: 60%;
|
||||
font-size: 23rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
</style>
|
||||
201
pages/my/liaotian.vue
Normal file
201
pages/my/liaotian.vue
Normal file
@@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<!-- <view v-if="msgList.length" class="margin-topW">
|
||||
<view class="flex padding-tb radius padding-lr-sm bg" @click="goMsg" v-for="(item,index) in msgList"
|
||||
:key='index'>
|
||||
<view>
|
||||
<image style="width: 80rpx;height: 80rpx;border-radius: 80rpx;"
|
||||
src="../../static/images/msg/msg.png"></image>
|
||||
</view>
|
||||
<view class="flex-sub margin-left-sm">
|
||||
<view class="flex justify-between">
|
||||
<view class="text-white">{{item.title?item.title: '系统消息'}}</view>
|
||||
<view v-if="messageCount>0"
|
||||
style="height: 32rpx;width: 32rpx;border-radius: 100rpx;background-color: red;color: #FFF;text-align: center;">
|
||||
{{messageCount}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="text-grey">{{item.content}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view v-if="chatList.length" class="content ">
|
||||
<view class="radius padding-lr-sm bg" style="margin-top: 4rpx;" @click="goIM(item)"
|
||||
v-for="(item,index) in chatList" :key='index' >
|
||||
<view class="flex padding-tb " v-if="userId == item.userId">
|
||||
<view>
|
||||
<u-image shape="circle" width='80rpx' height="80rpx" :src="item.shopCover"></u-image>
|
||||
</view>
|
||||
<view class="flex-sub margin-left-sm">
|
||||
<view class="flex justify-between">
|
||||
<view style="width: 50%;">{{item.shopName}}</view>
|
||||
<view class="text-grey">{{item.createTime}}</view>
|
||||
</view>
|
||||
<view class="flex justify-between">
|
||||
<view class="text-grey">{{ item.messageType == 1? item.content : '[图片]'}}</view>
|
||||
<view v-if="item.shopUnread"
|
||||
style="height: 32rpx;width: 32rpx;border-radius: 100rpx;background-color: red;color: #FFF;text-align: center;">
|
||||
{{item.shopUnread}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex padding-tb" v-else>
|
||||
<view>
|
||||
<u-image shape="circle" width='80rpx' height="80rpx" :src="item.shopCover"></u-image>
|
||||
</view>
|
||||
<view class="flex-sub margin-left-sm">
|
||||
<view class="flex justify-between">
|
||||
<view style="width: 50%;">{{item.shopName}}</view>
|
||||
<view class="text-grey">{{item.createTime}}</view>
|
||||
</view>
|
||||
<view class="flex justify-between">
|
||||
<view class="text-grey">{{ item.messageType == 1? item.content : '[图片]'}}</view>
|
||||
<view v-if="item.shopUnread"
|
||||
style="height: 32rpx;width: 32rpx;border-radius: 100rpx;background-color: red;color: #FFF;text-align: center;">
|
||||
{{item.shopUnread}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<empty v-if="!chatList.length && !msgList.length" content='暂无消息'></empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '../../components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
chatList: [],
|
||||
userId: '',
|
||||
msgList: [],
|
||||
time: '',
|
||||
count: 0,
|
||||
messageCount: 0
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getChatList()
|
||||
let that = this
|
||||
that.userId = uni.getStorageSync('userId')
|
||||
if (that.userId) {
|
||||
that.time = setInterval(function() {
|
||||
that.getChatList()
|
||||
// that.getMsgList()
|
||||
that.$nextTick(function() {
|
||||
that.messageCount = uni.getStorageSync('messageCount')
|
||||
})
|
||||
|
||||
}, 10000)
|
||||
|
||||
} else {
|
||||
that.chatList = []
|
||||
that.msgList = []
|
||||
}
|
||||
|
||||
},
|
||||
onShow() {
|
||||
let that = this
|
||||
that.page = 1;
|
||||
// that.chatList = []
|
||||
// that.msgList = []
|
||||
that.getChatList();
|
||||
// let that = this
|
||||
// that.userId = uni.getStorageSync('userId')
|
||||
// if (that.userId) {
|
||||
// that.time = setInterval(function() {
|
||||
// that.getChatList()
|
||||
// // that.getMsgList()
|
||||
// that.$nextTick(function() {
|
||||
// that.messageCount = uni.getStorageSync('messageCount')
|
||||
// })
|
||||
|
||||
// }, 10000)
|
||||
|
||||
// } else {
|
||||
// that.chatList = []
|
||||
// that.msgList = []
|
||||
// }
|
||||
},
|
||||
onHide() {
|
||||
clearInterval(this.time)
|
||||
},
|
||||
methods: {
|
||||
getChatList() {
|
||||
this.$Request.get("/shop/ordersChat/selectOrdersChatPageShop", {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
shopId: uni.getStorageSync('shopId')
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (this.page == 1) {
|
||||
this.chatList = [];
|
||||
}
|
||||
res.data.list.forEach(d => {
|
||||
this.chatList.push(d);
|
||||
});
|
||||
this.count = res.data.totalCount;
|
||||
|
||||
// this.chatList = res.data.list
|
||||
}
|
||||
});
|
||||
},
|
||||
// getMsgList() {
|
||||
// this.$Request.get("/app/message/selectMessageByUserIdLimit1").then(res => {
|
||||
// if (res.code == 0) {
|
||||
// this.msgList = res.data.list
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
goIM(e) {
|
||||
let userId = this.$queue.getData('userId');
|
||||
if (e.userId == userId) {
|
||||
userId = e.byUserId
|
||||
} else {
|
||||
userId = e.userId
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/im?orderId=' + e.ordersId
|
||||
})
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/msg/im?chatConversationId=' + e.chatConversationId + '&byUserId=' + userId
|
||||
// })
|
||||
},
|
||||
goMsg() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/msg/message'
|
||||
})
|
||||
}
|
||||
},
|
||||
onReachBottom: function() {
|
||||
if (this.chatList.length == this.count) {
|
||||
uni.showToast({
|
||||
title: '已经到底了',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.page = this.page + 1;
|
||||
this.getChatList();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #F7F7F7;
|
||||
}
|
||||
|
||||
.bg {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
</style>
|
||||
407
pages/my/loginphone.vue
Normal file
407
pages/my/loginphone.vue
Normal file
@@ -0,0 +1,407 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="wrapper">
|
||||
<view style="padding-left:60upx;" class="margin-tb-lg">
|
||||
<view style="color:#333333;font-size:42upx;">商户登录体验更多功能</view>
|
||||
<view style="color:#999999" class="text-sm margin-top-xs">未入驻过的请先申请入驻账号</view>
|
||||
</view>
|
||||
|
||||
<view class="input-content">
|
||||
<view class="cu-form-group margin-top" style="border-bottom: 1px solid #E6E6E6;">
|
||||
<!-- <view class="title text-black">账号</view> -->
|
||||
<input type="text" :value="phone" placeholder="请输入账号" maxlength="11" data-key="phone"
|
||||
@input="inputChange" />
|
||||
</view>
|
||||
<view class="cu-form-group margin-top" style="border-bottom: 1px solid #E6E6E6;">
|
||||
<!-- <view class="title text-black">密码</view> -->
|
||||
<input type="password" placeholder="请输入密码" maxlength="20" :value="password" data-key="password"
|
||||
@input="inputChange" @confirm="toLogin" />
|
||||
<!-- <text class="send-msg" @click="forget">忘记密码</text> -->
|
||||
</view>
|
||||
|
||||
|
||||
<view class="cu-form-group flex justify-between align-center margin-top"
|
||||
style="border-bottom: 1px solid #E6E6E6;">
|
||||
<view>
|
||||
<!-- <view class="title text-black">验证码</view> -->
|
||||
<input type="text" placeholder="请输入图片验证码" maxlength="20" :value="captcha" data-key="captcha"
|
||||
@input="inputChange" @confirm="toLogin" />
|
||||
</view>
|
||||
<view>
|
||||
<image @click="getCaptcha" :src="captchaPath" style="width:160upx;height:64upx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
<button class="confirm-btn" @click="toLogin">立即登录</button>
|
||||
<view class="flex">
|
||||
<view class="ruzhu" @click="bindchat()">联系客服</view>
|
||||
<!-- <view class="ruzhu" @click="xiupwd()">修改密码</view> -->
|
||||
<view class="ruzhu" @click="show = true" v-if="XCXIsSelect != '否'">商家入驻</view>
|
||||
</view>
|
||||
<!-- <view class="ruzhu" @click="bindRuzhu()">商家入驻</view> -->
|
||||
|
||||
<!-- <view class="ruzhu" @click="show = true">商家入驻</view> -->
|
||||
|
||||
</view>
|
||||
<!---->
|
||||
<!-- 入驻弹框 -->
|
||||
<u-popup v-model="show" mode="center" border-radius="14" width="500rpx" height="350rpx" closeable="true">
|
||||
<view class="padding text-center">
|
||||
<view class="padding-top margin-top-sm text-lg" @click="bindRuzhu()">商家申请入驻</view>
|
||||
<view class="padding-top text-lg" @click="bindRuzhus()">商家信息修改</view>
|
||||
<view class="text-sm text-gray margin-top-xs">申请入驻后修改入驻信息</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import configurl from '../../common/config.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
openId:'',
|
||||
weixinPhone: true,
|
||||
phone: '',
|
||||
password: '',
|
||||
banners: [],
|
||||
invitation: '',
|
||||
loginName: '',
|
||||
sending: false,
|
||||
sendTime: '获取验证码',
|
||||
count: 60,
|
||||
captcha: '',
|
||||
captchaPath: '',
|
||||
uuid: '',
|
||||
show: false,
|
||||
open: true,
|
||||
XCXIsSelect: '是',
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getCaptcha()
|
||||
this.XCXIsSelect = this.$queue.getData("XCXIsSelect");
|
||||
},
|
||||
methods: {
|
||||
//登录
|
||||
login() {
|
||||
let that = this;
|
||||
// 1.wx获取登录用户code
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: function(loginRes) {
|
||||
console.log(loginRes, '************')
|
||||
let data = {
|
||||
code: loginRes.code,
|
||||
}
|
||||
that.$Request.get('/app/Login/wxShopLogin', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.hideLoading()
|
||||
that.openId = res.data.open_id;
|
||||
that.xcxtoLogin();
|
||||
// uni.setStorageSync('openId', res.data.open_id)
|
||||
// uni.setStorageSync('unionId', res.data.unionId)
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: res.msg,
|
||||
duration: 2000
|
||||
});
|
||||
console.log(res, '失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
//修改密码
|
||||
xiupwd() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/pwd'
|
||||
})
|
||||
},
|
||||
// 商家入驻引导弹框
|
||||
bindshangjia() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请前往同城外卖用户端【我的-商家入驻】进行入驻,再返回商家登录',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
// #ifdef MP-WEIXIN
|
||||
wx.navigateToMiniProgram({
|
||||
appId: 'wxd6a3bf45c999d9cd',
|
||||
path: '/pages/index/index',
|
||||
envVersion: 'release', // 打开正式版
|
||||
success(res) {
|
||||
// 打开成功
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//联系客服
|
||||
bindchat() {
|
||||
uni.navigateTo({
|
||||
url: '/my/other/customer'
|
||||
})
|
||||
},
|
||||
//申请商户入驻
|
||||
bindRuzhu() {
|
||||
this.show = false;
|
||||
uni.navigateTo({
|
||||
url: '/my/publish/index'
|
||||
})
|
||||
},
|
||||
bindRuzhus() {
|
||||
this.show = false;
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/phoneSettled'
|
||||
})
|
||||
},
|
||||
// 获取验证码
|
||||
getCaptcha() {
|
||||
this.uuid = this.$queue.getUUID()
|
||||
|
||||
// this.captchaPath = this.$http.adornUrl(`/captcha.jpg?uuid=${this.uuid}`)
|
||||
// this.captchaPath = this.$Request.getA('/captcha.jpg?uuid='+this.uuid).then(res => {
|
||||
|
||||
// });
|
||||
console.log(this.uuid)
|
||||
uni.downloadFile({
|
||||
// url: 'https://diancanshop.xianmxkj.com/sqx_fast/captcha.jpg?uuid=' + this.uuid,
|
||||
// url: 'https://tcwm.xianmaxiong.com/sqx_fast/captcha.jpg?uuid=' + this.uuid,
|
||||
url: configurl.APIHOST + '/captcha.jpg?uuid=' + this.uuid,
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
this.captchaPath = res.tempFilePath
|
||||
}
|
||||
})
|
||||
},
|
||||
forget() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/forgetPwd'
|
||||
});
|
||||
},
|
||||
register() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/public/register'
|
||||
});
|
||||
},
|
||||
inputChange(e) {
|
||||
const key = e.currentTarget.dataset.key;
|
||||
this[key] = e.detail.value;
|
||||
},
|
||||
navBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
xcxtoLogin() {
|
||||
let that = this
|
||||
that.$queue.loginClear();
|
||||
let openid = that.$queue.getData("openid");
|
||||
const {
|
||||
phone,
|
||||
password,
|
||||
captcha
|
||||
} = that;
|
||||
if (!phone) {
|
||||
that.$queue.showToast("请输入门店管理员账号");
|
||||
} else if (!password) {
|
||||
that.$queue.showToast("请输入门店管理员密码");
|
||||
} else if (!captcha) {
|
||||
that.$queue.showToast("请输入图片验证码");
|
||||
} else {
|
||||
that.$queue.showLoading("正在登录中...");
|
||||
that.$Request.postJsonA("/sys/login", {
|
||||
password: password,
|
||||
username: phone,
|
||||
captcha: captcha,
|
||||
uuid: that.uuid,
|
||||
openId: that.openId
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
that.$queue.setData("shopToken", res.token);
|
||||
uni.hideLoading()
|
||||
|
||||
setTimeout(function() {
|
||||
that.getUserInfo()
|
||||
}, 10)
|
||||
} else {
|
||||
that.getCaptcha()
|
||||
uni.hideLoading();
|
||||
that.$queue.showToast(res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
toLogin() {
|
||||
let that = this
|
||||
that.$queue.loginClear();
|
||||
let openid = that.$queue.getData("openid");
|
||||
const {
|
||||
phone,
|
||||
password,
|
||||
captcha
|
||||
} = that;
|
||||
if (!phone) {
|
||||
that.$queue.showToast("请输入门店管理员账号");
|
||||
} else if (!password) {
|
||||
that.$queue.showToast("请输入门店管理员密码");
|
||||
} else if (!captcha) {
|
||||
that.$queue.showToast("请输入图片验证码");
|
||||
} else {
|
||||
// #ifdef MP-WEIXIN
|
||||
that.login();
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
that.$queue.showLoading("正在登录中...");
|
||||
that.$Request.postJsonA("/sys/login", {
|
||||
password: password,
|
||||
username: phone,
|
||||
captcha: captcha,
|
||||
uuid: that.uuid,
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
that.$queue.setData("shopToken", res.token);
|
||||
uni.hideLoading()
|
||||
|
||||
setTimeout(function() {
|
||||
that.getUserInfo()
|
||||
}, 10)
|
||||
} else {
|
||||
that.getCaptcha()
|
||||
uni.hideLoading();
|
||||
that.$queue.showToast(res.msg);
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
getUserInfo() {
|
||||
this.$Request.getA("/sys/user/info").then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$queue.setData("userId", res.user.userId);
|
||||
this.$queue.setData("shopId", res.user.shopList[0].shopId);
|
||||
this.$queue.setData("mobile", res.user.mobile);
|
||||
if (res.user.userEntity && res.user.userEntity.openId) {
|
||||
this.$queue.setData("openId", res.user.userEntity.openId);
|
||||
}
|
||||
// #ifdef APP-PLUS
|
||||
if (uni.getSystemInfoSync().platform == 'android') {
|
||||
let clientid = plus.push.getClientInfo().clientid;
|
||||
|
||||
let userId = this.$queue.getData('userId');
|
||||
if (userId) {
|
||||
this.$Request.postT('/user/updateShopClientId?clientId=' + clientid).then(
|
||||
red => {});
|
||||
}
|
||||
}
|
||||
//#endif
|
||||
// uni.navigateBack()
|
||||
// this.$queue.setData("avatar", res.user.avatar);
|
||||
// this.$queue.setData("invitationCode", res.user.invitationCode);
|
||||
this.$queue.setData("open", this.open);
|
||||
uni.switchTab({
|
||||
url: '/pages/my/index'
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
// getIsVip() {
|
||||
// this.$Request.get("/app/UserVip/isUserVip").then(res => {
|
||||
// if (res.code == 0) {
|
||||
// // this.isVip = res.data
|
||||
// console.log(res.data)
|
||||
// this.$queue.setData("isVip", res.data);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
page {
|
||||
height: 100%;
|
||||
background: #FFFFFF !important;
|
||||
}
|
||||
|
||||
.send-msg {
|
||||
border-radius: 30px;
|
||||
/* color: black; */
|
||||
background: white;
|
||||
height: 30px;
|
||||
font-size: 14px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.container {
|
||||
top: 0;
|
||||
padding-top: 32upx;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
/* background: #1E1F31 !important; */
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
position: relative;
|
||||
z-index: 90;
|
||||
/* background: #1E1F31; */
|
||||
padding-bottom: 32upx;
|
||||
}
|
||||
|
||||
|
||||
.input-content {
|
||||
/* margin-top: 300upx; */
|
||||
/* padding-top: 300upx; */
|
||||
padding: 40upx 60upx;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.confirm-btn {
|
||||
width: 600upx;
|
||||
line-height: 88upx;
|
||||
height: 88upx;
|
||||
border-radius: 10upx;
|
||||
margin-top: 32upx;
|
||||
background: #FCD202;
|
||||
/* color: #fff; */
|
||||
font-size: 32upx;
|
||||
|
||||
&:after {
|
||||
border-radius: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.ruzhu {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #999999;
|
||||
margin-top: 20upx;
|
||||
}
|
||||
|
||||
.padding-top {
|
||||
margin: 32upx 0;
|
||||
background: #FCD202;
|
||||
height: 72rpx;
|
||||
/* line-height: 80rpx; */
|
||||
padding: 13rpx 0;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
|
||||
.margin-top-sm {
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
</style>
|
||||
219
pages/my/phoneSettled.vue
Normal file
219
pages/my/phoneSettled.vue
Normal file
@@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="wrapper">
|
||||
<view style="padding-left:60upx;" class="margin-tb-lg">
|
||||
<view style="color:#333333;font-size:42upx;">商户登录体验更多功能</view>
|
||||
<view style="color:#999999" class="text-sm margin-top-xs">商户入驻信息修改,获取已入驻的信息</view>
|
||||
</view>
|
||||
<view class="input-content">
|
||||
<view class="cu-form-group margin-top" style="border-bottom: 1px solid #E6E6E6;">
|
||||
<input type="text" :value="phone" placeholder="请输入入驻提交的手机号码" maxlength="11" data-key="phone"
|
||||
@input="inputChange" />
|
||||
</view>
|
||||
<view class="cu-form-group margin-top" style="border-bottom: 1px solid #E6E6E6;">
|
||||
<input type="number" placeholder="请输入验证码" maxlength="6" v-model="codes" @input="inputChange"
|
||||
@confirm="toLogin" />
|
||||
<button class="send-msg" @click="sendMsg">{{sendTime}}</button>
|
||||
</view>
|
||||
</view>
|
||||
<button class="confirm-btn" @click="toLogin">立即查询</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
phone: '',
|
||||
codes: '',
|
||||
banners: [],
|
||||
invitation: '',
|
||||
loginName: '',
|
||||
sending: false,
|
||||
sendTime: '获取验证码',
|
||||
count: 60,
|
||||
captcha: '',
|
||||
captchaPath: '',
|
||||
uuid: '',
|
||||
show: false
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// this.getCaptcha()
|
||||
},
|
||||
methods: {
|
||||
//申请商户入驻
|
||||
bindRuzhu() {
|
||||
uni.navigateTo({
|
||||
url: '/my/publish/index'
|
||||
})
|
||||
},
|
||||
bindRuzhus() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/phoneSettled'
|
||||
})
|
||||
},
|
||||
// 获取验证码
|
||||
sendMsg() {
|
||||
const {
|
||||
phone
|
||||
} = this;
|
||||
if (!phone) {
|
||||
this.$queue.showToast("请输入手机号");
|
||||
} else if (phone.length !== 11) {
|
||||
this.$queue.showToast("请输入正确的手机号");
|
||||
} else {
|
||||
this.$queue.showLoading("正在发送验证码...");
|
||||
this.$Request.getT("/app/Login/sendMsg/" + phone + "/selectShop").then(res => {
|
||||
if (res.code === 0) {
|
||||
this.sending = true;
|
||||
this.$queue.showToast('验证码发送成功请注意查收');
|
||||
this.countDown();
|
||||
uni.hideLoading();
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
title: '短信发送失败',
|
||||
content: res.msg ? res.msg : '请一分钟后再获取验证码'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
countDown() {
|
||||
const {
|
||||
count
|
||||
} = this;
|
||||
if (count === 1) {
|
||||
this.count = 60;
|
||||
this.sending = false;
|
||||
this.sendTime = '获取验证码'
|
||||
} else {
|
||||
this.count = count - 1;
|
||||
this.sending = true;
|
||||
this.sendTime = count - 1 + '秒后重新获取';
|
||||
setTimeout(this.countDown.bind(this), 1000);
|
||||
}
|
||||
},
|
||||
forget() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/public/forgetPwd'
|
||||
});
|
||||
},
|
||||
register() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/public/register'
|
||||
});
|
||||
},
|
||||
inputChange(e) {
|
||||
const key = e.currentTarget.dataset.key;
|
||||
this[key] = e.detail.value;
|
||||
},
|
||||
navBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
toLogin() {
|
||||
// 获取入驻信息
|
||||
const {
|
||||
phone,
|
||||
codes
|
||||
} = this;
|
||||
console.log(phone, codes)
|
||||
if (!phone) {
|
||||
this.$queue.showToast("请输入手机号");
|
||||
} else if (phone.length !== 11) {
|
||||
this.$queue.showToast("请输入正确的手机号");
|
||||
} else if (!codes) {
|
||||
this.$queue.showToast("请输入六位数验证码");
|
||||
} else {
|
||||
let data = {
|
||||
msg: codes,
|
||||
phone: phone
|
||||
}
|
||||
this.$Request.getA("/admin/goodsShop/selectGoodsShop", data).then(res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
//0待审核 1通过 (你就可以直接弹框提示 您已审核通过,点击跳转登录)类似这种 2拒绝的话 就让他修改信息
|
||||
if (res.data.status == 1) {
|
||||
this.$queue.showToast('您已审核通过,可以直接登录!');
|
||||
} else {
|
||||
uni.setStorageSync("Settedlist", res.data)
|
||||
uni.navigateTo({
|
||||
url: '/my/publish/index'
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$queue.showToast(res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
page {
|
||||
height: 100%;
|
||||
background: #FFFFFF !important;
|
||||
}
|
||||
|
||||
.send-msg {
|
||||
border-radius: 30px;
|
||||
/* color: #FFFFFF; */
|
||||
background: #FCD202;
|
||||
height: 30px;
|
||||
font-size: 14px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.container {
|
||||
top: 0;
|
||||
padding-top: 32upx;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
/* background: #1E1F31 !important; */
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
position: relative;
|
||||
z-index: 90;
|
||||
/* background: #1E1F31; */
|
||||
padding-bottom: 32upx;
|
||||
}
|
||||
|
||||
|
||||
.input-content {
|
||||
/* margin-top: 300upx; */
|
||||
/* padding-top: 300upx; */
|
||||
padding: 40upx 60upx;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.confirm-btn {
|
||||
width: 600upx;
|
||||
line-height: 88upx;
|
||||
height: 88upx;
|
||||
border-radius: 10upx;
|
||||
margin-top: 32upx;
|
||||
background: #FCD202;
|
||||
/* color: #fff; */
|
||||
font-size: 32upx;
|
||||
|
||||
&:after {
|
||||
border-radius: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.ruzhu {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #999999;
|
||||
margin-top: 20upx;
|
||||
}
|
||||
</style>
|
||||
196
pages/my/pwd.vue
Normal file
196
pages/my/pwd.vue
Normal file
@@ -0,0 +1,196 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="wrapper">
|
||||
<view class="input-content">
|
||||
<!-- <view class="cu-form-group" style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
|
||||
<text class="title">旧密码</text>
|
||||
<input type="password" :value="oldPwd" placeholder="请输入旧密码" placeholder-class="input-empty" maxlength="20"
|
||||
minlength="6" data-key="oldpassword" @input="inputChange" @confirm="toLogin" />
|
||||
</view> -->
|
||||
<view class="cu-form-group"
|
||||
style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
|
||||
<text class="title">新密码</text>
|
||||
<input type="password" :value="pwd" placeholder="请设置新密码" placeholder-class="input-empty"
|
||||
maxlength="6" minlength="6" data-key="password" @input="inputChange" />
|
||||
</view>
|
||||
<view class="cu-form-group"
|
||||
style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
|
||||
<text class="title">确认密码</text>
|
||||
<input type="password" :value="newpwd" placeholder="请设置新密码" placeholder-class="input-empty"
|
||||
maxlength="6" minlength="6" data-key="password" @input="inputChanges" />
|
||||
</view>
|
||||
</view>
|
||||
<button class="confirm-btn" @click="toLogin">修改密码</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
code: '',
|
||||
phone: '',
|
||||
password: '',
|
||||
oldpassword: '',
|
||||
sending: false,
|
||||
sendTime: '获取验证码',
|
||||
count: 60,
|
||||
logining: false,
|
||||
oldPwd: '',
|
||||
pwd: '',
|
||||
newpwd: '',
|
||||
username: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getUserInfo()
|
||||
},
|
||||
methods: {
|
||||
getUserInfo() {
|
||||
this.$Request.getA("/sys/user/info").then(res => {
|
||||
if (res.code == 0) {
|
||||
this.phone = res.user.mobile
|
||||
this.salt = res.user.salt
|
||||
this.username = res.user.username
|
||||
}
|
||||
});
|
||||
},
|
||||
sendMsg() {
|
||||
const {
|
||||
phone
|
||||
} = this;
|
||||
if (!phone) {
|
||||
this.$queue.showToast("请输入手机号");
|
||||
} else if (phone.length !== 11) {
|
||||
this.$queue.showToast("请输入正确的手机号");
|
||||
} else {
|
||||
this.$queue.showLoading("正在发送验证码...");
|
||||
this.$Request.getT('/appLogin/sendMsg/' + phone + '/forget').then(res => {
|
||||
if (res.code === 0) {
|
||||
this.sending = true;
|
||||
this.$queue.showToast('验证码发送成功请注意查收');
|
||||
this.countDown();
|
||||
uni.hideLoading();
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
title: '短信发送失败',
|
||||
content: res.msg ? res.msg : '请一分钟后再获取验证码'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
countDown() {
|
||||
const {
|
||||
count
|
||||
} = this;
|
||||
if (count === 1) {
|
||||
this.count = 60;
|
||||
this.sending = false;
|
||||
this.sendTime = '获取验证码'
|
||||
} else {
|
||||
this.count = count - 1;
|
||||
this.sending = true;
|
||||
this.sendTime = count - 1 + '秒后重新获取';
|
||||
setTimeout(this.countDown.bind(this), 1000);
|
||||
}
|
||||
},
|
||||
inputChange(e) {
|
||||
// console.log(e, '----------')
|
||||
const key = e.currentTarget.dataset.key;
|
||||
this.pwd = e.detail.value;
|
||||
},
|
||||
inputChanges(e) {
|
||||
// console.log(e, '----------')
|
||||
const key = e.currentTarget.dataset.key;
|
||||
this.newpwd = e.detail.value;
|
||||
},
|
||||
navBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
|
||||
toLogin() {
|
||||
console.log(this.pwd.length)
|
||||
if (this.pwd.length != 6) {
|
||||
this.$queue.showToast("请输入六位数密码");
|
||||
} else if (this.newpwd.length != 6) {
|
||||
this.$queue.showToast("请再次输入六位数密码");
|
||||
} else if (this.pwd != this.newpwd) {
|
||||
this.$queue.showToast("密码不一致");
|
||||
} else {
|
||||
this.logining = true;
|
||||
this.$queue.showLoading("正在修改密码中...");
|
||||
let data = {
|
||||
mobile: this.phone,
|
||||
password: this.pwd,
|
||||
salt: this.salt,
|
||||
username: this.username
|
||||
}
|
||||
this.$Request.postJson("/sys/user/updateShop", data).then(res => {
|
||||
uni.hideLoading();
|
||||
if (res.code === 0) {
|
||||
this.$queue.showToast('密码修改成功!下次请使用新密码登录!')
|
||||
setTimeout(function() {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
} else {
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
title: '密码修改失败',
|
||||
content: res.msg,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
page {
|
||||
height: 100%;
|
||||
background: #FFFFFF !important;
|
||||
}
|
||||
|
||||
.container {
|
||||
/* padding-top: 32upx; */
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: #FFFFFF !important;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
position: relative;
|
||||
z-index: 90;
|
||||
background: #ffffff;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
|
||||
.input-content {
|
||||
padding: 32upx 80upx;
|
||||
}
|
||||
|
||||
|
||||
.confirm-btn {
|
||||
width: 600upx;
|
||||
height: 80upx;
|
||||
line-height: 80upx;
|
||||
border-radius: 60upx;
|
||||
margin-top: 32upx;
|
||||
background: #FCD202;
|
||||
/* color: #fff; */
|
||||
font-size: 32upx;
|
||||
|
||||
&:after {
|
||||
border-radius: 60px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
308
pages/my/userinfo.vue
Normal file
308
pages/my/userinfo.vue
Normal file
@@ -0,0 +1,308 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="usermain">
|
||||
<view class="usermain-item ">
|
||||
<view>头像</view>
|
||||
<view @click="uploadImg()">
|
||||
<image src="../../static/logo.png" v-if="avatar==null" mode=""
|
||||
style="width: 111rpx;height: 111rpx;border-radius: 50%;"></image>
|
||||
<image v-else :src="avatar" mode="" style="width: 111rpx;height: 111rpx;border-radius: 50%;">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="usermain-item item-padding ">
|
||||
<view>用户名</view>
|
||||
<view>
|
||||
<view class="cu-form-group">
|
||||
<input v-model="userName" placeholder="请输入用户名" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="usermain-item item-padding ">
|
||||
<view>年龄</view>
|
||||
<view>
|
||||
<view class="cu-form-group">
|
||||
<input v-model="age" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="usermain-item item-padding">
|
||||
<view >姓名</view>
|
||||
<view class="cu-form-group">
|
||||
<input v-model="realName" placeholder="请填写您的真实姓名" />
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="usermain-item item-padding ">
|
||||
<view>手机</view>
|
||||
<view>
|
||||
<view class="cu-form-group">
|
||||
<input v-model="phone" placeholder="请输入联系电话" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="usermain-item item-padding ">
|
||||
<view>性别</view>
|
||||
<view>
|
||||
<view class="cu-form-group">
|
||||
<u-radio-group v-model="sex">
|
||||
<u-radio shape="circle" active-color="#2FB57A" :name="1" >男</u-radio>
|
||||
<u-radio shape="circle" active-color="#2FB57A" :name="2" >女</u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer-btn">
|
||||
<view class="usermain-btn" @click="messagebtn()">保存</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import configdata from '../../common/config.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
phone: '',
|
||||
avatar: '../../static/logo.png',
|
||||
userName: '',
|
||||
nickName: '',
|
||||
userId: '',
|
||||
realName: '',
|
||||
weChatId: "",
|
||||
password: '',
|
||||
platform: '',
|
||||
createTime: '',
|
||||
money: '',
|
||||
jiFen: '',
|
||||
status: '',
|
||||
zhiFuBao: '',
|
||||
zhiFuBaoName: '',
|
||||
sex:1,
|
||||
age: 0
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
this.getUserInfo()
|
||||
// this.avatar = uni.getStorageSync('avatar')
|
||||
},
|
||||
methods: {
|
||||
goMyAddress() {
|
||||
uni.navigateTo({
|
||||
url: '../jifen/myaddress'
|
||||
});
|
||||
},
|
||||
uploadImg() {
|
||||
let token = uni.getStorageSync('token')
|
||||
|
||||
if (!token) {
|
||||
this.goLoginInfo();
|
||||
return;
|
||||
}
|
||||
let that = this;
|
||||
var url = null;
|
||||
uni.showActionSheet({
|
||||
// itemList按钮的文字接受的是数组
|
||||
itemList: ["查看头像", "从相册选择图片"],
|
||||
success(e) {
|
||||
var index = e.tapIndex
|
||||
if (index === 0) {
|
||||
// 用户点击了预览当前图片
|
||||
// 可以自己实现当前头像链接的读取
|
||||
let url = that.avatar;
|
||||
let arr = []
|
||||
arr.push(url)
|
||||
uni.previewImage({
|
||||
// 预览功能图片也必须是数组的
|
||||
urls: arr
|
||||
})
|
||||
} else if (index === 1) {
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: function(res) {
|
||||
uni.showLoading({
|
||||
title: '上传中...'
|
||||
});
|
||||
let token = uni.getStorageSync('token');
|
||||
let userId = uni.getStorageSync('userId');
|
||||
uni.uploadFile({
|
||||
url: that.config("APIHOST1") + '/alioss/upload', //真实的接口地址
|
||||
|
||||
filePath: res.tempFilePaths[0],
|
||||
header: {
|
||||
token: token
|
||||
},
|
||||
name: 'file',
|
||||
success: uploadFileRes => {
|
||||
url = JSON.parse(uploadFileRes.data);
|
||||
that.avatar = url.data
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
config: function(name) {
|
||||
var info = null;
|
||||
if (name) {
|
||||
var name2 = name.split("."); //字符分割
|
||||
if (name2.length > 1) {
|
||||
info = configdata[name2[0]][name2[1]] || null;
|
||||
} else {
|
||||
info = configdata[name] || null;
|
||||
}
|
||||
if (info == null) {
|
||||
let web_config = cache.get("web_config");
|
||||
if (web_config) {
|
||||
if (name2.length > 1) {
|
||||
info = web_config[name2[0]][name2[1]] || null;
|
||||
} else {
|
||||
info = web_config[name] || null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return info;
|
||||
},
|
||||
getUserInfo() {
|
||||
// let userId = uni.getStorageSync('userId')
|
||||
this.$Request.get("/sys/user/info").then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$queue.setData('avatar', res.user.userEntity.avatar);
|
||||
this.$queue.setData('userId', res.user.userId);
|
||||
this.$queue.setData('userName', res.user.userEntity.userName);
|
||||
this.$queue.setData('phone', res.user.userEntity.phone);
|
||||
this.$queue.setData('age', res.user.userEntity.age);
|
||||
this.sex = res.user.userEntity.sex
|
||||
this.age = res.user.userEntity.age
|
||||
this.phone = res.user.userEntity.phone;
|
||||
this.avatar = res.user.userEntity.avatar;
|
||||
this.userName = res.user.userEntity.userName;
|
||||
if (this.userName == null) {
|
||||
this.userName = res.user.userEntity.nickName;
|
||||
} else {
|
||||
this.userName = res.user.userEntity.userName;
|
||||
}
|
||||
}
|
||||
uni.hideLoading();
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
// 保存
|
||||
messagebtn() {
|
||||
let that = this
|
||||
if (!that.userName) {
|
||||
// this.$queue.showToast('用户名不能为空');
|
||||
uni.showToast({
|
||||
title: "用户名不能为空",
|
||||
icon: "none"
|
||||
})
|
||||
} else if (!that.phone) {
|
||||
// this.$queue.showToast('用户名不能为空');
|
||||
uni.showToast({
|
||||
title: "联系电话不能为空",
|
||||
icon: "none"
|
||||
})
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '确定保存信息',
|
||||
success: e => {
|
||||
if (e.confirm) {
|
||||
that.$Request.postJson("/shop/shopmoney/updateUser", {
|
||||
userName: that.userName,
|
||||
avatar: that.avatar,
|
||||
phone: that.phone,
|
||||
sex: that.sex,
|
||||
age:that.age
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: "none"
|
||||
})
|
||||
setTimeout(function() {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
// userphone(){
|
||||
// uni.navigateTo({
|
||||
// url:'/pages/my/userphone'
|
||||
// })
|
||||
// }
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
/* background: #1c1b20; */
|
||||
}
|
||||
|
||||
.usermain {
|
||||
background: #ffffff;
|
||||
/* color: #fff; */
|
||||
}
|
||||
|
||||
.usermain-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 0 40rpx;
|
||||
padding: 10rpx 0;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1rpx solid #e5e5e5;
|
||||
/* border-bottom: 2rpx solid #f2f2f2; */
|
||||
}
|
||||
|
||||
.usermain-item.item-padding {
|
||||
/* padding: 0; */
|
||||
}
|
||||
|
||||
.cu-form-group {
|
||||
padding: 0;
|
||||
background: #ffffff;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.cu-form-group input {
|
||||
background: #ffffff;
|
||||
font-size: 28rpx;
|
||||
/* color: #fff; */
|
||||
|
||||
}
|
||||
|
||||
.footer-btn {
|
||||
margin-top: 150rpx;
|
||||
}
|
||||
|
||||
.footer-btn .usermain-btn {
|
||||
/* color: #FFFFFF; */
|
||||
background: #FCD202;
|
||||
text-align: center;
|
||||
width: 450rpx;
|
||||
height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 80rpx;
|
||||
margin: 0 auto;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
</style>
|
||||
816
pages/order/detail.vue
Normal file
816
pages/order/detail.vue
Normal file
@@ -0,0 +1,816 @@
|
||||
<template>
|
||||
<view class="order_details">
|
||||
<!-- 待支付 -->
|
||||
<view class="part_one">
|
||||
<view>
|
||||
<!-- 订单状态 -->
|
||||
<view class="rider_order" v-if="orderDetails.indentState == 0">待付款</view>
|
||||
<view class="rider_order"
|
||||
v-if="orderDetails.indentState == 1||orderDetails.indentState ==8||orderDetails.indentState ==9||orderDetails.indentState ==10">
|
||||
已取消</view>
|
||||
<view class="rider_order" v-if="orderDetails.indentState == 2">待接单</view>
|
||||
<view class="rider_order" v-if="orderDetails.indentState == 5">待确认</view>
|
||||
<view class="rider_order" v-if="orderDetails.indentState == 3">已接单</view>
|
||||
<view class="rider_order" v-if="orderDetails.indentState ==4">派送中</view>
|
||||
<view class="rider_order" v-if="orderDetails.indentState ==6||orderDetails.indentState ==7">已完成
|
||||
</view>
|
||||
<!-- 订单提示状态 -->
|
||||
<view class="rider_tit" v-if="orderDetails.indentState == 2">请耐心等待骑手接单...</view>
|
||||
<view class="rider_tit" v-if="orderDetails.indentState == 0">请及时支付订单,否则将自动取消</view>
|
||||
<view class="rider_tit"
|
||||
v-if="orderDetails.indentState ==5||orderDetails.indentState ==6||orderDetails.indentState ==7">
|
||||
|
||||
<text v-if="orderDetails.evaluateMessage">评价内容:{{orderDetails.evaluateMessage}}</text>
|
||||
<text v-else>写下您的评价感受吧!</text>
|
||||
</view>
|
||||
<view class="rider_tit"
|
||||
v-if="orderDetails.indentState == 1||orderDetails.indentState ==8||orderDetails.indentState ==9||orderDetails.indentState ==10">
|
||||
订单已被您取消</view>
|
||||
<view class="rider_tit" v-if="orderDetails.indentState == 3||orderDetails.indentState ==4">骑手已接单,尽快为您派送
|
||||
</view>
|
||||
|
||||
<!-- 订单按钮状态 -->
|
||||
<view style="display: flex;justify-content: flex-end;margin-top: 16upx;margin-right: 20rpx;">
|
||||
<view class="btn1" @tap.stop="bindcomment(orderDetails)"
|
||||
v-if="orderDetails.indentState ==7||orderDetails.indentState == 6&&!orderDetails.evaluateMessage">
|
||||
去评论
|
||||
</view>
|
||||
<view class="btn1" v-if="orderDetails.indentState == 0||orderDetails.indentState == 2"
|
||||
@tap.stop="bindorderOff(orderDetails)">取消订单</view>
|
||||
<view class="btn1" @tap.stop="bindconfirm(orderDetails)" v-if="orderDetails.indentState == 5">确认订单
|
||||
</view>
|
||||
<view class="btn2" @tap.stop="bindorder(orderDetails)"
|
||||
v-if="orderDetails.indentState == 1||orderDetails.indentState == 3||orderDetails.indentState ==8||
|
||||
orderDetails.indentState ==9||orderDetails.indentState ==10||orderDetails.indentState == 4||orderDetails.indentState == 6">再来一单</view>
|
||||
<view class="btn2" v-if="orderDetails.indentState == 0" @tap.stop="bindorderpay(orderDetails)">立即付款
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 购买时间 -->
|
||||
<view class="five_box" style="padding: 30rpx 30rpx;font-size: 30upx;">
|
||||
<text>预约时间</text>
|
||||
<text style="font-weight: bold;">{{orderDetails.sendOutTime}}</text>
|
||||
</view>
|
||||
|
||||
<map v-if="orderDetails.indentState == 4 && latitude && longitude" id="map" @tap="goMap"
|
||||
style="width: 95%; height: 300rpx;margin: 20rpx auto 0;" :markers="markers" :latitude="latitude"
|
||||
:longitude="longitude"></map>
|
||||
|
||||
<!-- 同城购买-->
|
||||
<view class="part_three" v-if="orderDetails.indentType == 3">
|
||||
<view class="city_pay">
|
||||
<view class="city_box">同城购买</view>
|
||||
<text v-if="orderDetails.buyType == 0">就近购买</text>
|
||||
<text v-else>指定购买</text>
|
||||
</view>
|
||||
<view class="pay_tit">{{orderDetails.productDetails}}</view>
|
||||
</view>
|
||||
<!-- 同城服务-->
|
||||
<view class="part_three" v-if="orderDetails.indentType == 4">
|
||||
<view class="city_pay">
|
||||
<view class="city_box">同城服务</view>
|
||||
<text>{{orderDetails.serviceType}}</text>
|
||||
</view>
|
||||
<view class="pay_tit">{{orderDetails.serviceDetails}}</view>
|
||||
</view>
|
||||
<!-- 骑手商家地址 -->
|
||||
<view class="part_four">
|
||||
<view class="city_pay" v-if="orderDetails.indentType !=3&&orderDetails.indentType !=4">
|
||||
<view class="city_box" v-if="orderDetails.indentType == 1">帮我送</view>
|
||||
<view class="city_box" v-if="orderDetails.indentType == 2">帮我取</view>
|
||||
<text>{{orderDetails.itemType}}</text>
|
||||
</view>
|
||||
<view v-if="orderDetails.indentType !=3&&orderDetails.indentType != 4">
|
||||
<u-line color="#F2F2F2" />
|
||||
</view>
|
||||
<!-- 发货地址 -->
|
||||
<view class="one_box" v-if="orderDetails.indentType != 4" style="margin-top: 30rpx;">
|
||||
<view class="box_dian">
|
||||
<image src="../../../static/image/mai.png" v-if="orderDetails.indentType == 3"></image>
|
||||
<image src="../../../static/image/icon_f.png" v-else></image>
|
||||
</view>
|
||||
<view class="box_addres">
|
||||
<view class="add">
|
||||
{{orderDetails.shipAddress?orderDetails.shipAddress:''}}{{orderDetails.shipAddressDetail}}
|
||||
</view>
|
||||
<view class="num">
|
||||
<view class="name" v-if="orderDetails.indentType !=3">
|
||||
{{orderDetails.shipUserName}} <text>{{orderDetails.shipUserPhone}}</text>
|
||||
<!-- <view class="phone_bd" @click="bindphone(0)">拨打</view> -->
|
||||
</view>
|
||||
<view class="name" v-else>暂无信息</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 收获地址 -->
|
||||
<view class="one_box" style="margin-top: 20rpx;margin-bottom: 30rpx;">
|
||||
<view class="box_dian">
|
||||
<image src="../../../static/image/icon_s.png"></image>
|
||||
</view>
|
||||
<view class="box_addres">
|
||||
<view class="add">{{orderDetails.deliveryAddress}}{{orderDetails.deilveryAddressDetail}}</view>
|
||||
<view class="num">
|
||||
<view class="name">
|
||||
{{orderDetails.deliveryUserName}}<text>{{orderDetails.deliveryUserPhone}}</text>
|
||||
<!-- <view class="phone_bd" @click="bindphone()">联系TA</view> -->
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-line color="#F2F2F2" />
|
||||
<view class="address_pay">
|
||||
<view class="runing_pay">
|
||||
预估跑腿费
|
||||
</view>
|
||||
<view class="runing_distance">
|
||||
<text v-if="orderDetails.distance">{{orderDetails.distance/1000}}公里</text>
|
||||
<text>¥{{orderDetails.indentBasicsMoney}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 联系骑手 -->
|
||||
<view class="rider_box"
|
||||
v-if="orderDetails.indentState != 0&&orderDetails.indentState != 1&&orderDetails.indentState != 8&&orderDetails.indentState != 2&&orderDetails.indentState != 9&&orderDetails.indentState != 10">
|
||||
<view class="flex justify-between align-center padding">
|
||||
<view style="font-size: 31rpx;color: black;">联系骑手...</view>
|
||||
<image @click="complaint" src="../../../static/image/order/tousu.png"
|
||||
style="width: 43rpx;height: 39rpx;" mode=""></image>
|
||||
</view>
|
||||
<view>
|
||||
<u-line color="#F2F2F2" />
|
||||
</view>
|
||||
<view style="padding: 20rpx 25rpx;display: flex;justify-content: space-between;align-items: center;">
|
||||
<view style="display: flex;">
|
||||
<view class="rider_left">
|
||||
<image :src="orderDetails.avatar"></image>
|
||||
</view>
|
||||
<view style="margin-left: 10rpx;color: #333333;">
|
||||
<view>{{orderDetails.riderNickName}}</view>
|
||||
<view>{{orderDetails.phone}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="phone" @click="bindphone()">联系TA</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 订单信息 -->
|
||||
<view class="part_six">
|
||||
<view class="order_info">
|
||||
订单信息
|
||||
</view>
|
||||
|
||||
<!-- 备注 -->
|
||||
|
||||
<view class="order_list">
|
||||
<view class="order_name">订单编号</view>
|
||||
<view class="order_nums">{{orderDetails.indentNumber}}</view>
|
||||
</view>
|
||||
<view class="order_list">
|
||||
<view class="order_name">下单时间</view>
|
||||
<view class="order_nums">{{orderDetails.createTime}}</view>
|
||||
</view>
|
||||
<view class="order_list">
|
||||
<view class="order_name">支付方式</view>
|
||||
<view class="order_nums">在线支付</view>
|
||||
</view>
|
||||
<view class="order_list" v-if="orderDetails.itemCode">
|
||||
|
||||
<view class="order_name" style="color: #FF6A04;">收货码</view>
|
||||
<view class="order_nums" style="color: #FF6A04;">{{orderDetails.itemCode}}</view>
|
||||
</view>
|
||||
<view class="order_list"
|
||||
v-if="orderDetails.indentType != 4&&orderDetails.indentType != 3&&orderDetails.remarks">
|
||||
<view class="order_name">备注</view>
|
||||
<view class="order_nums">{{orderDetails.remarks}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- 订单下单详情 -->
|
||||
<view class="part_sevens">
|
||||
<view class="order_info">
|
||||
费用说明
|
||||
</view>
|
||||
<view class="order_list">
|
||||
<view class="order_name">预估跑腿费</view>
|
||||
<view class="order_nums">¥{{orderDetails.indentBasicsMoney}}</view>
|
||||
</view>
|
||||
<view class="order_list" v-if="orderDetails.tip">
|
||||
<view class="order_name">小费</view>
|
||||
<view class="order_nums">¥{{orderDetails.tip}}</view>
|
||||
</view>
|
||||
<view class="order_list" v-if="orderDetails.prepayMoney">
|
||||
<view class="order_name">预付价格</view>
|
||||
<view class="order_nums">¥{{orderDetails.prepayMoney}}</view>
|
||||
</view>
|
||||
<view class="order_list" v-if="orderDetails.redPacketAmount">
|
||||
<view class="order_name">红包</view>
|
||||
<view class="order_nums">-¥{{orderDetails.redPacketAmount}}</view>
|
||||
</view>
|
||||
<view class="order_list" v-if="orderDetails.cargoInsuranceFlag == 0">
|
||||
<view class="order_name">物品保价</view>
|
||||
<view class="order_nums">¥{{orderDetails.cargoInsurance}}</view>
|
||||
</view>
|
||||
<view class="order_list">
|
||||
<view class="order_name" style="color: black;font-size: 28rpx;">合计</view>
|
||||
<view class="order_nums" style="color: red;font-size: 28rpx;">¥{{orderDetails.indentMoney}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderDetails: '',
|
||||
latitude: '',
|
||||
longitude: '',
|
||||
markers: [], //标记点
|
||||
}
|
||||
},
|
||||
onLoad(data) {
|
||||
let that = this
|
||||
console.log(data)
|
||||
that.indentNumber = data.indentNumber
|
||||
if (!data) {
|
||||
that.orderDetails = JSON.stringify(data.data)
|
||||
}
|
||||
// console.log(that.orderDetails)
|
||||
that.userList()
|
||||
|
||||
},
|
||||
methods: {
|
||||
getLocation(e) {
|
||||
let data = {
|
||||
riderUserId: e,
|
||||
lat: this.orderDetails.deliveryAddressLatitude,
|
||||
lng: this.orderDetails.deliveryAddressLongitude
|
||||
}
|
||||
this.$Request.getT('/timedtask/selectRiderLocation', data).then(res => {
|
||||
if (res.code === 0) {
|
||||
|
||||
console.log(res.data, '经纬度')
|
||||
this.latitude = res.data.riderLocation.lat;
|
||||
this.longitude = res.data.riderLocation.lng;
|
||||
|
||||
this.markers = [{
|
||||
id: 1,
|
||||
latitude: res.data.riderLocation.lat,
|
||||
longitude: res.data.riderLocation.lng,
|
||||
iconPath: '../../static/images/order/rider.png',
|
||||
width: '40',
|
||||
height: '40'
|
||||
}]
|
||||
}
|
||||
});
|
||||
},
|
||||
goMap() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/orderDetail/orderMap?indentNumber=' + this.indentNumber
|
||||
})
|
||||
},
|
||||
// 拨打电话
|
||||
bindphone() {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: this.orderDetails.phone
|
||||
});
|
||||
},
|
||||
userList() {
|
||||
this.$Request.postT('/app/indent/userIndentMessage?indentNumber=' + this.indentNumber).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
this.orderDetails = res.data
|
||||
this.getLocation(this.orderDetails.riderUserId)
|
||||
}
|
||||
});
|
||||
},
|
||||
// 再来一单
|
||||
bindorder(e) {
|
||||
console.log(e)
|
||||
if (e.indentType == 1 || e.indentType == 2) {
|
||||
let index = e.indentType
|
||||
uni.navigateTo({
|
||||
url: '/pages/Helpsend/Helpsend?indentNumber=' + e.indentNumber + '&index=' + index
|
||||
})
|
||||
} else if (e.indentType == 3) {
|
||||
let index = e.indentType
|
||||
let current = e.buyType
|
||||
uni.navigateTo({
|
||||
url: '/pages/Helppay/Helppay?indentNumber=' + e.indentNumber + '&index=' + index +
|
||||
'¤t=' + current
|
||||
})
|
||||
} else if (e.indentType == 4) {
|
||||
let index = e.indentType
|
||||
uni.navigateTo({
|
||||
url: '/pages/Cityservice/Cityservice?indentNumber=' + e.indentNumber + '&index=' + index
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
// 去评论
|
||||
bindcomment(e) {
|
||||
console.log(e)
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/comments/comments?indentNumber=' + e.indentNumber + '&riderUserId=' + e
|
||||
.riderUserId
|
||||
})
|
||||
},
|
||||
// 取消订单
|
||||
bindorderOff(e) {
|
||||
// console.log(e)this.orderDetails.userFine
|
||||
let indentNumber = e.indentNumber
|
||||
console.log(indentNumber)
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '确定取消订单?',
|
||||
showCancel: true,
|
||||
cancelText: '取消',
|
||||
confirmText: '确认',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$Request.postT('/app/indent/userCancleIndent?indentNumber=' + indentNumber)
|
||||
.then(res => {
|
||||
// console.log(res)
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '订单取消成功'
|
||||
});
|
||||
this.userList()
|
||||
// setTimeout(function() {
|
||||
// uni.navigateBack();
|
||||
// }, 1000);
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
title: '订单失败',
|
||||
content: res.msg
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//确认订单
|
||||
bindconfirm(e) {
|
||||
// console.log(e)
|
||||
let indentNumber = e.indentNumber
|
||||
console.log(indentNumber)
|
||||
this.$Request.postT('/app/indent/userDelivery?indentNumber=' + indentNumber).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '订单确认成功'
|
||||
});
|
||||
this.userList()
|
||||
// setTimeout(function() {
|
||||
// uni.navigateBack();
|
||||
// }, 1000);
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
title: '订单确认失败',
|
||||
content: res.msg
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 立即付款
|
||||
bindorderpay(e) {
|
||||
console.log(e)
|
||||
let indentNumber = e.indentNumber
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/pay/pay?indentNumber=' + indentNumber
|
||||
})
|
||||
},
|
||||
complaint() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/complaint/complaint?indentNumber=' + this.orderDetails.indentNumber
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
background: #F5F5F5;
|
||||
}
|
||||
|
||||
/* #ifndef MP-WEIXIN */
|
||||
page {
|
||||
background: #F2EDED;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
.order_details {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 待支付 */
|
||||
.part_one {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
height: 230rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 10rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.city_box {
|
||||
width: 110rpx;
|
||||
line-height: 42rpx;
|
||||
background: #c4e2ff;
|
||||
color: #49A5FF;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
|
||||
.city_pay {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
height: 80rpx;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.city_pay text {
|
||||
font-size: 30rpx;
|
||||
letter-spacing: 2rpx;
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
|
||||
.rider_order {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
padding-top: 20rpx;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.rider_tit {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
color: #999999;
|
||||
font-size: 30upx;
|
||||
margin-top: 10rpx;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.order_btn {
|
||||
display: flex;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.close_order {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.close_btn {
|
||||
border: 1rpx solid #CCCCCC;
|
||||
width: 245rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
text-align: center;
|
||||
border-radius: 75rpx;
|
||||
font-size: 31rpx;
|
||||
color: #999999;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.tip_order {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.close_tip {
|
||||
width: 245rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
text-align: center;
|
||||
border-radius: 75rpx;
|
||||
font-size: 31rpx;
|
||||
color: white;
|
||||
letter-spacing: 2rpx;
|
||||
background: #FF7F00;
|
||||
}
|
||||
|
||||
/* 骑手商家地址 */
|
||||
.part_four {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
margin-top: 20rpx;
|
||||
background: #FFFFFF;
|
||||
/* height: 390rpx; */
|
||||
border-radius: 10rpx;
|
||||
padding: 15rpx 15rpx;
|
||||
|
||||
}
|
||||
|
||||
.u-line {
|
||||
border-bottom-width: 6rpx !important;
|
||||
}
|
||||
|
||||
.one_box {
|
||||
width: 100%;
|
||||
/* height: 100rpx; */
|
||||
/* background: #F5F5F5; */
|
||||
margin: 0 auto;
|
||||
border-radius: 12upx;
|
||||
display: flex;
|
||||
|
||||
}
|
||||
|
||||
.box_dian {
|
||||
/* flex: 1; */
|
||||
width: 10%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
.box_dian image {
|
||||
width: 45rpx;
|
||||
height: 45rpx;
|
||||
}
|
||||
|
||||
.box_name {
|
||||
flex: 5;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
color: #333333;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.box_addres {
|
||||
/* flex: 5; */
|
||||
width: 85%;
|
||||
font-size: 31rpx;
|
||||
}
|
||||
|
||||
.add {
|
||||
/* color: #333333;
|
||||
font-size: 31rpx;
|
||||
letter-spacing: 2upx;
|
||||
font-weight: bold;
|
||||
margin-top: 20upx; */
|
||||
}
|
||||
|
||||
.name {
|
||||
display: inline;
|
||||
font-size: 30rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.name text {
|
||||
color: #999999;
|
||||
font-size: 30rpx;
|
||||
margin-left: 30upx;
|
||||
}
|
||||
|
||||
.address_pay {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx
|
||||
}
|
||||
|
||||
.runing_pay {
|
||||
/* flex: 1; */
|
||||
color: #999999;
|
||||
font-size: 30rpx;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
.runing_distance {
|
||||
/* flex: 1; */
|
||||
color: #999999;
|
||||
font-size: 30rpx;
|
||||
letter-spacing: 1rpx;
|
||||
text-align: end;
|
||||
}
|
||||
|
||||
.runing_distance text {
|
||||
font-size: 31rpx;
|
||||
color: black;
|
||||
margin-left: 35rpx;
|
||||
}
|
||||
|
||||
/* 收货码 */
|
||||
.five_box {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
background: #ffffff;
|
||||
margin-top: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 35rpx;
|
||||
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.part_five {
|
||||
/* height: 85rpx; */
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 20rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.take_number {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
text-indent: 30rpx;
|
||||
}
|
||||
|
||||
.numbers {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
/* 订单信息 */
|
||||
.part_six {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
/* height: 275rpx; */
|
||||
background: #ffffff;
|
||||
margin-top: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
/* margin-bottom: 100rpx; */
|
||||
|
||||
}
|
||||
|
||||
.order_info {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 31rpx;
|
||||
font-weight: bold;
|
||||
letter-spacing: 3rpx;
|
||||
}
|
||||
|
||||
.order_list {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
height: 60rpx;
|
||||
|
||||
}
|
||||
|
||||
.order_name {
|
||||
flex: 1;
|
||||
color: #999999;
|
||||
font-size: 29rpx;
|
||||
letter-spacing: 2rpx;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.order_nums {
|
||||
flex: 2;
|
||||
color: #999999;
|
||||
font-size: 28rpx;
|
||||
letter-spacing: 2rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* 同城服务 */
|
||||
.part_three {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
margin-top: 20rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 10rpx;
|
||||
padding-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.city_pay {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
/* height: 90rpx; */
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.city_pay text {
|
||||
font-size: 28rpx;
|
||||
letter-spacing: 2rpx;
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
|
||||
.city_box {
|
||||
width: 110rpx;
|
||||
line-height: 42rpx;
|
||||
background: #c4e2ff;
|
||||
color: #49A5FF;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
|
||||
.pay_tit {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
font-size: 27rpx;
|
||||
}
|
||||
|
||||
.btn1 {
|
||||
width: 170upx;
|
||||
font-size: 28rpx;
|
||||
line-height: 60upx;
|
||||
text-align: center;
|
||||
border: 1upx solid #9C9C9C;
|
||||
border-radius: 20upx;
|
||||
color: #9C9C9C;
|
||||
margin-right: 30upx;
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
width: 170upx;
|
||||
line-height: 60upx;
|
||||
color: white;
|
||||
background: #FF6A04;
|
||||
font-size: 22upx;
|
||||
text-align: center;
|
||||
margin-right: 10rpx;
|
||||
border-radius: 20upx;
|
||||
}
|
||||
|
||||
.phone_bd {
|
||||
display: inline-block;
|
||||
background: #FF6A04;
|
||||
color: #ffffff;
|
||||
padding: 0rpx 15rpx;
|
||||
margin-left: 14rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.part_seven {
|
||||
padding: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.part_sevens {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
/* height: 275rpx; */
|
||||
background: #ffffff;
|
||||
margin-top: 20rpx;
|
||||
padding-bottom: 10upx;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 100rpx;
|
||||
}
|
||||
|
||||
/* 联系骑手 */
|
||||
.rider_box {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
background: #ffffff;
|
||||
margin-top: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
|
||||
}
|
||||
|
||||
.rider_left image {
|
||||
width: 80rpx;
|
||||
height: 85rpx;
|
||||
border-radius: 60%;
|
||||
}
|
||||
|
||||
.phone {
|
||||
background: #FD6416;
|
||||
color: #ffffff;
|
||||
padding: 8rpx 15rpx;
|
||||
border-radius: 13rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
</style>
|
||||
1283
pages/order/index.vue
Normal file
1283
pages/order/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
872
pages/order/orderDet.vue
Normal file
872
pages/order/orderDet.vue
Normal file
@@ -0,0 +1,872 @@
|
||||
<template>
|
||||
<view class="pages">
|
||||
<!-- 余额 -->
|
||||
<view class="tosend">
|
||||
<view class="tosend_text" v-if="dataDet.status == 6">制作中...</view>
|
||||
<view class="tosend_text" v-if="dataDet.status == 3 && dataDet.orderType == 1">待取餐</view>
|
||||
<view class="tosend_text" v-if="dataDet.status == 3 && dataDet.orderType == 2 && dataDet.riderUserId">配送中
|
||||
</view>
|
||||
<view class="tosend_text" v-if="dataDet.status == 3 && dataDet.orderType == 2 && dataDet.riderUserId==null">
|
||||
待配送</view>
|
||||
<view class="tosend_text" v-if="dataDet.status == 4">已完成</view>
|
||||
<view class="tosend_text" v-if="dataDet.status == 5">已取消</view>
|
||||
<view class="tosend_text" v-if="dataDet.status == 7">待接单</view>
|
||||
<!-- <view class="btnCm" v-if="item.riderUserId">配送中</view>
|
||||
<view class="btnCm" v-else>待派送</view> -->
|
||||
|
||||
<view class="tosend_cont" style="position: relative;margin-top: 20upx;" v-if="dataDet.orderType==2">
|
||||
<image src="../../static/images/order/dizhi.png"
|
||||
style="position: absolute;width: 32rpx;height: 40rpx;top: 50rpx;left: 32rpx;"></image>
|
||||
<view class="tosend_header_text" style="margin-left: 64rpx;"
|
||||
@tap="bindGps(address.lat,address.lng,address.addressDetail)">{{address.province}}{{address.city}}{{address.district}}{{address.addressDetail}}
|
||||
</view>
|
||||
<view class="tosend_cont_infor" style="margin-top: 0;margin-left: 64rpx;">
|
||||
<view class="tosend_cont_infor_le" @click="bindphone(address.userPhone)">
|
||||
{{address.userName}} {{address.userPhone}}
|
||||
</view>
|
||||
<!-- <view class="tosend_cont_infor_ri">{{dataDet.orderCode}}</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="tosend_header" style="margin-top: 20upx;">
|
||||
<!-- 排序 -->
|
||||
<view class="cont_two_top">
|
||||
<view class="cont_two_top_le" v-if="dataDet.status == 3">取餐号码</view>
|
||||
<!-- <view class="cont_two_top_ri" v-if="dataDet.status == 6">制作中</view> -->
|
||||
</view>
|
||||
<view v-if="dataDet.status == 3 && dataDet.orderType == 1" class="cont_two_text">{{dataDet.orderCode}}
|
||||
</view>
|
||||
<view v-if="dataDet.status == 3 && dataDet.orderType == 1" class="cont_two_text2">
|
||||
前面还有<text>{{dataDet.countOrder?dataDet.countOrder:0}}</text>个人排队
|
||||
</view>
|
||||
<view v-if="dataDet.status != 3">
|
||||
<view class="flex justify-between">
|
||||
<view>取餐号码</view>
|
||||
<!-- <view class="cont_two_top_ri">制作中</view> -->
|
||||
</view>
|
||||
<view style="font-size:58upx;" class="text-center text-bold padding-tb">{{dataDet.orderCode}}</view>
|
||||
</view>
|
||||
<!-- 商品列表 -->
|
||||
<view class="tosend_header_food" v-for="(item,index) in dataDet.orderGoodsList" :key='index'>
|
||||
<view class="tosend_header_food_le">
|
||||
<image :src="item.goodsPicture" alt="加载失败" style="border-radius: 10rpx;"></image>
|
||||
</view>
|
||||
<view class="tosend_header_food_ce justify-between">
|
||||
<view class="tosend_header_food_text">{{item.goodsName}}</view>
|
||||
<view class="tosend_header_food_text2" v-if="item.skuMessage">{{item.skuMessage}}</view>
|
||||
<view class="tosend_header_food_text2">打包费</view>
|
||||
</view>
|
||||
<view class="tosend_header_food_ri">
|
||||
<view class="tosend_header_food_text"><text>¥</text>{{item.goodsPrice}}</view>
|
||||
<view class="tosend_header_food_text2">×{{item.goodsNum}}</view>
|
||||
<view class="tosend_header_food_text2"><text>¥</text>{{item.goodsPack}}/份</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tosend_header_do do_top" v-if="dataDet.errandMoney>0&& dataDet.orderType == 2">
|
||||
<view>配送费</view>
|
||||
<view class="tosend_header_do_ri">¥{{dataDet.errandMoney}}</view>
|
||||
</view>
|
||||
<!-- <view class="tosend_header_do" v-if="dataDet.packMoney>0&& dataDet.orderType == 2">
|
||||
<view>打包费</view>
|
||||
<view class="tosend_header_do_ri">¥{{dataDet.packMoney}}</view>
|
||||
</view> -->
|
||||
<view class="tosend_header_do do_bot" v-if="dataDet.couponMoney>0">
|
||||
<view>优惠券</view>
|
||||
<view class="tosend_header_do_ri">-¥{{dataDet.couponMoney}}</view>
|
||||
</view>
|
||||
<view class="tosend_header_do margin-top">
|
||||
<view class="tosend_header_do_le2">实付</view>
|
||||
<view class="tosend_header_do_ri2"><text>¥</text>{{dataDet.payMoney}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- #ifdef APP -->
|
||||
<map v-if="dataDet.riderUserId != null && latitude && longitude&& dataDet.status == 3" id="map" @tap="goMap"
|
||||
style="width: 95%; height: 300rpx;margin-top: 20rpx;margin-left: 20rpx;" :markers="markers"
|
||||
:latitude="latitude" :longitude="longitude"></map>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifndef APP -->
|
||||
<map v-if="dataDet.riderUserId != null && latitude && longitude&& dataDet.status == 3" id="map" @tap="goMap"
|
||||
style="width: 95%; height: 300rpx;margin: 20rpx auto 0;" :markers="markers" :latitude="latitude"
|
||||
:longitude="longitude"></map>
|
||||
<!-- #endif -->
|
||||
<!-- 联系骑手 -->
|
||||
<view class="rider_box" v-if="dataDet.riderUserId!= null">
|
||||
<view class="flex justify-between align-center padding">
|
||||
<view style="font-size: 31rpx;color: black;">联系骑手...</view>
|
||||
<image @click="gotousu()" src="../../static/images/my/tousu.png" style="width: 43rpx;height: 39rpx;"
|
||||
mode=""></image>
|
||||
</view>
|
||||
<view>
|
||||
<u-line color="#F2F2F2" />
|
||||
</view>
|
||||
<view style="padding: 20rpx 25rpx;display: flex;justify-content: space-between;align-items: center;">
|
||||
<view style="display: flex;">
|
||||
<view class="rider_left">
|
||||
<image :src="dataDet.riderAvatar"></image>
|
||||
</view>
|
||||
<view style="margin-left: 10rpx;color: #333333;">
|
||||
<view>{{dataDet.riderUserName}}</view>
|
||||
<view>{{riderPhone}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="phone" @click="bindphone(dataDet.riderPhone)">联系TA</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 评论信息 -->
|
||||
<view class="tosend_cont" v-if="dataDet.evaluateMessage">
|
||||
<view class="tosend_header_text">评论信息</view>
|
||||
<view>
|
||||
<view class="flex align-center">
|
||||
<image :src="dataDet.avatar?dataDet.avatar:'../../static/logo.png'"
|
||||
style="width: 40px;height: 40px;border-radius: 50%;"></image>
|
||||
<view class="flex justify-between align-center" style="width: 100%;margin-left: 5upx;">
|
||||
<view class="text-bold text-df">{{dataDet.userNickName}}</view>
|
||||
<view style="color: #999999;font-size: 24rpx;" v-if="dataDet.ecreateTime">
|
||||
{{dataDet.ecreateTime}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class=" padding-left margin-left-xl" style="font-size: 30upx;">{{dataDet.evaluateMessage}}
|
||||
</view>
|
||||
<view class="flex justify-end padding-top-sm margin-right" @click="show = true"
|
||||
v-if="!dataDet.shopReplyMessage">
|
||||
<image src="../../static/images/order/pinglun.png" style="width: 20px;height: 20px;"></image>
|
||||
</view>
|
||||
<view class="padding-left margin-left-xl margin-top-sm" v-else>
|
||||
<view class="flex align-center">
|
||||
<view class=" flex align-center text-df" style="color: #999999;">
|
||||
<view class="text-df">商家回复:</view>{{dataDet.shopReplyMessage}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="text-lg padding-left margin-left-xl">{{dataDet.shopReplyMessage}}</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 其他信息 -->
|
||||
<view class="tosend_cont ">
|
||||
<view class="tosend_header_text">其他信息</view>
|
||||
<view class="tosend_cont_infor" v-if="dataDet.remark">
|
||||
<view class="tosend_cont_infor_le">订单备注</view>
|
||||
<view class="tosend_cont_infor_ri">{{dataDet.remark}}</view>
|
||||
</view>
|
||||
<view class="tosend_cont_infor">
|
||||
<view class="tosend_cont_infor_le">取餐号码</view>
|
||||
<view class="tosend_cont_infor_ri">{{dataDet.orderCode}}</view>
|
||||
</view>
|
||||
<view class="tosend_cont_infor" v-if="dataDet.phone" @tap="call(dataDet.phone)">
|
||||
<view class="tosend_cont_infor_le">取餐电话</view>
|
||||
<image src="../../static/images/my/phone.png" style="width: 40upx;height: 40upx;"></image>
|
||||
<!-- <view class="tosend_cont_infor_ri">{{dataDet.phone}}</view> -->
|
||||
</view>
|
||||
<view class="tosend_cont_infor">
|
||||
<view class="tosend_cont_infor_le">下单时间</view>
|
||||
<view class="tosend_cont_infor_ri">{{dataDet.payTime}}</view>
|
||||
</view>
|
||||
<view class="flex justify-between align-center" style="margin-top: 3%;">
|
||||
<view class="tosend_cont_infor_le">订单编号</view>
|
||||
<view class="tosend_cont_infor_ri">{{dataDet.orderNumber}}</view>
|
||||
<view class="text-orange margin-left-lg" @click="copy(dataDet.orderNumber)">复制</view>
|
||||
</view>
|
||||
<view class="tosend_cont_infor padding-bottom-sm">
|
||||
<view class="tosend_cont_infor_le">支付方式</view>
|
||||
<view class="tosend_cont_infor_ri" v-if="dataDet.payType==1">微信支付</view>
|
||||
<view class="tosend_cont_infor_ri" v-if="dataDet.payType==2">余额支付</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="addgood" @click="refund()" v-if="dataDet.status == 6">退款</view>
|
||||
<view class="addgood" @click="finish()" v-if="dataDet.status == 6">制作完成</view>
|
||||
<view class="addgood" @click.stop="xiaoPiao()"
|
||||
v-if="dataDet.status == 6||dataDet.status == 3||dataDet.status == 4">补打小票</view>
|
||||
|
||||
<view class="addgood" @click="refund()" v-if="dataDet.status == 3&&dataDet.orderType==2">退款</view>
|
||||
<view class="addgood" @click="peisong()" v-if="dataDet.status == 3&&dataDet.orderType==1">制作已完成</view>
|
||||
<view class="addgood" v-if="dataDet.status == 3&&dataDet.orderType==2&&dataDet.autoSendOrder == 1"
|
||||
@click.stop="succOrder(dataDet)">完成送达</view>
|
||||
<!-- <view class="addgood" @click="peisong()" v-if="dataDet.status == 3&&dataDet.orderType==2">餐品已完成,等待配送</view> -->
|
||||
<!-- 聊天室 -->
|
||||
<view class="chats" @click.stop="chat(dataDet)">
|
||||
<image src="../../static/images/img/chats.png"></image>
|
||||
<view class="shopxiaoix" v-if="ShopUnreadCount">{{ShopUnreadCount}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 评论弹框 -->
|
||||
<u-popup v-model="show" mode="bottom" border-radius="14" :closeable="closeable">
|
||||
<view>
|
||||
<view class="margin padding-tb">
|
||||
<u-input v-model="pinglun" type="textarea" height="200" placeholder="请填写回复的内容" maxlengt="200"
|
||||
:clearable="false" style="background:#F5F5F5;" />
|
||||
</view>
|
||||
<view class="btn" @click="bindEvaluate()">提交</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderNumber: '',
|
||||
dataDet: {},
|
||||
orderType: '',
|
||||
latitude: '',
|
||||
longitude: '',
|
||||
markers: [], //标记点
|
||||
orderId: '',
|
||||
address: {},
|
||||
riderPhone: '',
|
||||
ShopUnreadCount: 0,
|
||||
pinglun: '',
|
||||
show: false,
|
||||
closeable: true,
|
||||
first: false
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
console.log(option)
|
||||
this.orderNumber = option.orderNumber
|
||||
this.orderId = option.orderId
|
||||
this.first = false
|
||||
this.getDataDet()
|
||||
let that = this
|
||||
setInterval(function() {
|
||||
that.getShopUnreadCount()
|
||||
}, 10000)
|
||||
|
||||
},
|
||||
onShow() {
|
||||
this.first = false
|
||||
},
|
||||
methods: {
|
||||
//评论
|
||||
bindEvaluate() {
|
||||
let data = {
|
||||
shopReplyMessage: this.pinglun,
|
||||
orderNumber: this.orderNumber
|
||||
}
|
||||
this.$Request.postT("/admin/order/shopReplyEvaluate", data).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res.code == 0) {
|
||||
this.show = false
|
||||
this.getDataDet()
|
||||
}
|
||||
});
|
||||
},
|
||||
goMap() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/orderMap?indentNumber=' + this.orderNumber+'&orderId='+this.orderId
|
||||
})
|
||||
},
|
||||
//投诉
|
||||
gotousu() {
|
||||
console.log(this.orderNumber)
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/comments?indentNumber=' + this.orderNumber
|
||||
})
|
||||
},
|
||||
// 拨打电话
|
||||
bindphone(e) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: e
|
||||
});
|
||||
},
|
||||
// 一键导航
|
||||
bindGps(latitude, longitude, name, detailsadd) {
|
||||
console.log(latitude, longitude, name, detailsadd)
|
||||
uni.openLocation({
|
||||
latitude: latitude - 0, //要去的纬度-地址
|
||||
longitude: longitude - 0, //要去的经度-地址
|
||||
name: name, //地址名称
|
||||
address: detailsadd, //详细地址名称
|
||||
success: function() {
|
||||
console.log('导航成功');
|
||||
},
|
||||
fail: function(error) {
|
||||
console.log(error)
|
||||
}
|
||||
});
|
||||
},
|
||||
//聊天室
|
||||
chat(e) {
|
||||
// console.log(e)
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/im?orderId=' + e.orderId
|
||||
})
|
||||
},
|
||||
//获取骑手位置
|
||||
getaddress(addressId, riderUserId) {
|
||||
console.log(addressId)
|
||||
let data = {
|
||||
addressId: addressId
|
||||
}
|
||||
this.$Request.getA("/app/address/selectAddressById", data).then(res => {
|
||||
// uni.hideLoading()
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
this.address = res.data
|
||||
this.getRider(res.data.lat, res.data.lng, riderUserId)
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取骑手信息
|
||||
getRider(lat, lng, riderUserId) {
|
||||
console.log(lat, lng, riderUserId, '111111')
|
||||
let data = {
|
||||
lat: lat,
|
||||
lng: lng,
|
||||
riderUserId: riderUserId
|
||||
}
|
||||
this.$Request.getA("/timedtask/selectRiderLocation", data).then(res => {
|
||||
|
||||
if (res.code == 0) {
|
||||
console.log(res.data, '经纬度')
|
||||
this.latitude = res.data.riderLocation.lat;
|
||||
this.longitude = res.data.riderLocation.lng;
|
||||
|
||||
this.markers = [{
|
||||
id: 1,
|
||||
latitude: res.data.riderLocation.lat,
|
||||
longitude: res.data.riderLocation.lng,
|
||||
iconPath: '../../static/images/order/rider.png',
|
||||
width: '40',
|
||||
height: '40'
|
||||
}]
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
},
|
||||
getDataDet() {
|
||||
let data = {
|
||||
// page: 1,
|
||||
// limit: 10,
|
||||
orderId: this.orderId
|
||||
}
|
||||
this.$Request.getA("/app/order/selectOrderById", data).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res.code == 0) {
|
||||
this.dataDet = res.data
|
||||
|
||||
let start = res.data.orderCode.length - 3;
|
||||
this.dataDet.orderCode = res.data.orderCode.substring(start, res.data.orderCode.length)
|
||||
this.getaddress(res.data.addressId, res.data.riderUserId)
|
||||
this.dataDet.orderGoodsList.forEach(res => {
|
||||
res.goodsPicture = res.goodsPicture.split(',')
|
||||
})
|
||||
this.dataDet.address = JSON.parse(this.dataDet.address)
|
||||
this.riderPhone = this.dataDet.riderPhone
|
||||
this.riderPhone = this.riderPhone.replace(this.dataDet.riderPhone.substr(3, 4), "****")
|
||||
// console.log(this.dataDet);
|
||||
// let phone = this.dataDet.riderPhone;
|
||||
// let result = phone.substring(0, 3) + "****" + phone.substring(7, 11);
|
||||
// // console.log(this.dataDet.riderPhone,result);
|
||||
// this.dataDet.riderPhone = result
|
||||
this.orderType = res.data.orderType
|
||||
console.log(this.dataDet, '2222222')
|
||||
}
|
||||
});
|
||||
},
|
||||
copy(value) {
|
||||
uni.setClipboardData({
|
||||
data: value, //要被复制的内容
|
||||
success: () => { //复制成功的回调函数
|
||||
uni.showToast({ //提示
|
||||
title: '复制成功'
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
// 打电话
|
||||
call(phone) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: phone
|
||||
});
|
||||
},
|
||||
// 打开地图
|
||||
openMap(e) {
|
||||
let latitude = e.latitude;
|
||||
let longitude = e.longitude;
|
||||
uni.openLocation({
|
||||
latitude: Number(latitude),
|
||||
longitude: Number(longitude),
|
||||
name: e.address,
|
||||
success: function() {
|
||||
console.log('success');
|
||||
}
|
||||
});
|
||||
},
|
||||
// 完成送达
|
||||
succOrder(e) {
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认完成送达吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
let data = {
|
||||
orderId: e.orderId,
|
||||
// orderNumber: e.orderNumber,
|
||||
// shopId: that.shopId,
|
||||
// addressId: e.addressId,
|
||||
// status: 3
|
||||
}
|
||||
that.$Request.postT("/admin/order/accomplishOrder", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.navigateBack()
|
||||
}
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
refund() {
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认退款吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
let data = {
|
||||
orderId: that.dataDet.orderId
|
||||
}
|
||||
that.$Request.postA("/admin/order/adminCancelOrder", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
let pages = getCurrentPages(); // 当前页面
|
||||
let beforePage = pages[pages.length - 2]; // 上一页
|
||||
uni.navigateBack({
|
||||
success: function() {
|
||||
beforePage.onLoad(); // 执行上一页的onLoad方法
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 补打小票
|
||||
xiaoPiao() {
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认补打小票吗?',
|
||||
success: function(re) {
|
||||
if (re.confirm) {
|
||||
console.log('用户点击确定');
|
||||
let data = {
|
||||
orderId: that.dataDet.orderId,
|
||||
// orderNumber: e.orderNumber,
|
||||
// status: 8
|
||||
}
|
||||
that.$Request.post("/admin/order/print", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
// that.page = 1
|
||||
// that.getOrderList()
|
||||
} else {
|
||||
that.$queue.showToast(res.msg)
|
||||
}
|
||||
});
|
||||
} else if (re.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
finish(e) {
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认订单完成吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
let data = {
|
||||
orderId: that.dataDet.orderId,
|
||||
orderNumber: that.dataDet.orderNumber,
|
||||
status: 3
|
||||
}
|
||||
that.$Request.postJsonA("/admin/order/updateOrder", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
let pages = getCurrentPages(); // 当前页面
|
||||
let beforePage = pages[pages.length - 2]; // 上一页
|
||||
uni.navigateBack({
|
||||
success: function() {
|
||||
beforePage.onLoad(); // 执行上一页的onLoad方法
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
peisong(e) {
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认开始配送吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
let data = {
|
||||
orderId: that.dataDet.orderId,
|
||||
orderNumber: that.dataDet.orderNumber,
|
||||
status: 4
|
||||
}
|
||||
that.$Request.postJsonA("/admin/order/updateOrder", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
let pages = getCurrentPages(); // 当前页面
|
||||
let beforePage = pages[pages.length - 2]; // 上一页
|
||||
uni.navigateBack({
|
||||
success: function() {
|
||||
beforePage.onLoad(); // 执行上一页的onLoad方法
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取用户聊天消息
|
||||
getShopUnreadCount() {
|
||||
let that = this
|
||||
let data = {
|
||||
ordersId: that.orderId
|
||||
}
|
||||
that.$Request.getT("/shop/ordersChat/selectShopUnreadCount", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
// that.ShopUnreadCount = res.data
|
||||
if (res.data > 0) {
|
||||
if (this.ShopUnreadCount != res.data && !this.first) {
|
||||
that.aplayAudio()
|
||||
this.ShopUnreadCount = res.data
|
||||
uni.showModal({
|
||||
title: '消息',
|
||||
content: '有' + res.data + '条消息,请前往聊天列表处理。',
|
||||
success: (ret) => {
|
||||
if (ret.confirm) {
|
||||
uni.redirectTo({
|
||||
url: '/pages/my/liaotian'
|
||||
})
|
||||
this.first = true
|
||||
} else {
|
||||
console.log('else', ret)
|
||||
that.defineCallBack()
|
||||
}
|
||||
}
|
||||
});
|
||||
// this.chatNum = data.data
|
||||
}
|
||||
} else {
|
||||
that.ShopUnreadCount = 0
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//消息提示
|
||||
aplayAudio() {
|
||||
// console.log('语音提示')
|
||||
const innerAudioContext = uni.createInnerAudioContext();
|
||||
innerAudioContext.autoplay = true;
|
||||
innerAudioContext.src =
|
||||
'https://pw.xianmxkj.com/file/uploadPath/2022/01/19/0753211f78d718d44ee6372e33eae9ee.mp3';
|
||||
innerAudioContext.onPlay(() => {
|
||||
console.log('开始播放');
|
||||
});
|
||||
innerAudioContext.onError((res) => {
|
||||
console.log(res.errMsg);
|
||||
console.log(res.errCode);
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 余额 */
|
||||
.tosend {
|
||||
width: 100%;
|
||||
height: 280rpx;
|
||||
/* background: -webkit-linear-gradient(top, #FCD202, #F5F5F5); */
|
||||
}
|
||||
|
||||
.tosend_text {
|
||||
padding: 3% 3% 0%;
|
||||
font-size: 38upx;
|
||||
font-weight: 800;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.tosend_header {
|
||||
width: 94%;
|
||||
background-color: #FFFFFF;
|
||||
margin: 0 auto;
|
||||
border-radius: 18rpx;
|
||||
padding: 3%;
|
||||
}
|
||||
|
||||
/* 排序 */
|
||||
.cont_two_top {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.cont_two_top_le {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.cont_two_top_ri {
|
||||
padding: 6rpx 10rpx;
|
||||
text-align: center;
|
||||
background: rgba(255, 19, 10, 0.2);
|
||||
font-size: 24rpx;
|
||||
border: 2rpx solid #FF130A;
|
||||
color: #FF130A;
|
||||
opacity: 0.6;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.cont_two_text {
|
||||
font-size: 56rpx;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
margin: 5% 0;
|
||||
line-height: 32rpx;
|
||||
}
|
||||
|
||||
.cont_two_text2 {
|
||||
font-size: 30rpx;
|
||||
width: 100%;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
text-align: center;
|
||||
padding-bottom: 4%;
|
||||
line-height: 32rpx;
|
||||
border-bottom: 1rpx solid #E6E6E6;
|
||||
}
|
||||
|
||||
.cont_two_text2 text {
|
||||
color: #FF130A;
|
||||
}
|
||||
|
||||
/* 商品列表 */
|
||||
.tosend_header_text {
|
||||
font-family: PingFang SC;
|
||||
font-weight: 800;
|
||||
color: #333333;
|
||||
line-height: 2;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.tosend_header_food {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
margin-top: 35rpx;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.tosend_header_food_le {
|
||||
/* width: 15%; */
|
||||
}
|
||||
|
||||
.tosend_header_food_le image {
|
||||
width: 135rpx;
|
||||
height: 135rpx;
|
||||
}
|
||||
|
||||
.tosend_header_food_ce {
|
||||
/* margin: 0 0 0 4%; */
|
||||
width: 57%;
|
||||
margin-left: 10upx;
|
||||
}
|
||||
|
||||
.tosend_header_food_ri {
|
||||
text-align: right;
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.tosend_header_food_text {
|
||||
font-size: 34rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
line-height: 1.8;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tosend_header_food_text text {
|
||||
font-size: 25rpx;
|
||||
}
|
||||
|
||||
.tosend_header_food_text2 {
|
||||
font-size: 26rpx;
|
||||
/* font-weight: 500; */
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.do_top {
|
||||
padding-top: 3%;
|
||||
}
|
||||
|
||||
.do_bot {
|
||||
padding-bottom: 3%;
|
||||
border-bottom: 2rpx solid #E6E6E6;
|
||||
}
|
||||
|
||||
.tosend_header_do {
|
||||
width: 100%;
|
||||
color: #333333;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.tosend_header_do view {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.tosend_header_do_ri {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.tosend_header_do_le2 {
|
||||
font-family: PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #999999;
|
||||
padding-top: 1.5%;
|
||||
}
|
||||
|
||||
.tosend_header_do_ri2 {
|
||||
text-align: right;
|
||||
color: #EA0000;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
.tosend_header_do_ri2 text {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
/* 其他信息 */
|
||||
.tosend_cont {
|
||||
width: 94%;
|
||||
background-color: #FFFFFF;
|
||||
margin: 3% auto;
|
||||
border-radius: 18rpx;
|
||||
padding: 3%;
|
||||
}
|
||||
|
||||
.tosend_cont_infor {
|
||||
display: flex;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.tosend_cont_infor_le {
|
||||
flex: 1;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.tosend_cont_infor_ri {
|
||||
flex: 2;
|
||||
text-align: right;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.tosend_cont_text {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.addgood {
|
||||
width: 685upx;
|
||||
height: 88upx;
|
||||
background: #FFCC00;
|
||||
border-radius: 8upx;
|
||||
text-align: center;
|
||||
line-height: 88rpx;
|
||||
margin: 40rpx auto;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.chats {
|
||||
position: fixed;
|
||||
bottom: 70px;
|
||||
right: 15px;
|
||||
}
|
||||
|
||||
.chats image {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
/* 联系骑手 */
|
||||
.rider_box {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
background: #ffffff;
|
||||
margin-top: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
|
||||
}
|
||||
|
||||
.rider_left image {
|
||||
width: 80rpx;
|
||||
height: 85rpx;
|
||||
border-radius: 60%;
|
||||
}
|
||||
|
||||
.phone {
|
||||
background: #FD6416;
|
||||
color: #ffffff;
|
||||
padding: 8rpx 15rpx;
|
||||
border-radius: 13rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.shopxiaoix {
|
||||
background: red;
|
||||
color: #ffffff;
|
||||
width: 40rpx;
|
||||
height: auto;
|
||||
text-align: center;
|
||||
border-radius: 30rpx;
|
||||
position: relative;
|
||||
top: -66px;
|
||||
left: 35px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 690upx;
|
||||
height: 88upx;
|
||||
margin: 30upx auto;
|
||||
background: #FCD202;
|
||||
box-shadow: 0px 10upx 20upx 0upx #FFD9B3;
|
||||
border-radius: 16upx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #000000;
|
||||
|
||||
}
|
||||
</style>
|
||||
234
pages/order/orderMap.vue
Normal file
234
pages/order/orderMap.vue
Normal file
@@ -0,0 +1,234 @@
|
||||
<template>
|
||||
<view>
|
||||
<map id="map" style="width: 100%; height: 720px;" :latitude="latitude" :longitude="longitude" :markers="markers"
|
||||
:show-location="true">
|
||||
</map>
|
||||
<!-- #ifndef APP-PLUS -->
|
||||
<cover-view class="controls-title">
|
||||
|
||||
<cover-view class="tabs_box">
|
||||
<cover-image class="pay_img" src="../../static/images/my/avatar.png"></cover-image>
|
||||
<cover-view class="flex flex-sub margin-left-sm flex-direction justify-between">
|
||||
<cover-view class="pay_name">骑手预计<text class="text-df">{{rider.mDateTime}}</text>送达</cover-view>
|
||||
<cover-view class="text-gray margin-top" style="margin-top: 5rpx;">
|
||||
距离您{{rider.aDouble}}
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
<cover-view class="flex">
|
||||
<cover-image class="pay_img1 margin-right" @click="goNav" src="../../static/images/my/im.png">
|
||||
</cover-image>
|
||||
<cover-image class="pay_img1" @click="call" src="../../static/images/my/phone.png"></cover-image>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<cover-view class="controls-titles">
|
||||
<cover-view class="tabs_box">
|
||||
<cover-view style="position: relative;top: 0rpx;left: 0rpx;">
|
||||
<cover-image class="pay_img" src="../../static/images/my/avatar.png"></cover-image>
|
||||
<cover-view style="position: absolute;top: 5rpx;left: 120rpx;">
|
||||
<cover-view class="pay_name">骑手预计{{rider.mDateTime}}送达</cover-view>
|
||||
<cover-view class="text-gray margin-top" style="margin-top: 5rpx;">
|
||||
距离您{{rider.aDouble}}
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
<cover-view style="position: absolute;top: 5rpx;right: 0rpx;">
|
||||
<cover-view style="position: relative;top: 0rpx;left: 0rpx;">
|
||||
<cover-view style="position: absolute;top: 15rpx;right: 40rpx;">
|
||||
<cover-image class="pay_img1 margin-right" @click="goNav" src="../../static/images/my/im.png">
|
||||
</cover-image>
|
||||
</cover-view>
|
||||
<cover-view style="position: absolute;top: 15rpx;right: 0rpx;">
|
||||
<cover-image class="pay_img1" @click="call" src="../../static/images/my/phone.png"></cover-image>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
latitude: '',
|
||||
longitude: '',
|
||||
markers: [], //标记点
|
||||
indentNumber: '',
|
||||
riderUserId: '',
|
||||
orderDetails: {},
|
||||
rider: {},
|
||||
timer: '',
|
||||
orderId:'',
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
let that = this
|
||||
that.indentNumber = option.indentNumber
|
||||
that.orderId = option.orderId
|
||||
that.getData()
|
||||
|
||||
|
||||
},
|
||||
onShow() {
|
||||
let that = this
|
||||
this.timer = setInterval(function() {
|
||||
that.getData()
|
||||
}, 10000)
|
||||
},
|
||||
onHide() {
|
||||
console.log(this.timer, '定时器')
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$Request.postT('/app/tbindent/userIndentMessage?indentNumber=' + this.indentNumber).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
this.orderDetails = res.data
|
||||
this.riderUserId = this.orderDetails.riderUserId
|
||||
this.getLocation()
|
||||
}
|
||||
});
|
||||
},
|
||||
getLocation() {
|
||||
let data = {
|
||||
riderUserId: this.riderUserId,
|
||||
lat: this.orderDetails.userLat,
|
||||
lng: this.orderDetails.userLng
|
||||
}
|
||||
this.$Request.getT('/timedtask/selectRiderLocation', data).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.latitude = res.data.riderLocation.lat;
|
||||
this.longitude = res.data.riderLocation.lng;
|
||||
this.rider = res.data
|
||||
let mDateTime = res.data.mDateTime.length - 14;
|
||||
// this.dataDet.orderCode = res.data.orderCode.substring(start, res.data.orderCode.length)
|
||||
this.rider.mDateTime = res.data.mDateTime.substring(mDateTime, res.data.mDateTime.length)
|
||||
if (this.rider.aDouble > 1000) {
|
||||
this.rider.aDouble = Number((this.rider.aDouble / 1000)).toFixed(2) + "km"
|
||||
} else {
|
||||
if (this.rider.aDouble == 0) {
|
||||
this.rider.aDouble = "0m";
|
||||
} else {
|
||||
this.rider.aDouble = Number(this.rider.aDouble).toFixed(1) + "m";
|
||||
}
|
||||
}
|
||||
|
||||
let marker = {
|
||||
id: 2,
|
||||
latitude: res.data.riderLocation.lat,
|
||||
longitude: res.data.riderLocation.lng,
|
||||
iconPath: '../../static/images/order/rider.png',
|
||||
width: '40',
|
||||
height: '40',
|
||||
}
|
||||
this.markers.push(marker)
|
||||
}
|
||||
});
|
||||
},
|
||||
call() {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: this.orderDetails.phone
|
||||
});
|
||||
},
|
||||
goNav() {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/my/chat'
|
||||
// })
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/im?orderId=' + this.orderId
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.controls-title {
|
||||
width: 90%;
|
||||
/* height: 220upx; */
|
||||
/* line-height: 220upx; */
|
||||
background: #FFFFFF;
|
||||
position: fixed;
|
||||
bottom: 0rpx;
|
||||
margin: 40upx;
|
||||
border-radius: 26upx;
|
||||
box-shadow: 0upx 30upx 40upx 0upx rgba(187, 170, 163, 0.20);
|
||||
/* margin: 0 40rpx; */
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.controls-titles {
|
||||
width: 90%;
|
||||
/* height: 220upx; */
|
||||
/* line-height: 220upx; */
|
||||
background: #FFFFFF;
|
||||
position: fixed;
|
||||
bottom: 180rpx;
|
||||
margin: 40upx;
|
||||
border-radius: 26upx;
|
||||
box-shadow: 0upx 30upx 40upx 0upx rgba(187, 170, 163, 0.20);
|
||||
/* margin: 0 40rpx; */
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.tabs_box {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx;
|
||||
margin: 20rpx;
|
||||
}
|
||||
|
||||
.pay_tit {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.pay_img {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.pay_img1 {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.tabs_bottom {
|
||||
margin: 0 20rpx 20rpx;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.pay_btn {
|
||||
padding: 5rpx 16rpx;
|
||||
border: solid 2rpx #999999;
|
||||
margin-right: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.pay_name {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.pay_line {
|
||||
height: 2rpx;
|
||||
background-color: #afafaf;
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user