wangfukang 4 weeks ago
parent
commit
de3803998a
  1. 108
      package2/group/groupBuyList.vue
  2. 23
      package2/group/groupBuySingle.vue
  3. 195
      package2/group/groupPendingList.vue
  4. 519
      package2/group/searchGroup.vue
  5. 5
      package2/myCenter/addGoods.vue
  6. 404
      package2/shop/businessInfo.vue
  7. 1
      package2/shop/merchantCenter.vue
  8. 857
      package2/shop/shopInfo.vue

108
package2/group/groupBuyList.vue

@ -11,14 +11,11 @@
饭团
<text>宿舍拼饭局</text>
</view>
<view class="title-search" :style="{'margin-top': menuButtonInfo.top +'px'}" @tap="goDetail('search')">
<view class="title-search" :style="{'margin-top': menuButtonInfo.top +'px'}">
<uni-icons type="search" size="16" color="#08735d"></uni-icons>
<swiper class="search-word-swiper" vertical circular :autoplay="false" :interval="2200" :duration="500">
<swiper-item v-for="(word,index) in searchHotWords" :key="index">
<view class="search-hot-word">{{word}}</view>
</swiper-item>
</swiper>
<view class="search-trend">热搜</view>
<input class="search-input" type="text" placeholder="搜索商家/美食" v-model="searchForm.keyWord"
@confirm="goSearch" confirm-type="search" />
<view class="search-trend" @tap.stop="goSearch">搜索</view>
</view>
</view>
<view class="title-tab" style="margin-top: 12rpx;">
@ -84,7 +81,7 @@
<view class="title-sort">
<view class="sort-member">
<view class="sort-text" @tap="searchShop('all','')">
综合排序 <text style="font-size: 20rpx;"></text>
搜索重置 <text style="font-size: 20rpx;"></text>
</view>
</view>
<view class="sort-member">
@ -130,12 +127,11 @@
</view>
<view class="shop-content-center">
<view class="shop-rate">
<view class="avatar-stack">
<text>{{item._liveAvatars[0]}}</text>
<text>{{item._liveAvatars[1]}}</text>
<text>{{item._liveAvatars[2]}}</text>
<view class="shop-rate-num">{{item.shopScore ? item.shopScore : 5}}</view>
<view>
<uni-rate :disabled="true" size="16" disabledColor="rgba(255, 184, 84, 1)"
:value="item.shopScore ? item.shopScore : 5" />
</view>
<view class="shop-rate-text">附近同学正在拼</view>
</view>
<view class="shop-tag">
<text>
@ -404,16 +400,22 @@
this.searchForm.sortOrder = 'shoprank'
this.searchForm.orderOrder = 'desc'
this.searchForm.shopArea = ''
this.searchForm.shopType = ''
this.searchForm.keyWord = ''
this.$delete(this.searchForm, 'isStudent')
this.searchForm.sort = 'shoprank'
this.searchScore = false
this.searchScore = false
this.searchSale = false
} else if (type == 'typeUp') {
//TODO
}
this.getShopList();
},
goSearch() {
this.searchForm.keyWord = (this.searchForm.keyWord || '').trim()
this.searchForm.pageNumber = 1
this.getShopList()
},
buyingye() {
uni.showToast({
title: '店铺不在营业时间!',
@ -595,13 +597,9 @@
this.searchStudentShop()
return
}
uni.navigateTo({
url: '/package2/group/searchGroup?shopType=' + (item.value || '')
})
this.searchByShopType(item.value || '')
} else {
uni.navigateTo({
url: '/package2/group/searchGroup'
})
this.goSearch()
}
} else {
uni.navigateTo({
@ -629,6 +627,18 @@
this.$set(this.searchForm, 'isStudent', 1)
this.getShopList()
},
searchByShopType(shopType) {
this.searchForm.pageNumber = 1
this.searchForm.shopArea = ''
this.searchForm.shopType = shopType
this.searchForm.sort = 'shoprank'
this.searchForm.sortOrder = 'shoprank'
this.searchForm.orderOrder = 'desc'
this.searchScore = false
this.searchSale = false
this.$delete(this.searchForm, 'isStudent')
this.getShopList()
},
checkArea() {
this.isArea = !this.isArea
}
@ -749,6 +759,16 @@
margin-left: 8rpx;
}
.search-input {
flex: 1;
height: 58rpx;
line-height: 58rpx;
margin-left: 8rpx;
font-size: 22rpx;
font-weight: 800;
color: #08735d;
}
.search-hot-word {
height: 58rpx;
line-height: 58rpx;
@ -1373,41 +1393,27 @@
}
.shop-rate {
background: rgba(255, 250, 237, 0.72);
min-height: 46rpx;
display: flex;
align-items: center;
border-radius: 46rpx;
padding: 0 14rpx 0 8rpx;
box-shadow: inset 0 0 0 1rpx rgba(255, 255, 255, 0.7);
}
.avatar-stack {
background: rgba(249, 212, 157, 0.34);
height: 34rpx;
display: flex;
align-items: center;
text {
width: 34rpx;
height: 34rpx;
line-height: 34rpx;
text-align: center;
border-radius: 50%;
background: #fff;
margin-left: -8rpx;
font-size: 18rpx;
box-shadow: 0 4rpx 10rpx rgba(0, 45, 29, 0.12);
}
text:first-child {
margin-left: 0;
}
border-radius: 17rpx;
padding: 0 8rpx 0 0;
}
.shop-rate-text {
margin-left: 10rpx;
font-size: 20rpx;
font-weight: 900;
color: #7a5942;
.shop-rate-num {
width: 42rpx;
height: 100%;
text-align: center;
background: linear-gradient(90deg, rgba(255, 77, 0, 1), rgba(255, 184, 84, 1));
color: #fff;
line-height: 34rpx;
font-size: 18rpx;
border-bottom-left-radius: 17rpx;
border-top-left-radius: 17rpx;
border-bottom-right-radius: 8rpx;
border-top-right-radius: 8rpx;
font-weight: 700;
}
.shop-tag {

23
package2/group/groupBuySingle.vue

@ -145,15 +145,13 @@
<view class="goods-img">
<img :src="item.productPicture" alt="" style="border-radius: 20rpx;">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/6c4ab92a43c842d8bb22035bce1f65cc.png"
alt=""
style="width:30rpx;height:30rpx;position: absolute;top: 0;left: 0;background-size: 100%;" />
<view class="group-corner-badge" v-if="item.isMoreBuy != 1">可拼团</view>
</view>
<view class="goods-content">
<view class="goods-name">
{{item.productName}}
</view>
<view class="goods-vibe">
<view class="goods-vibe" v-if="item.isMoreBuy != 1">
<text class="goods-vibe-tag">拼团价更香</text>
<text class="goods-vibe-copy">约人一起下单</text>
</view>
@ -2676,6 +2674,23 @@
}
}
.group-corner-badge {
position: absolute;
top: -1rpx;
left: -1rpx;
z-index: 2;
height: 34rpx;
line-height: 34rpx;
padding: 0 12rpx;
border-radius: 18rpx 18rpx 18rpx 6rpx;
background: linear-gradient(90deg, #ff6a2a, #ffb854);
color: #fff;
font-size: 18rpx;
font-weight: 900;
box-shadow: 0 8rpx 16rpx rgba(255, 106, 42, 0.28);
border: 2rpx solid rgba(255, 255, 255, 0.9);
}
.goods-bottom {
width: 95%;
margin: 0 auto;

195
package2/group/groupPendingList.vue

@ -1,21 +1,17 @@
<template>
<view class="pending-page" :class="{'store-scene': isStoreScene}">
<view class="pending-fixed">
<view class="hero">
<view class="top-bar">
<view class="back-btn" @tap="back"
:style="{'top': menuButtonInfo.top + 'px','width': menuButtonInfo.height + 'px','height': menuButtonInfo.height + 'px'}">
<uni-icons type="left" size="28" color="#08735d"></uni-icons>
</view>
</view>
<view class="hero-copy">
<!-- <view class="hero-kicker" style="padding-left: 80rpx;">{{isStoreScene ? '校园团购' : '校园外卖'}}</view> -->
<view class="hero-title">{{isStoreScene ? '正在等你来拼团' : '附近饭搭子开团中'}}</view>
<view class="hero-sub">{{isStoreScene ? '同学们发起的团购拼团,凑齐就一起省' : '公开拼饭局都在这里,点进店铺直接参团'}}</view>
<view class="nav-row">
<view class="back-btn" @tap="back">
<uni-icons type="left" size="28" :color="searchIconColor"></uni-icons>
</view>
<view class="hero-badge">
<image src="/static/images/img/loading.gif" mode="aspectFit"></image>
<text>待成团</text>
<view class="nav-title">加入立即省钱</view>
</view>
<view class="tab-card">
<view class="tab-item" v-for="item in tabs" :key="item.scene"
:class="{'tab-item-active': scene === item.scene}" @tap="switchScene(item.scene)">
<text>{{item.label}}</text>
</view>
</view>
@ -85,10 +81,13 @@
data() {
return {
scene: 'takeaway',
menuButtonInfo: {
top: 0,
height: 32
},
tabs: [{
label: '饭团',
scene: 'takeaway'
}, {
label: '团购',
scene: 'storeGroup'
}],
loadStatus: 'more',
navPaddingStyle: '',
totalPages: 1,
@ -113,19 +112,19 @@
}
},
onLoad(option) {
this.scene = option && option.scene ? option.scene : 'takeaway'
this.scene = this.normalizeScene(option && option.scene)
this.query.merchantType = this.isStoreScene ? 2 : 1
this.initRegion()
},
onShow() {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
},
onReachBottom() {
if (this.loadStatus === 'loading' || this.query.pageNumber >= this.totalPages) return
this.query.pageNumber += 1
this.getGroupList()
},
methods: {
normalizeScene(scene) {
return scene === 'storeGroup' ? 'storeGroup' : 'takeaway'
},
initRegion() {
const area = uni.getStorageSync('area')
if (!area) {
@ -150,6 +149,18 @@
this.groupList = []
this.getGroupList()
},
switchScene(scene) {
const nextScene = this.normalizeScene(scene)
if (this.scene === nextScene) return
this.scene = nextScene
this.query.merchantType = this.isStoreScene ? 2 : 1
this.query.keyWord = ''
this.query.pageNumber = 1
this.totalPages = 1
this.groupList = []
this.loadStatus = 'more'
this.getGroupList()
},
getGroupList() {
if (!this.query.regionId) return
this.loadStatus = 'loading'
@ -271,119 +282,105 @@
left: 0;
right: 0;
z-index: 1000;
}
.hero {
width: 100%;
min-height: 360rpx;
padding: 0 26rpx 36rpx;
padding: 88rpx 26rpx 22rpx;
box-sizing: border-box;
position: relative;
overflow: hidden;
background: linear-gradient(135deg, #0f8b6b 0%, #87eabf 58%, #fff0c8 100%);
color: #fff;
}
.hero-holder {
height: 454rpx;
background: rgba(247, 255, 249, 0.94);
box-shadow: 0 12rpx 30rpx rgba(20, 115, 88, 0.08);
backdrop-filter: blur(18rpx);
}
.store-scene .hero {
background: linear-gradient(115deg, rgba(255, 132, 80, 0.98) 0%, rgba(255, 185, 113, 0.94) 56%, rgba(255, 236, 218, 0.9) 100%);
.store-scene .pending-fixed {
background: rgba(255, 249, 243, 0.96);
box-shadow: 0 12rpx 30rpx rgba(178, 102, 48, 0.1);
}
.hero::after {
content: '';
width: 420rpx;
height: 420rpx;
border-radius: 50%;
background: rgba(255, 255, 255, 0.22);
position: absolute;
right: -170rpx;
top: -130rpx;
.hero-holder {
width: 100%;
height: 396rpx;
}
.top-bar {
height: 98rpx;
.nav-row {
position: relative;
z-index: 20;
pointer-events: none;
display: flex;
align-items: center;
height: 64rpx;
}
.back-btn {
position: absolute;
left: 0;
display: flex;
align-items: center;
justify-content: center;
width: 64rpx;
height: 64rpx;
border-radius: 999rpx;
background: rgba(255, 255, 255, 0.96);
border: 1rpx solid rgba(255, 255, 255, 0.82);
box-shadow: 0 8rpx 18rpx rgba(0, 45, 29, 0.08);
box-sizing: border-box;
pointer-events: auto;
}
.hero-copy {
position: relative;
z-index: 2;
width: 66%;
padding-top: 24rpx;
flex-shrink: 0;
}
.hero-kicker {
display: inline-block;
padding: 8rpx 18rpx;
border-radius: 999rpx;
background: rgba(255, 255, 255, 0.34);
font-size: 22rpx;
.nav-title {
position: absolute;
left: 50%;
width: 220rpx;
height: 64rpx;
color: #073d33;
font-size: 34rpx;
font-weight: 900;
line-height: 64rpx;
text-align: center;
transform: translateX(-50%);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.hero-title {
margin-top: 48rpx;
font-size: 48rpx;
line-height: 58rpx;
font-weight: 900;
.store-scene .nav-title {
color: #3f2618;
}
.hero-sub {
margin-top: 12rpx;
font-size: 24rpx;
line-height: 36rpx;
font-weight: 800;
color: rgba(255, 255, 255, 0.86);
.tab-card {
display: flex;
height: 76rpx;
margin-top: 24rpx;
padding: 8rpx;
border-radius: 999rpx;
background: rgba(255, 255, 255, 0.72);
box-shadow: inset 0 0 0 1rpx rgba(255, 255, 255, 0.82);
box-sizing: border-box;
}
.hero-badge {
width: 190rpx;
height: 190rpx;
border-radius: 42rpx;
position: absolute;
right: 32rpx;
bottom: 42rpx;
z-index: 2;
background: rgba(255, 255, 255, 0.42);
box-shadow: 0 22rpx 44rpx rgba(0, 45, 29, 0.16);
.tab-item {
flex: 1;
height: 60rpx;
border-radius: 999rpx;
color: rgba(7, 61, 51, 0.56);
font-size: 27rpx;
font-weight: 900;
line-height: 60rpx;
text-align: center;
overflow: hidden;
}
.hero-badge image {
width: 120rpx;
height: 120rpx;
margin-top: 16rpx;
.tab-item-active {
background: linear-gradient(90deg, #dcff9c, #baffec);
color: #08735d;
box-shadow: 0 10rpx 24rpx rgba(13, 114, 82, 0.14);
}
.hero-badge text {
display: block;
font-size: 23rpx;
font-weight: 900;
.store-scene .tab-item {
color: rgba(84, 43, 22, 0.56);
}
.store-scene .tab-item-active {
background: linear-gradient(135deg, #ff7444 0%, #ffae53 100%);
color: #fff;
box-shadow: 0 10rpx 24rpx rgba(255, 126, 39, 0.2);
}
.search-card {
width: 94%;
margin: -32rpx auto 22rpx;
width: 100%;
margin: 18rpx auto 0;
padding: 16rpx;
border-radius: 34rpx;
background: rgba(255, 255, 255, 0.76);

519
package2/group/searchGroup.vue

@ -1,519 +0,0 @@
<template>
<!-- 拼团页 -->
<view class="page1">
<view class="title">
<view class="title-sreach">
<view class="back-btn" @tap="back" :style="{'padding-top': menuButtonInfo.top +'px'}">
<uni-icons type="left" size="28"></uni-icons>
</view>
<view class="title-name" :style="{'padding-top': menuButtonInfo.top +'px'}">
搜索页
</view>
<view class="title-search" :style="{'margin-top': menuButtonInfo.top +'px'}">
<uni-icons type="search" size="18" style="margin: 9rpx;"></uni-icons>
<input type="text" placeholder="搜索" v-model="searchForm.keyWord" @confirm="goSearch" confirm-type="search" />
</view>
</view>
<view style="width: 95%;background: #fff;margin: 0 auto;border-radius: 20rpx;padding: 20rpx;min-height: 160rpx;" v-if="historyList.length > 0 && !searchForm.shopName">
<view style="height: 60rpx;color: #777;display: flex;justify-content: space-between;align-items: center;">
<text>历史搜索</text>
<uni-icons type="trash" size="18" color="#999" @tap="clearHistory"></uni-icons>
</view>
<view style="overflow: hidden;">
<view v-for="(item, index) in historyList" :key="index" @tap="clickHistory(item)" style="margin-right:20rpx;margin-bottom:20rpx;background: rgba(247, 248, 248, 0.6);display: inline-block;padding: 10rpx 20rpx;border-radius: 10rpx;float: left;">
{{item}}
</view>
</view>
</view>
<view class="title-sort" style="clear: both;">
<view class="sort-member">
<view class="sort-text" @tap="searchShop('all','')">
综合排序 <text style="font-size: 20rpx;"></text>
</view>
</view>
<view class="sort-member">
<view class="sort-text" @tap="searchShop('sale','')">
销量优先 <text style="font-size: 20rpx;"></text>
</view>
</view>
<view class="sort-member">
<view class="sort-text" @tap="searchShop('score','')">
评分优先 <text style="font-size: 20rpx;"></text>
</view>
</view>
<view class="sort-member" style="position: relative;">
<view class="sort-text" @tap="checkArea">
区域选择 <text style="font-size: 20rpx;"></text>
</view>
<view class="sort-value" v-if="isArea">
<view class="sort-value1" v-for="(item,index) in shopArea" :key="index" @tap="searchShop('area',item.id)">{{item.title}}</view>
</view>
</view>
</view>
</view>
<view class="shop-list">
<view class="shop-member" v-for="(item,index) in shopList" :key="index">
<view class="shop-top">
<view class="shop-img">
<img :src="item.shopIcon" alt="">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/6c4ab92a43c842d8bb22035bce1f65cc.png" alt="" style="width:30rpx;height:30rpx;position: absolute;top: 0;left: 0;background-size: 100%;" />
</view>
<view class="shop-content" @tap="goDetail('shop',item)">
<view class="shop-name">
{{item.shopName}}
</view>
<view class="shop-content-center">
<view class="shop-rate">
<view class="shop-rate-num">{{item.shopScore}}</view>
<view style="padding-top: 4rpx;">
<uni-rate :disabled="true" size="16" disabledColor="rgba(255, 184, 84, 1)" :value="item.shopScore" />
</view>
</view>
<view class="shop-tag">
<text style="padding: 4rpx 10rpx;background: rgba(223, 255, 176, 1);color: #777;border-radius: 6rpx;">
{{item.shopTakeaway && item.shopTakeaway.type ? item.shopTakeaway.type : '美食'}}
</text>
</view>
</view>
<view class="shop-content-bottom">
<view class="shop-deal">
<text v-if = "item.subtitle != null" style="padding: 4rpx 10rpx;background: rgba(223, 255, 176, 1);color: #777;border-radius: 6rpx;">
{{item.subtitle}}
</text>
</view>
<view class="shop-deal1">
已拼<text style="color: red;font-weight: 700;"> {{item.saleCount != null ? item.saleCount : 0}} </text>
</view>
</view>
</view>
</view>
<view class="shop-bottom" v-if="item.products != null && item.products.length > 0">
<view class="menu-member" v-if='item1.delFlag == 1' v-for="(item1,index1) in item.products" :key="index1" @tap="goDetail('product',item1)">
<view class="menu-img">
<img :src="item1.productPicture" alt="">
</view>
<view class="menu-content">
<view class="shop-menu-name">
{{item1.productName}}
</view>
<view class="shop-menu-price">
¥{{item1.attributeListPrice | sliceMsg}}
</view>
<view class="shop-menu-purchase">
拼团 <text style="color: red;">¥{{item1.productGroupBuyPrices | slicePrice}}</text>
</view>
</view>
</view>
</view>
</view>
<uni-load-more :status="loadStatus" @change="onChange" v-if="shopList.length > 0" />
</view>
<view style="width: 100%;height: 120rpx;"></view>
</view>
</template>
<script>
export default {
data() {
return {
loadStatus: 'more',
isArea:false,
searchScore: false,
searchSale: false,
shopArea:[],
totalPages:1,
historyList: [],
searchForm:{
regionId:JSON.parse(uni.getStorageSync('area')).id,
shopName:'',
shopType:'',
keyWord:'',
shopArea:'',
pageNumber: 1,
pageSize: '10',
merchantType: 1,
sort: "shoprank",
order: "desc",
sortOrder:'shoprank',
orderOrder:'desc',
sortScore:'',
orderScore:'',
sortSale:'',
orderSale:''
},
shopList:[],
menuButtonInfo:{}
}
},
filters: {
sliceMsg(val) {
var name = ''
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name = newObj[as].specPrice
}
}
return name;
},
slicePrice(val){
let begin = ''
if(val != null){
begin = val[0].groupPrice
for(let i = 0;i < val.length;i++){
if(val[i].groupPrice < begin){
begin = val[i].groupPrice
}
}
}
return begin;
}
},
onReachBottom() {
if (this.searchForm.pageNumber >= this.totalPages) return;
// this.status = 'loading';
this.searchForm.pageNumber ++;
this.getShopList();
},
onLoad(option) {
if (option && option.shopType && option.shopType !== 'undefined') {
this.searchForm.shopType = option.shopType;
this.getShopList();
}
let history = uni.getStorageSync('searchHistoryGroup');
if (history) {
this.historyList = JSON.parse(history);
}
this.searchForm.regionId = JSON.parse(uni.getStorageSync('area')).id
this.getShopArea();
//this.getShopList();
},
onShow() {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
},
methods: {
goSearch() {
if (this.searchForm.keyWord && this.searchForm.keyWord.trim()) {
let list = this.historyList;
let index = list.indexOf(this.searchForm.keyWord.trim());
if (index !== -1) list.splice(index, 1);
list.unshift(this.searchForm.keyWord.trim());
if (list.length > 10) list.pop();
this.historyList = list;
uni.setStorageSync('searchHistoryGroup', JSON.stringify(list));
}
this.searchForm.pageNumber = 1;
this.getShopList();
},
clickHistory(item) {
this.searchForm.keyWord = item;
this.goSearch();
this.$forceUpdate()
},
clearHistory() {
uni.showModal({
title: '提示',
content: '确定清空历史搜索吗?',
success: (res) => {
if (res.confirm) {
this.historyList = [];
uni.setStorageSync('searchHistoryGroup', '[]');
}
}
});
},
searchShop(type,value){
this.searchForm.pageNumber = 1
if(type == 'area'){
this.searchForm.shopArea = value
}else if(type == 'score'){
this.searchScore = !this.searchScore
this.searchSale = false
this.searchForm.sort = 'shopScore'
}else if(type == 'sale'){
this.searchSale = !this.searchSale
this.searchScore = false
this.searchForm.sort = 'saleCount'
}else if(type == 'all'){
this.searchForm.sortOrder = 'shoprank'
this.searchForm.orderOrder = 'desc'
this.searchForm.shopArea = ''
this.searchForm.sort = 'shoprank'
this.searchScore = false
this.searchScore = false
this.searchSale = false
}else if(type == 'typeUp'){
//TODO
}
this.getShopList();
},
getShopArea(){
let that = this
that.tui.request("/app/shopArea/getByParentId/"+JSON.parse(uni.getStorageSync('area')).id, "GET", {}, false, true).then((res) => {
if (res.code == 200) {
if(res.result != null){
for(let m = 0;m<res.result.length;m++){
if(res.result[m].isCanteen == 1){
that.shopArea.push(res.result[m])
}
}
}
} else {
that.tui.toast(res.message)
return
}
}).catch((res) => {})
},
getShopList(){
this.loadStatus = 'loading'
if(this.searchSale){
this.searchForm.sortSale = 'saleCount'
this.searchForm.orderSale = 'desc'
this.searchForm.sortOrder = ''
}else{
this.searchForm.sortSale = ''
}
if(this.searchScore){
this.searchForm.sortScore = 'shopScore'
this.searchForm.orderScore = 'desc'
this.searchForm.sortOrder = ''
}else{
this.searchForm.sortScore = ''
}
let that = this
that.tui.request("/app/shop/getByCondition", "GET", this.searchForm, false, true).then((res) => {
that.loadStatus = 'nomore';
if (res.code == 200) {
if (that.searchForm.pageNumber == 1) {
that.shopList = res.result.content
} else {
that.shopList = [...that.shopList, ...res.result.content]
}
that.totalPages = res.result.totalPages
that.isArea = false
that.$forceUpdate()
} else {
that.tui.toast(res.message)
return
}
uni.hideLoading()
}).catch((res) => {})
},
goDetail(type,item){
if(type == 'shop'){
uni.navigateTo({
url:'/package2/group/groupBuySingle?type=shop&item=' + encodeURIComponent(JSON.stringify(item))
})
}else if(type == 'search'){
uni.navigateTo({
url:'/package2/group/groupBuySingle'
})
}else{
uni.navigateTo({
url:'/package2/group/groupBuySingle?type=product&item=' + encodeURIComponent(JSON.stringify(item))
})
}
},
back(){
uni.navigateBack()
},
checkArea(){
this.isArea = !this.isArea
}
}
}
</script>
<style lang="scss">
page {
width: 100%;
min-height: 100%;
font-size: 24rpx;
background: #F5F8F5;
color: #00231C;
}
.page1 {
width: 100%;
min-height: 100vh;
font-size: 24rpx;
position: relative;
}
.title{
background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/8bc15960c2dc40268e295d6dd23aecce.png') no-repeat;
background-size: 100% 100%;
width: 100%;
height: auto;
padding-bottom: 20rpx;
}
.title-sreach{
width: 75%;
display: flex;
height: 200rpx;
}
.back-btn{
padding-top: 110rpx;
}
.title-name{
padding-top: 110rpx;
font-size: 36rpx;
font-weight: 700;
}
.title-search{
margin-top: 110rpx;
display: flex;
background: #fff;
height: 54rpx;
margin-left: 20rpx;
border-radius: 54rpx;
width: 370rpx;
input{
height: 54rpx;
line-height: 54rpx;
}
}
.title-sort{
height: 60rpx;
display: flex;
margin-top: 20rpx;
}
.sort-member{
line-height: 60rpx;
text-align: center;
background: #fff;
width: 20%;
margin-left: 4%;
border-radius: 10rpx;
}
.sort-value{
width: 160rpx;
height: auto;
max-height: 300rpx;
overflow: scroll;
background: rgba(0, 0, 0, 0.7);
position: absolute;
top: 80rpx;
right: 0;
border-radius: 20rpx;
color: #fff;
font-size: 22rpx;
}
.sort-value1{
border-bottom: 1rpx solid #eee;
}
.shop-list{
width: 95%;
height: auto;
margin: 0 auto;
}
.shop-member{
width: 100%;
height: auto;
border-radius: 20rpx;
background: #fff;
margin-bottom: 20rpx;
}
.shop-img{
width: 160rpx;
height: 160rpx;
position: relative;
img{
width: 100%;
background-size: 100%;
height: 100%;
}
}
.shop-top{
padding: 20rpx;
display: flex;
}
.shop-content{
flex: 1;
padding-left: 20rpx;
}
.shop-name{
font-size: 32rpx;
font-weight: 900;
}
.shop-content-center{
display: flex;
margin: 20rpx 0;
}
.shop-rate{
background: rgba(249, 212, 157, 0.34);
height: 40rpx;
display: flex;
border-radius: 20rpx;
padding: 0 10rpx 0 0;
}
.shop-rate-num{
width: 50rpx;
height: 100%;
text-align: center;
background: linear-gradient(90deg, rgba(255, 77, 0, 1), rgba(255, 184, 84, 1));
color: #fff;
line-height: 40rpx;
font-size: 22rpx;
border-bottom-left-radius: 20rpx;
border-top-left-radius: 20rpx;
border-bottom-right-radius: 10rpx;
border-top-right-radius: 10rpx;
}
.shop-tag{
flex: 1;
line-height: 40rpx;
text-align: right;
}
.shop-content-bottom{
display: flex;
}
.shop-deal{
flex:1;
}
.shop-bottom{
border-top: 2rpx solid #eee;
width: 100%;
overflow-x: scroll;
display: flex;
height: 280rpx;
overflow-y: hidden;
}
.menu-member{
width: 140rpx;
height: 100%;
margin: 10rpx 0 0 20rpx;
}
.menu-img{
height: 140rpx;
width: 140rpx;
img{
width: 100%;
height: 100%;
background-size: 100%;
}
}
.menu-content{
font-size: 22rpx;
}
.shop-menu-name{
margin-top: 10rpx;
font-weight: 700;
}
.shop-menu-price{
margin-top: 6rpx;
font-weight: 700;
}
.shop-menu-purchase{
display: flex;
background: rgba(255, 57, 57, 0.1);
height: 36rpx;
line-height: 36rpx;
padding: 0 0 0 4rpx;
border-radius: 8rpx;
font-weight: 700;
margin-top: 10rpx;
color: #777;
}
</style>

5
package2/myCenter/addGoods.vue

@ -93,10 +93,13 @@
</view>
</view>
</uni-forms-item>
<uni-forms-item label="设置加料" name="isMoreBuy">
<uni-forms-item label="拼团搭配" name="isMoreBuy">
<view style="line-height: 74rpx;">
<radio :checked="formData.isMoreBuy==0" name="isMoreBuy" @click="checkisMoreBuy('0')" />
<radio :checked="formData.isMoreBuy==1" name="isMoreBuy" @click="checkisMoreBuy('1')" />
<view style="font-size: 24rpx;color: #999;line-height: 36rpx;">
拼团商品下单时可搭配该商品一并下单
</view>
</view>
</uni-forms-item>
<uni-forms-item label="餐盒费" name="lunchBox">

404
package2/shop/businessInfo.vue

@ -1,99 +1,72 @@
<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="hero">
<view class="hero-title">经营管理</view>
<view class="hero-subtitle">同步后台商家管理字段可直接维护营业规则</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 class="form-wrap">
<view class="content">
<view class="section-title">营业设置</view>
<view class="value">
<view class="name">营业开始时间</view>
<view class="text">
<picker mode="time" :value="shop.businessHourBegin" start="00:00" end="23:59"
@change="bindTimeChange($event,'businessHourBegin')">
<view class="picker-text" :class="{ placeholder: !shop.businessHourBegin }">
{{shop.businessHourBegin || '请选择开始时间'}}
<uni-icons type="bottom" size="14" color="#999"></uni-icons>
</view>
</picker>
</view>
</view>
<view class="list-right">
{{shop.type}}
<view class="value">
<view class="name">营业结束时间</view>
<view class="text">
<picker mode="time" :value="shop.businessHourEnd" start="00:00" end="23:59"
@change="bindTimeChange($event,'businessHourEnd')">
<view class="picker-text" :class="{ placeholder: !shop.businessHourEnd }">
{{shop.businessHourEnd || '请选择结束时间'}}
<uni-icons type="bottom" size="14" color="#999"></uni-icons>
</view>
</picker>
</view>
</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 class="value">
<view class="name">营业状态</view>
<view class="text">
<picker :range="statusList" range-key="text" @change="statusChange">
<view class="picker-text">
{{statusText}}
<uni-icons type="bottom" size="14" color="#999"></uni-icons>
</view>
</picker>
</view>
</view>
</view>
<view class="list-1">
<view class="list-name">
排名
<button :loading="submitLoading" @tap="submit">保存</button>
<view class="content">
<view class="section-title">经营信息</view>
<view class="value">
<view class="name">拼团佣金</view>
<view class="text">{{shop.commissionRateMore || 0}}%</view>
</view>
<view class="list-right">
{{shop.shoprank == undefined?'0':shop.shoprank}}
<view class="value">
<view class="name">单独购买佣金</view>
<view class="text">{{shop.commissionRateOne || 0}}%</view>
</view>
</view>
<view class="list-1">
<view class="list-name">
是否价格锁定
<view class="value">
<view class="name">经营品类</view>
<view class="text">{{shop.type || '暂无'}}</view>
</view>
<view class="list-right">
{{shop.isPriceLock== 0?'是':'否'}}
<view class="value">
<view class="name">出餐时间</view>
<view class="text">{{shop.cookingTime || 0}}分钟</view>
</view>
</view>
</view>
<view class="list-box">
<view class="list-2" @click="submit">
保存
</view>
</view>
</view>
</template>
@ -101,57 +74,111 @@
export default {
data() {
return {
shop: {}
shop: {
shopId: '',
shopName: '',
businessHourBegin: '',
businessHourEnd: '',
status: 0,
commissionRateMore: '',
commissionRateOne: '',
type: '',
isDelivery: 0,
cookingTime: ''
},
submitLoading: false,
statusList: [{
value: 0,
text: '正常营业'
}, {
value: 1,
text: '暂停营业'
}, {
value: 2,
text: '冻结'
}]
}
},
computed: {
statusText() {
const item = this.statusList.find(item => item.value == this.shop.status)
return item ? item.text : '正常营业'
}
},
onLoad() {
this.getShopMsg()
},
methods: {
getShopMsg() {
this.tui.request("/app/shoptakeaway/getByShopId", "get", {
shopId: uni.getStorageSync('shopId')
const shopId = uni.getStorageSync('shopId')
if (!shopId) {
this.tui.toast('未获取到店铺信息')
return
}
this.tui.request('/app/shoptakeaway/getByShopId', 'get', {
shopId: shopId
}, false, true).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];
}
}
const result = res.result || {}
this.shop = Object.assign({}, this.shop, result, {
shopId: result.shopId || shopId,
shopName: result.shopName || uni.getStorageSync('shopName') || '',
status: result.status == null ? 0 : Number(result.status),
isDelivery: result.isDelivery == null ? 0 : Number(result.isDelivery)
})
} else {
this.tui.toast(res.message)
}
uni.hideLoading()
}).catch((res) => {})
}).catch(() => {
uni.hideLoading()
})
},
bindTimeChange(e, type) {
if (type == 'start') {
this.shop.businessHourBegin = e.detail.value
} else {
this.shop.businessHourEnd = e.detail.value
}
bindTimeChange(e, key) {
this.shop[key] = e.detail.value
},
statusChange(e) {
const item = this.statusList[e.detail.value]
if (item) this.shop.status = item.value
},
validateForm() {
if (!this.shop.businessHourBegin) return '请选择营业开始时间'
if (!this.shop.businessHourEnd) return '请选择营业结束时间'
return ''
},
submit() {
this.tui.request("/app/shoptakeaway/update", "POST", this.shop, false, true).then((res) => {
const error = this.validateForm()
if (error) {
this.tui.toast(error)
return
}
const payload = {
id: this.shop.id,
shopId: this.shop.shopId || uni.getStorageSync('shopId'),
businessHourBegin: this.shop.businessHourBegin,
businessHourEnd: this.shop.businessHourEnd,
status: Number(this.shop.status)
}
this.submitLoading = true
this.tui.request('/app/shoptakeaway/update', 'POST', payload, false, true).then((res) => {
this.submitLoading = false
if (res.code == 200) {
uni.showModal({
title: '提示',
content: '更新信息成功',
content: '经营信息已更新',
showCancel: false,
success: function(res) {
if (res.confirm) {
uni.navigateBack()
}
success: (modalRes) => {
if (modalRes.confirm) uni.navigateBack()
}
});
})
} else {
this.tui.toast(res.message)
}
uni.hideLoading()
}).catch((res) => {})
}).catch(() => {
this.submitLoading = false
uni.hideLoading()
})
}
}
}
@ -161,67 +188,150 @@
page,
.page1 {
width: 100%;
height: 100%;
font-size: 28rpx;
background: #eee;
min-height: 100%;
font-size: 24rpx;
color: #12342d;
background:
radial-gradient(circle at 92% 120rpx, rgba(166, 255, 234, 0.45) 0, rgba(166, 255, 234, 0) 240rpx),
linear-gradient(180deg, #f3fff6 0%, #f5f8f5 36%, #eef4f1 100%);
overflow: scroll;
}
.list-box {
.hero {
position: relative;
width: 100%;
height: auto;
background: #fff;
margin-top: 20rpx;
height: 260rpx;
padding: 58rpx 42rpx 0;
box-sizing: border-box;
overflow: hidden;
background:
linear-gradient(135deg, rgba(227, 255, 150, 0.95) 0%, rgba(166, 255, 234, 0.86) 58%, rgba(255, 255, 255, 0.72) 100%),
url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/8bc15960c2dc40268e295d6dd23aecce.png') center/cover no-repeat;
}
.hero::after {
content: "";
position: absolute;
right: -34rpx;
top: -44rpx;
width: 290rpx;
height: 290rpx;
border-radius: 50%;
background: rgba(255, 255, 255, 0.32);
}
.list-1 {
display: flex;
.hero-title {
position: relative;
z-index: 1;
font-size: 46rpx;
line-height: 64rpx;
font-weight: 900;
letter-spacing: 2rpx;
color: #07362d;
}
.hero-subtitle {
position: relative;
z-index: 1;
margin-top: 12rpx;
font-size: 26rpx;
font-weight: 600;
color: rgba(0, 35, 28, 0.62);
}
.form-wrap {
position: relative;
z-index: 2;
width: 92%;
margin: -54rpx auto 0;
padding-bottom: 40rpx;
}
.content {
width: 100%;
height: 100rpx;
line-height: 100rpx;
border-bottom: 1px solid #eee;
margin-bottom: 24rpx;
overflow: hidden;
border: 1rpx solid rgba(255, 255, 255, 0.86);
border-radius: 28rpx;
background: rgba(255, 255, 255, 0.96);
box-shadow: 0 16rpx 36rpx rgba(0, 35, 28, 0.08);
}
.section-title {
height: 92rpx;
line-height: 92rpx;
padding: 0 28rpx;
border-bottom: 1rpx solid #edf3f0;
font-size: 30rpx;
font-weight: 900;
color: #102f28;
}
.list-2 {
.value {
width: 100%;
height: 100rpx;
line-height: 100rpx;
text-align: center;
border-bottom: 1px solid #eee;
min-height: 96rpx;
display: flex;
align-items: center;
border-top: 1rpx solid #edf3f0;
padding: 0 28rpx;
box-sizing: border-box;
}
.list-icon {
width: 100rpx;
height: 100rpx;
text-align: center;
.section-title + .value {
border-top: none;
}
.list-name {
flex: 1;
padding-left: 20rpx;
.name {
width: 210rpx;
font-size: 28rpx;
font-weight: 800;
color: #153c34;
}
.list-right {
.text {
flex: 1;
height: 100rpx;
min-width: 0;
text-align: right;
color: #263f39;
font-size: 28rpx;
}
.text input {
height: 96rpx;
line-height: 96rpx;
text-align: right;
padding-right: 20rpx;
font-size: 28rpx;
color: #263f39;
}
.picker-text {
min-height: 96rpx;
line-height: 96rpx;
font-size: 28rpx;
color: #263f39;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.upload-img {
width: 60rpx;
height: 60rpx;
background-size: 100%;
margin-top: 20rpx;
.picker-text.placeholder {
color: #9aa7a3;
}
.list-2 {
button {
width: 100%;
height: 100rpx;
line-height: 100rpx;
text-align: center;
border-bottom: 1px solid #eee;
height: 96rpx;
line-height: 96rpx;
margin: 44rpx auto 12rpx;
border-radius: 999rpx;
background: linear-gradient(90deg, #e3ff96 0%, #a6ffea 100%);
color: #00231c;
font-size: 34rpx;
font-weight: 900;
box-shadow: 0 18rpx 36rpx rgba(0, 35, 28, 0.14);
}
button::after {
border: none;
}
</style>
</style>

1
package2/shop/merchantCenter.vue

@ -772,4 +772,5 @@
line-height: 40rpx;
font-weight: 700;
}
</style>
</style>

857
package2/shop/shopInfo.vue

@ -1,170 +1,78 @@
<template>
<view class="page1">
<view class="list-box">
<view class="list-1">
<view class="list-name">
门头图
</view>
<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">
<view class="list-name">
店铺名称
</view>
<view class="list-right">
{{shop.shopName}}
</view>
</view>
<view class="list-1">
<view class="list-name">
副标题
</view>
<view class="list-right">
<input type="text" placeholder="请输入副标题" v-model="shop.subtitle" style="height: 100rpx;line-height: 100rpx;" />
</view>
</view>
<view class="list-1" style="height: auto;">
<view class="list-name">
店铺地址
</view>
<view class="list-right" style="line-height: 20px;margin-top: 15px;">
{{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">
<image :src="shopImages[0]" mode="" class="upload-img"></image>
</view>
</view>
<view class="list-1">
<view class="list-name">
营业执照
</view>
<view class="list-right">
<image :src="shopImages[2]" mode="" class="upload-img"></image>
</view>
</view>
<view class="list-1">
<view class="list-name">
补充证照
</view>
<view class="list-right">
<image :src="huanjing" mode="" class="upload-img"></image>
</view>
</view>
<view class="list-1">
<view class="list-name">
支付宝账号
</view>
<view class="list-right">
<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">
<input type="text" placeholder="请输入支付宝账号" v-model="shop.aliName" style="height: 100rpx;line-height: 100rpx;" />
</view>
</view>
<view class="hero">
<view class="hero-title">店铺资料</view>
<view class="hero-subtitle">维护副标题联系方式和收款信息</view>
</view>
<view class="list-box">
<view class="section-title">商家自配送</view>
<view class="list-1">
<view class="list-name">支持自配送</view>
<view class="list-right">
<label class="radio" style="padding-right: 20rpx;" @tap="setSelfDelivery(1)">
<radio :checked="shop.supportShopDelivery == 1" /><text></text>
</label>
<label class="radio" @tap="setSelfDelivery(0)">
<radio :checked="shop.supportShopDelivery == 0" /><text></text>
</label>
<view class="form-wrap">
<view class="content">
<view class="section-title">可编辑信息</view>
<view class="value">
<view class="name">副标题</view>
<view class="text">
<input type="text" v-model="shop.subtitle" maxlength="24" placeholder="请输入副标题" />
</view>
</view>
</view>
<block v-if="shop.supportShopDelivery == 1">
<view class="list-1">
<view class="list-name">配送费</view>
<view class="list-right">
<input type="digit" v-model="shop.orderBkge" placeholder="默认0,最多1位小数" @blur="formatOrderBkge" />
<view class="value">
<view class="name">联系方式</view>
<view class="text">
<input type="text" v-model="shop.contactPhone" maxlength="16" placeholder="请输入联系方式" />
</view>
</view>
<view class="list-1">
<view class="list-name">送达位置</view>
<view class="list-right">
<picker :range="deliveryLocationList" range-key="text" @change="deliveryLocationChange">
<view>{{deliveryLocationText || '请选择'}}</view>
</picker>
<view class="value">
<view class="name">支付宝账号</view>
<view class="text">
<input type="text" v-model="shop.aliAccount" maxlength="32" placeholder="请输入支付宝账号" />
</view>
</view>
<view class="list-1">
<view class="list-name">配送时长</view>
<view class="list-right">
<input type="number" v-model="shop.shopDeliveryDuration" placeholder="分钟" />
<view class="value">
<view class="name">支付宝实名</view>
<view class="text">
<input type="text" v-model="shop.aliName" maxlength="16" placeholder="请输入支付宝实名" />
</view>
</view>
<view class="list-1">
<view class="list-name">配送员账号</view>
<view class="list-right worker-query">
<input type="number" v-model="workerMobile" placeholder="输入手机号" />
<view class="query-btn" @tap="findWorker">查询</view>
</view>
<button :loading="submitLoading" @tap="submit">保存</button>
<view class="content">
<view class="section-title">基础信息</view>
<view class="value image-row">
<view class="name">门头图</view>
<view class="text image-cell">
<view class="upload-img" v-if="!shop.shopIcon">
<uni-icons type="image" size="28" color="#777"></uni-icons>
</view>
<image :src="shop.shopIcon" v-else mode="aspectFill" class="upload-img"></image>
</view>
</view>
<view class="list-1" v-if="shop.workerId">
<view class="list-name">已绑定</view>
<view class="list-right">{{shop.workerName}} {{shop.workerPhone}}</view>
<view class="value">
<view class="name">店铺名称</view>
<view class="text">{{shop.shopName || '暂无'}}</view>
</view>
</block>
</view>
<view class="list-box">
<view class="section-title">中转配送</view>
<view class="list-1">
<view class="list-name">支持中转配送</view>
<view class="list-right">
<label class="radio" style="padding-right: 20rpx;" @tap="setTransferDelivery(1)">
<radio :checked="shop.supportTransferDelivery == 1" /><text></text>
</label>
<label class="radio" @tap="setTransferDelivery(0)">
<radio :checked="shop.supportTransferDelivery == 0" /><text></text>
</label>
<view class="value">
<view class="name">店铺分类</view>
<view class="text">{{currentShopTypeText || '暂无'}}</view>
</view>
</view>
<block v-if="shop.supportTransferDelivery == 1">
<view class="list-1">
<view class="list-name">中转时长</view>
<view class="list-right">
<input type="number" v-model="shop.transferDeliveryDuration" placeholder="分钟" />
</view>
<view class="value">
<view class="name">所属区域</view>
<view class="text">{{currentRegionText || '暂无'}}</view>
</view>
<view class="list-1">
<view class="list-name">中转地点</view>
<view class="list-right">
<picker :range="addressList" range-key="text" @change="transferAddressChange">
<view>{{shop.transferAddressName || '请选择'}}</view>
</picker>
<view class="value textarea-row">
<view class="name">店铺地址</view>
<view class="text">{{shop.shopAddress || '暂无'}}</view>
</view>
</view>
<view class="content" v-if="certificateImages.length">
<view class="section-title">认证资料</view>
<view class="cert-grid">
<view class="cert-item" v-for="(item,index) in certificateImages" :key="index" @tap="previewImage(item)">
<image :src="item" mode="aspectFill"></image>
<text>{{certificateNames[index] || '补充资料'}}</text>
</view>
</view>
</block>
</view>
<view class="list-box">
<view class="list-2" @click="submit">
保存
</view>
</view>
</view>
@ -174,360 +82,439 @@
export default {
data() {
return {
shop:{},
shopImages:[],
huanjing:'',
workerMobile:'',
addressList:[],
deliveryLocationList:[{
value: 1,
text: '送到宿舍'
},{
value: 2,
text: '送到楼下'
}]
shop: {},
shopTypeList: [],
submitLoading: false,
certificateImages: [],
certificateNames: ['身份证正面', '身份证反面', '营业执照', '补充证照']
}
},
computed:{
deliveryLocationText(){
let item = this.deliveryLocationList.find(item => item.value == this.shop.shopDeliveryLocation)
return item ? item.text : ''
computed: {
currentRegionText() {
return this.shop.shopAreaTitle || this.shop.region || ''
},
currentShopTypeText() {
return this.shop.shopTypeTitle || this.getShopTypeText(this.shop.shopType) || ''
}
},
onLoad() {
let shopList = uni.getStorageSync('schoolShop')
for(let i=0;i<shopList.length;i++){
if(shopList[i].shopName == uni.getStorageSync('shopName')){
this.shop = shopList[i]
}
}
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];
}
}
if(this.shop.supportShopDelivery == null) this.shop.supportShopDelivery = 0
if(this.shop.orderBkge == null) this.shop.orderBkge = 0
if(this.shop.supportTransferDelivery == null) this.shop.supportTransferDelivery = 0
this.workerMobile = this.shop.workerPhone || ''
this.getRegionList()
this.getShopTypeList()
this.getShopMsg()
},
methods: {
navigatorTo(e){
let url = ""
if(e=='addgoods'){
url = '/package1/myCenter/addGoods'
}else if(e=='merchant'){
url = '/package1/myCenter/myMerchant'
}else if(e == 'xiugaixinxi'){
url = '/pages/myCenter/shopDetail'
}
uni.navigateTo({
url: url
})
getShopId() {
return this.shop.id || uni.getStorageSync('shopId') || ''
},
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)
}
getShopMsg() {
const shopId = uni.getStorageSync('shopId')
if (!shopId) {
this.applyShop(this.getCachedShop())
return
}
let regionId = ''
try {
const area = uni.getStorageSync('area')
regionId = area ? JSON.parse(area).id : ''
} catch (e) {}
this.tui.request('/app/shop/getShopInfoById', 'POST', {
id: shopId,
regionId: regionId
}, false, true).then((res) => {
if (res.code == 200 && res.result) {
this.applyShop(this.normalizeShopResult(res.result))
} else {
this.applyShop(this.getCachedShop())
if (res.message) this.tui.toast(res.message)
}
uni.hideLoading()
}).catch(() => {
this.applyShop(this.getCachedShop())
uni.hideLoading()
})
},
async upLoadFile(path,type) {
let that = this;
let hiver_token = uni.getStorageSync("hiver_token")
await uni.uploadFile({
url: that.tui.interfaceUrl() + '/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)
normalizeShopResult(result) {
if (result.shop) {
const data = Object.assign({}, result.shop, result)
delete data.shop
return data
}
return result || {}
},
setSelfDelivery(type){
this.shop.supportShopDelivery = type
if(type != 1){
this.shop.orderBkge = 0
this.shop.shopDeliveryLocation = ''
this.shop.shopDeliveryDuration = ''
this.shop.workerId = ''
this.shop.workerName = ''
this.shop.workerPhone = ''
this.workerMobile = ''
getCachedShop() {
const shopList = uni.getStorageSync('schoolShop') || []
const shopId = uni.getStorageSync('shopId')
if (Array.isArray(shopList)) {
const item = shopList.find(shop => shop.id == shopId || shop.shopName == uni.getStorageSync('shopName'))
if (item) return item
}
return uni.getStorageSync('shop') || {
id: shopId,
shopName: uni.getStorageSync('shopName') || '',
shopIcon: uni.getStorageSync('shopIcon') || ''
}
},
setTransferDelivery(type){
this.shop.supportTransferDelivery = type
if(type != 1){
this.shop.transferDeliveryDuration = ''
this.shop.transferAddressId = ''
this.shop.transferAddressName = ''
applyShop(data) {
const shop = Object.assign({
id: '',
shopName: '',
shopIcon: '',
shopType: '',
shopTypeTitle: '',
subtitle: '',
shopAddress: '',
contactPhone: '',
aliAccount: '',
aliName: '',
remark: '',
shopArea: '',
shopAreaTitle: '',
regionId: '',
region: ''
}, data || {})
Object.keys(shop).forEach(key => {
if (shop[key] === null) shop[key] = ''
})
this.shop = shop
this.parseShopImages(shop.shopImages)
},
parseShopImages(value) {
const list = []
if (!value) {
this.certificateImages = []
return
}
const parts = String(value).split('@@')
parts.forEach((item, index) => {
if (!item) return
if (index == 3) {
try {
const extra = JSON.parse(item)
if (Array.isArray(extra)) {
extra.forEach(url => {
if (url) list.push(url)
})
}
} catch (e) {}
} else {
list.push(item)
}
})
this.certificateImages = list
},
getRegionList(){
this.tui.request('/app/shopArea/getByParentId/0', 'get', {}, false, false, true).then((res) => {
if (res.code !== 200) return
this.addressList = (Array.isArray(res.result) ? res.result : []).map(item => {
getShopTypeList() {
this.tui.request('/dictData/getByCondition', 'GET', {
sort: 'sortOrder',
order: 'asc',
dictId: '1712359407444168704'
}, false, false, true).then((res) => {
if (res.code != 200) return
const content = res.result && res.result.content ? res.result.content : []
this.shopTypeList = content.map(item => {
return {
value: item.id,
text: item.title || item.name || item.regionName || item.areaName || '未命名区域'
value: item.value,
text: item.title
}
})
if (this.shop.shopType && !this.shop.shopTypeTitle) {
this.shop.shopTypeTitle = this.getShopTypeText(this.shop.shopType)
}
})
},
transferAddressChange(e){
const item = this.addressList[e.detail.value]
if(item){
this.shop.transferAddressId = item.value
this.shop.transferAddressName = item.text
}
getShopTypeText(value) {
const item = this.shopTypeList.find(item => item.value == value || item.text == value)
return item ? item.text : value
},
formatOrderBkge(){
let value = parseFloat(this.shop.orderBkge || 0)
if(isNaN(value) || value < 0) value = 0
this.shop.orderBkge = Number(value.toFixed(1))
},
deliveryLocationChange(e){
const item = this.deliveryLocationList[e.detail.value]
if(item){
this.shop.shopDeliveryLocation = item.value
}
normalizeId(value) {
return String(value || '').split(',')[0]
},
findWorker(){
if(!this.workerMobile){
this.tui.toast('请输入配送员手机号')
return
}
this.tui.request('/app/shop/findWorkerByMobile', 'GET', {
mobile: this.workerMobile
}, false, true).then((res) => {
if(res.code == 200){
this.shop.workerId = res.result.workerId
this.shop.workerName = res.result.workerName
this.shop.workerPhone = res.result.workerPhone || res.result.mobile
this.tui.toast('绑定成功')
}else{
this.tui.toast(res.message)
}
previewImage(url) {
if (!url) return
uni.previewImage({
current: url,
urls: this.certificateImages
})
},
normalizeSelfDelivery(){
if(this.shop.supportShopDelivery != 1){
this.setSelfDelivery(0)
return true
}
this.formatOrderBkge()
if(!this.shop.shopDeliveryLocation){
this.tui.toast('请选择送达位置')
return false
}
if(!this.shop.shopDeliveryDuration){
this.tui.toast('请输入配送时长')
return false
}
if(!this.shop.workerId){
this.tui.toast('请绑定配送员')
return false
}
return true
validateShop() {
if (!this.shop.shopArea) return '店铺区域信息缺失,请重新进入页面后再保存'
if (!this.shop.contactPhone) return '请输入联系方式'
if (!this.shop.aliAccount) return '请输入支付宝账号'
if (!this.shop.aliName) return '请输入支付宝实名'
return ''
},
normalizeTransferDelivery(){
if(this.shop.supportTransferDelivery != 1){
this.setTransferDelivery(0)
return true
}
if(!this.shop.transferDeliveryDuration){
this.tui.toast('请输入中转配送时长')
return false
}
if(!this.shop.transferAddressId){
this.tui.toast('请选择中转地点')
return false
}
this.shop.transferDeliveryDuration = parseInt(this.shop.transferDeliveryDuration || 0)
return true
},
updateLocalShopCache(){
updateLocalShopCache() {
let shopList = uni.getStorageSync('schoolShop') || []
if(Array.isArray(shopList)){
if (Array.isArray(shopList)) {
shopList = shopList.map(item => item.id == this.shop.id ? Object.assign({}, item, this.shop) : item)
uni.setStorageSync('schoolShop', shopList)
}
uni.setStorageSync('shop', this.shop)
uni.setStorageSync('shopName', this.shop.shopName)
uni.setStorageSync('shopIcon', this.shop.shopIcon)
},
submit(){
if(!this.normalizeSelfDelivery()) return
if(!this.normalizeTransferDelivery()) return
this.tui.request("/app/shop/updateSelfDelivery", "post", {
id: this.shop.id,
supportShopDelivery: this.shop.supportShopDelivery,
orderBkge: this.shop.orderBkge,
shopDeliveryLocation: this.shop.shopDeliveryLocation,
shopDeliveryDuration: this.shop.shopDeliveryDuration,
workerId: this.shop.workerId,
workerName: this.shop.workerName,
workerPhone: this.shop.workerPhone
}, false, true).then((deliveryRes) => {
if (deliveryRes.code != 200) {
this.tui.toast(deliveryRes.message)
return Promise.reject(deliveryRes)
}
return this.tui.request("/app/shop/updateTransferDelivery", "post", {
id: this.shop.id,
supportTransferDelivery: this.shop.supportTransferDelivery,
transferDeliveryDuration: this.shop.transferDeliveryDuration,
transferAddressId: this.shop.transferAddressId,
transferAddressName: this.shop.transferAddressName
}, false, true)
}).then((transferRes) => {
if (transferRes.code != 200) {
this.tui.toast(transferRes.message)
return Promise.reject(transferRes)
}
return this.tui.request("/app/shop/edit", "PUT", this.shop, false, true)
}).then((res) => {
submit() {
const error = this.validateShop()
if (error) {
this.tui.toast(error)
return
}
const shopId = this.getShopId()
const payload = {
id: this.normalizeId(shopId),
shopArea: this.normalizeId(this.shop.shopArea),
subtitle: this.shop.subtitle,
contactPhone: this.shop.contactPhone,
aliAccount: this.shop.aliAccount,
aliName: this.shop.aliName
}
const query = Object.keys(payload).map(key => {
return key + '=' + encodeURIComponent(payload[key] == null ? '' : payload[key])
}).join('&')
this.submitLoading = true
this.tui.request('/app/shop/edit?' + query, 'PUT', {}, false, true).then((res) => {
this.submitLoading = false
if (res.code == 200) {
this.updateLocalShopCache()
uni.showModal({
title: '提示',
content: '更新信息成功',
showCancel:false,
success: (res) => {
if (res.confirm) {
uni.navigateBack()
}
content: '店铺资料已更新',
showCancel: false,
success: (modalRes) => {
if (modalRes.confirm) uni.navigateBack()
}
});
})
} else {
this.tui.toast(res.message)
}
uni.hideLoading()
}).catch((res) => {})
}).catch(() => {
this.submitLoading = false
uni.hideLoading()
})
}
}
}
</script>
<style>
page,.page1{
page,
.page1 {
width: 100%;
height: 100%;
font-size: 28rpx;
background: #eee;
min-height: 100%;
font-size: 24rpx;
color: #12342d;
background:
radial-gradient(circle at 92% 120rpx, rgba(166, 255, 234, 0.45) 0, rgba(166, 255, 234, 0) 240rpx),
linear-gradient(180deg, #f3fff6 0%, #f5f8f5 36%, #eef4f1 100%);
overflow: scroll;
}
.list-box{
.hero {
position: relative;
width: 100%;
height: auto;
background: #fff;
margin-top: 20rpx;
height: 260rpx;
padding: 58rpx 42rpx 0;
box-sizing: border-box;
overflow: hidden;
background:
linear-gradient(135deg, rgba(227, 255, 150, 0.95) 0%, rgba(166, 255, 234, 0.86) 58%, rgba(255, 255, 255, 0.72) 100%),
url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/8bc15960c2dc40268e295d6dd23aecce.png') center/cover no-repeat;
}
.hero::after {
content: "";
position: absolute;
right: -34rpx;
top: -44rpx;
width: 290rpx;
height: 290rpx;
border-radius: 50%;
background: rgba(255, 255, 255, 0.32);
}
.section-title{
height: 88rpx;
line-height: 88rpx;
padding-left: 20rpx;
font-weight: 700;
border-bottom: 1px solid #eee;
.hero-title {
position: relative;
z-index: 1;
font-size: 46rpx;
line-height: 64rpx;
font-weight: 900;
letter-spacing: 2rpx;
color: #07362d;
}
.list-1{
display: flex;
.hero-subtitle {
position: relative;
z-index: 1;
margin-top: 12rpx;
font-size: 26rpx;
font-weight: 600;
color: rgba(0, 35, 28, 0.62);
}
.form-wrap {
position: relative;
z-index: 2;
width: 92%;
margin: -54rpx auto 0;
padding-bottom: 40rpx;
}
.content {
width: 100%;
height: 100rpx;
line-height: 100rpx;
border-bottom: 1px solid #eee;
margin-bottom: 24rpx;
overflow: hidden;
border: 1rpx solid rgba(255, 255, 255, 0.86);
border-radius: 28rpx;
background: rgba(255, 255, 255, 0.96);
box-shadow: 0 16rpx 36rpx rgba(0, 35, 28, 0.08);
}
.list-2{
.section-title {
height: 92rpx;
line-height: 92rpx;
padding: 0 28rpx;
border-bottom: 1rpx solid #edf3f0;
font-size: 30rpx;
font-weight: 900;
color: #102f28;
}
.value {
width: 100%;
height: 100rpx;
line-height: 100rpx;
text-align: center;
border-bottom: 1px solid #eee;
min-height: 96rpx;
display: flex;
align-items: center;
border-top: 1rpx solid #edf3f0;
padding: 0 28rpx;
box-sizing: border-box;
}
.list-icon{
width: 100rpx;
height: 100rpx;
text-align: center;
.section-title + .value {
border-top: none;
}
.list-name{
flex: 1;
padding-left: 20rpx;
.name {
width: 210rpx;
font-size: 28rpx;
font-weight: 800;
color: #153c34;
}
.list-right{
.text {
flex: 1;
height: 100rpx;
min-width: 0;
text-align: right;
padding-right: 20rpx;
overflow: hidden;
color: #263f39;
font-size: 28rpx;
}
.list-right input{
height: 100rpx;
line-height: 100rpx;
.text input {
height: 96rpx;
line-height: 96rpx;
text-align: right;
font-size: 28rpx;
color: #263f39;
}
.text textarea {
width: 100%;
height: 132rpx;
line-height: 42rpx;
padding-top: 18rpx;
text-align: right;
font-size: 28rpx;
color: #263f39;
}
.textarea-row {
align-items: flex-start;
padding-top: 20rpx;
padding-bottom: 18rpx;
}
.textarea-row .name {
line-height: 60rpx;
}
.picker-text {
min-height: 96rpx;
line-height: 96rpx;
font-size: 28rpx;
color: #263f39;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.worker-query{
.picker-text.placeholder {
color: #9aa7a3;
}
.image-row {
min-height: 212rpx;
}
.image-cell {
display: flex;
align-items: center;
justify-content: flex-end;
}
.worker-query input{
flex: 1;
min-width: 0;
.upload-img {
width: 172rpx;
height: 172rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 24rpx;
background: #f6faf8;
border: 1rpx dashed rgba(11, 155, 115, 0.26);
box-shadow: inset 0 0 0 1rpx rgba(255, 255, 255, 0.8);
}
.query-btn{
margin-left: 12rpx;
padding: 0 18rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 28rpx;
background: #0b9b73;
color: #fff;
font-size: 24rpx;
.cert-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 18rpx;
padding: 24rpx;
box-sizing: border-box;
}
.upload-img{
width:60rpx;
height: 60rpx;
background-size: 100%;
margin-top: 20rpx;
.cert-item {
overflow: hidden;
border-radius: 22rpx;
background: #f6faf8;
border: 1rpx solid #edf3f0;
}
.list-2{
.cert-item image {
width: 100%;
height: 100rpx;
line-height: 100rpx;
height: 180rpx;
display: block;
}
.cert-item text {
display: block;
height: 58rpx;
line-height: 58rpx;
text-align: center;
border-bottom: 1px solid #eee;
font-size: 24rpx;
font-weight: 800;
color: #153c34;
}
button {
width: 100%;
height: 96rpx;
line-height: 96rpx;
margin: 44rpx auto 12rpx;
border-radius: 999rpx;
background: linear-gradient(90deg, #e3ff96 0%, #a6ffea 100%);
color: #00231c;
font-size: 34rpx;
font-weight: 900;
box-shadow: 0 18rpx 36rpx rgba(0, 35, 28, 0.14);
}
button::after {
border: none;
}
</style>
</style>

Loading…
Cancel
Save