Browse Source

2026.3.2新增

master
tianyi 2 months ago
parent
commit
ac11157841
  1. 71
      pages/index/index.vue
  2. 4
      pages/login/login.vue
  3. 215
      pages/myCenter/businessInfo.vue
  4. 144
      pages/myCenter/shopDetail.vue

71
pages/index/index.vue

@ -1,14 +1,17 @@
<template>
<view class="page">
<view class="swiper-container">
<view class="swiper-page" v-if="currentIndex == 0">
<view class="swiper-page" v-show="currentIndex == 0">
<view @click="updateStatus" style="margin-top: 500rpx;">
营业状态<text>{{businessStatus == '1'?'暂停营业':'正常营业'}}</text>
</view>
<view @click="nishuode">商品该分类</view>
</view>
<view class="swiper-page" v-if="currentIndex == 1">
<de-livery></de-livery>
<view class="swiper-page" v-show="currentIndex == 1">
<de-livery ref="deLivery"></de-livery>
</view>
<view class="swiper-page" v-if="currentIndex == 2">
<my-center></my-center>
<view class="swiper-page" v-show="currentIndex == 2">
<my-center ref="myCenter"></my-center>
</view>
</view>
<tab-bar :width="width" @tab-index="changeIndex" :currentIndex="currentIndex"></tab-bar>
@ -24,6 +27,7 @@
return {
width: 0,
currentIndex: 0,
businessStatus:1,
}
},
components: {
@ -40,13 +44,66 @@
});
},
onLoad() {
},
methods: {
nishuode(){
uni.navigateTo({
url: '/pages/goods/goodsList'
})
},
//
getBusinessStatus(){
this.NB.sendRequest('/app/shoptakeaway/getByShopId', {
shopId: uni.getStorageSync('shopId')
}, false, 'get', 'application/x-www-form-urlencoded').then(res => {
if (res.code == 200) {
this.businessStatus = res.result.status
} else {
uni.showToast(res.message)
}
})
},
//
updateStatus(){
let that = this;
uni.showModal({
title: '提示',
content: '要更改营业状态吗?',
success: function (res1) {
if (res1.confirm) {
that.NB.sendRequest('/app/shoptakeaway/update', {
shopId:uni.getStorageSync('shopId'),
status:that.businessStatus == "1"?'0':that.businessStatus == "0"?'1':'2'
}, false, 'post', 'application/x-www-form-urlencoded').then(res => {
if (res.code == 200) {
uni.showToast("更改成功")
that.businessStatus = that.businessStatus == "1"?'0':that.businessStatus == "0"?'1':'2'
} else {
uni.showToast(res.message)
}
})
}
}
});
},
//tab
changeIndex(index) {
let that = this;
this.lastIndex = this.currentIndex
this.currentIndex = index
switch (index) {
case 1:
that.$refs.deLivery.init()
break;
case 2:
that.$refs.myCenter.init()
break;
}
}
}
}

4
pages/login/login.vue

@ -375,11 +375,13 @@
that.NB.sendRequest(url, data, true, 'POST', 'application/x-www-form-urlencoded').then(res => {
if (res.code !== 200) return
console.log('shopList',res.result.shopList)
console.log('shopList.shop',res.result.shopList[0].shop)
uni.setStorageSync("hiver_token", res.result.accessToken)
uni.setStorageSync("wayValue", this.wayValue)
uni.setStorageSync("nickname", res.result.user.nickname)
uni.setStorageSync('username',this.mobile)
uni.setStorageSync('password',this.password)
uni.setStorageSync('shop',JSON.stringify(res.result.shopList[0].shop))
this.checkShop(res.result.shopList[0])
})

215
pages/myCenter/businessInfo.vue

@ -0,0 +1,215 @@
<template>
<view class="page1">
<view class="list-box">
<view class="list-1">
<view class="list-name">
营业开始时间
</view>
<view class="list-right">
<picker mode="time" :value="shop.businessHourBegin" start="00:00" end="23:59" @change="bindTimeChange($event,'start')">
<view class="uni-input">{{shop.businessHourBegin}}</view>
</picker>
</view>
</view>
<view class="list-1">
<view class="list-name">
营业结束时间
</view>
<view class="list-right">
<picker mode="time" :value="shop.businessHourEnd" start="00:00" end="23:59" @change="bindTimeChange($event,'end')">
<view class="uni-input">{{shop.businessHourEnd}}</view>
</picker>
</view>
</view>
<view class="list-1">
<view class="list-name">
营业状态
</view>
<view class="list-right">
{{shop.status == 0?'正常营业':shop.status == 1?'暂停营业':'冻结'}}
</view>
</view>
<view class="list-1">
<view class="list-name">
拼团佣金
</view>
<view class="list-right">
{{shop.commissionRateMore}}
</view>
</view>
<view class="list-1">
<view class="list-name">
单独购买佣金
</view>
<view class="list-right">
{{shop.commissionRateOne}}
</view>
</view>
<view class="list-1">
<view class="list-name">
经营品类
</view>
<view class="list-right">
{{shop.type}}
</view>
</view>
<view class="list-1">
<view class="list-name">
是否支持配送
</view>
<view class="list-right">
{{shop.isDelivery == 0?'是':'否'}}
</view>
</view>
<view class="list-1">
<view class="list-name">
出餐时间
</view>
<view class="list-right">
{{shop.cookingTime}}分钟
</view>
</view>
<view class="list-1">
<view class="list-name">
排名
</view>
<view class="list-right">
{{shop.shoprank}}
</view>
</view>
<view class="list-1">
<view class="list-name">
是否价格锁定
</view>
<view class="list-right">
{{shop.isPriceLock== 0?'是':'否'}}
</view>
</view>
</view>
<view class="list-box">
<view class="list-2" @click="submit">
保存
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
shop:{}
}
},
onLoad() {
this.getShopMsg()
},
methods: {
getShopMsg(){
this.NB.sendRequest('/app/shoptakeaway/getByShopId', {
shopId: uni.getStorageSync('shopId')
}, false, 'get', 'application/x-www-form-urlencoded').then(res => {
if (res.code == 200) {
this.shop = res.result
for (let key in this.shop) {
if (this.shop[key] === null) {
delete this.shop[key];
}
}
} else {
uni.showToast(res.message)
}
})
},
bindTimeChange(e,type){
if(type == 'start'){
this.shop.businessHourBegin = e.detail.value
}else{
this.shop.businessHourEnd = e.detail.value
}
},
submit(){
this.NB.sendRequest('/app/shoptakeaway/update', this.shop, false, 'POST', 'application/x-www-form-urlencoded').then(res => {
if (res.code == 200) {
uni.showModal({
title: '提示',
content: '更新信息成功',
showCancel:false,
success: function (res) {
if (res.confirm) {
uni.navigateBack()
}
}
});
} else {
uni.showToast(res.message)
}
})
}
}
}
</script>
<style>
page,.page1{
width: 100%;
height: 100%;
font-size: 28rpx;
background: #eee;
}
.list-box{
width: 100%;
height: auto;
background: #fff;
margin-top: 20rpx;
}
.list-1{
display: flex;
width: 100%;
height: 100rpx;
line-height: 100rpx;
border-bottom: 1px solid #eee;
}
.list-2{
width: 100%;
height: 100rpx;
line-height: 100rpx;
text-align: center;
border-bottom: 1px solid #eee;
}
.list-icon{
width: 100rpx;
height: 100rpx;
text-align: center;
}
.list-name{
flex: 1;
padding-left: 20rpx;
}
.list-right{
flex: 1;
height: 100rpx;
text-align: right;
padding-right: 20rpx;
overflow: hidden;
}
.upload-img{
width:60rpx;
height: 60rpx;
background-size: 100%;
margin-top: 20rpx;
}
.list-2{
width: 100%;
height: 100rpx;
line-height: 100rpx;
text-align: center;
border-bottom: 1px solid #eee;
}
</style>

144
pages/myCenter/shopDetail.vue

@ -3,10 +3,13 @@
<view class="list-box">
<view class="list-1">
<view class="list-name">
店招
门头
</view>
<view class="list-right">
<uni-icons type="right" size="22"></uni-icons>
<view class="list-right" @tap="pictureAdd('mentou')">
<view class="upload-img" v-if="shop.shopIcon ==''" style="background: #eee;text-align: center;line-height: 100rpx;">
<uni-icons type="camera" size="28" color="#777"></uni-icons>
</view>
<image :src="shop.shopIcon" v-if="shop.shopIcon !=''" mode="" class="upload-img"></image>
</view>
</view>
<view class="list-1">
@ -14,31 +17,39 @@
店铺名称
</view>
<view class="list-right">
<uni-icons type="right" size="22"></uni-icons>
{{shop.shopName}}
</view>
</view>
<view class="list-1">
<view class="list-name">
店铺地址
副标题
</view>
<view class="list-right">
<uni-icons type="right" size="22"></uni-icons>
<input type="text" placeholder="请输入副标题" v-model="shop.subtitle" style="height: 100rpx;line-height: 100rpx;" />
</view>
</view>
<view class="list-1">
<view class="list-name">
店铺环境
店铺地址
</view>
<view class="list-right">
<uni-icons type="right" size="22"></uni-icons>
{{shop.shopAddress}}
</view>
</view>
<!-- <view class="list-1">
<view class="list-name">
店铺环境
</view>
<view class="list-right">
<image :src="huanjing" mode=""></image>
</view>
</view> -->
<view class="list-1">
<view class="list-name">
身份证
</view>
<view class="list-right">
<uni-icons type="right" size="22"></uni-icons>
<image :src="shopImages[0]" mode="" class="upload-img"></image>
</view>
</view>
<view class="list-1">
@ -46,36 +57,36 @@
营业执照
</view>
<view class="list-right">
<uni-icons type="right" size="22"></uni-icons>
<image :src="shopImages[2]" mode="" class="upload-img"></image>
</view>
</view>
<view class="list-1">
<view class="list-name">
开户人
补充证照
</view>
<view class="list-right">
<uni-icons type="right" size="22"></uni-icons>
<image :src="huanjing" mode="" class="upload-img"></image>
</view>
</view>
<view class="list-1">
<view class="list-name">
银行卡
支付宝账
</view>
<view class="list-right">
<uni-icons type="right" size="22"></uni-icons>
<input type="text" placeholder="请输入支付宝账号" v-model="shop.aliAccount" style="height: 100rpx;line-height: 100rpx;" />
</view>
</view>
<view class="list-1">
<view class="list-name">
开户银行
支付宝实名
</view>
<view class="list-right">
<uni-icons type="right" size="22"></uni-icons>
<input type="text" placeholder="请输入支付宝账号" v-model="shop.aliName" style="height: 100rpx;line-height: 100rpx;" />
</view>
</view>
</view>
<view class="list-box">
<view class="list-2">
<view class="list-2" @click="submit">
保存
</view>
</view>
@ -86,14 +97,21 @@
export default {
data() {
return {
shop:{},
shopImages:[],
huanjing:''
}
},
props:{
},
watch: {
onLoad() {
this.shop = JSON.parse(uni.getStorageSync('shop'));
this.shopImages = this.shop.shopImages.split('@@')
this.huanjing = JSON.parse(this.shopImages[3])[0]
for (let key in this.shop) {
if (this.shop[key] === null) {
delete this.shop[key];
}
}
},
methods: {
navigatorTo(e){
@ -108,6 +126,75 @@
uni.navigateTo({
url: url
})
},
pictureAdd(type) {
let that = this
uni.chooseMedia({
count: type == 'qita'?9:1,
mediaType: ['image'],
sourceType: ['album', 'camera'],
success(res) {
uni.showLoading({
title: '加载中...',
mask: true
})
for (let i = 0; i < res.tempFiles.length; i++) {
that.upLoadFile(res.tempFiles[i].tempFilePath,type)
}
}
})
},
async upLoadFile(path,type) {
let that = this;
let hiver_token = uni.getStorageSync("hiver_token")
await uni.uploadFile({
url: getApp().globalData.mainurl + '/upload/file',
filePath: path,
name: 'file',
header: {
"content-type": "multipart/form-data",
'accessToken': hiver_token
},
formData: {},
success: (uploadFileRes) => {
let pathData = JSON.parse(uploadFileRes.data)
that.shop.shopIcon = pathData.result
that.$forceUpdate()
},
fail: (err) => {
uni.hideLoading();
uni.showToast({
title: JSON.stringify(err),
icon: 'none'
})
}
});
await setTimeout(res => {
uni.hideLoading();
}, 1000)
},
submit(){
console.log(this.shop)
console.log(typeof(this.shop))
this.NB.sendRequest('/app/shop/edit', this.shop, false, 'PUT', 'application/x-www-form-urlencoded').then(res => {
if (res.code == 200) {
uni.showModal({
title: '提示',
content: '更新信息成功',
showCancel:false,
success: function (res) {
if (res.confirm) {
uni.navigateBack()
}
}
});
} else {
uni.showToast(res.message)
}
})
}
}
}
@ -125,6 +212,7 @@
height: auto;
background: #fff;
margin-top: 20rpx;
}
.list-1{
display: flex;
@ -132,6 +220,7 @@
height: 100rpx;
line-height: 100rpx;
border-bottom: 1px solid #eee;
}
.list-2{
width: 100%;
@ -150,8 +239,17 @@
padding-left: 20rpx;
}
.list-right{
width: 50rpx;
flex: 1;
height: 100rpx;
text-align: right;
padding-right: 20rpx;
overflow: hidden;
}
.upload-img{
width:60rpx;
height: 60rpx;
background-size: 100%;
margin-top: 20rpx;
}
.list-2{
width: 100%;

Loading…
Cancel
Save