Browse Source

调整

master
梁欣 1 year ago
parent
commit
f8edfd8492
  1. 4
      api/category/index.js
  2. 17
      api/shop/navCategory/index.js
  3. 27
      components/page/diyComponents/navBar/index.vue
  4. 3
      components/page/index.vue
  5. 2
      components/shortcut/index.vue
  6. 7
      pages.json
  7. 15
      pages/checkout/index.vue
  8. 129
      pages/goods/detail.vue
  9. 12
      pages/goods/list.vue
  10. 129
      pages/index/index.vue
  11. 127
      pages/order/detail.vue
  12. 97
      pages/order/extract/check.vue
  13. 244
      pages/shop/list.vue
  14. 8
      pages/user/index.vue
  15. 22
      pages/user/shop/addgoods.vue
  16. 280
      pages/user/shop/goodsdetail.vue

4
api/category/index.js

@ -12,6 +12,6 @@ export function list(param) {
} }
export function shoplist() {
return request.get(api.shoplist)
export function shoplist(param) {
return request.get(api.shoplist, param)
} }

17
api/shop/navCategory/index.js

@ -0,0 +1,17 @@
import request from '@/utils/request'
// api地址
const api = {
list: 'shop.navCategory/list',
detail: 'shop.navCategory/detail',
}
// 页面数据
export function list() {
return request.get(api.list)
}
// 页面数据
export function detail(categoryId) {
return request.get(api.detail, {categoryId})
}

27
components/page/diyComponents/navBar/index.vue

@ -22,11 +22,11 @@
v-for="(item1, index1) in item" :key="index1" v-for="(item1, index1) in item" :key="index1"
:class="[(index1 === item.length - 1) && 'scroll-list__line__item--no-margin-right']"> :class="[(index1 === item.length - 1) && 'scroll-list__line__item--no-margin-right']">
<view class="item-image" style="display: flex;justify-content: center;align-items: center;">
<image class="image" mode="widthFix" :src="item1.imgUrl"></image>
<view class="item-image" style="display: flex;justify-content: center;align-items: center;"
:style="{background: showBg ? 'white' : 'transparent' }">
<image class="image" mode="widthFix" :src="item1.imgUrl" :style="{width: size, height: size}"></image>
</view> </view>
<view class="item-text oneline-hide" style="text-align: center;">{{ item1.text }}</view> <view class="item-text oneline-hide" style="text-align: center;">{{ item1.text }}</view>
</view> </view>
</view> </view>
</view> </view>
@ -49,7 +49,16 @@
itemIndex: String, itemIndex: String,
itemStyle: Object, itemStyle: Object,
params: Object, params: Object,
dataList: Array
dataList: Array,
showBg: {
type: Boolean,
default: false
},
size: {
type: String,
default: '88rpx'
},
}, },
mixins: [mixin], mixins: [mixin],
@ -58,9 +67,7 @@
* 组件的方法列表 * 组件的方法列表
* 更新属性和数据的方法与更新页面数据的方法类似 * 更新属性和数据的方法与更新页面数据的方法类似
*/ */
methods: {
}
methods: {}
} }
</script> </script>
@ -75,8 +82,12 @@
} }
.item-image { .item-image {
margin-bottom: 4px;
font-size: 0; font-size: 0;
width: 100rpx;
height: 100rpx;
background-color: white;
border-radius: 999px;
margin: 5px;
} }
.item-image .image { .item-image .image {

3
components/page/index.vue

@ -31,7 +31,8 @@
</block> </block>
<!-- 导航 --> <!-- 导航 -->
<block v-if="item.type === 'navBar'"> <block v-if="item.type === 'navBar'">
<NavBar :itemStyle="item.style" :params="item.params" :dataList="item.data" />
<NavBar :itemStyle="item.style" :params="item.params" :dataList="item.data"
:show-bg="index === 0" :size="index === 0 ? '70rpx' : '88rpx'"/>
</block> </block>
<!-- 商品 --> <!-- 商品 -->
<block v-if="item.type === 'goods'"> <block v-if="item.type === 'goods'">

2
components/shortcut/index.vue

@ -24,7 +24,7 @@
default: 20 default: 20
}, },
bottom: { bottom: {
type: Number,
type: Number | String,
default: 100 default: 100
} }
}, },

7
pages.json

@ -343,6 +343,13 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{
"path": "pages/shop/list",
"style": {
"navigationBarTitleText": "门店列表",
"navigationStyle": "custom"
}
},
{ {
"path": "pages/dealer/index", "path": "pages/dealer/index",
"style": { "style": {

15
pages/checkout/index.vue

@ -107,9 +107,11 @@
<gui-modal ref="guimodal" width="660rpx" :isCloseBtn="false" :title="Articles.title" <gui-modal ref="guimodal" width="660rpx" :isCloseBtn="false" :title="Articles.title"
:canCloseByShade='false' v-if="Articles"> :canCloseByShade='false' v-if="Articles">
<template v-slot:content> <template v-slot:content>
<view style="padding: 0 20rpx" class="gui-bg-gray">
<scroll-view scroll-y :style="{height:contentHeight+'px'}" class="gui-bg-gray gui-dark-bg-level-2"> <scroll-view scroll-y :style="{height:contentHeight+'px'}" class="gui-bg-gray gui-dark-bg-level-2">
<mp-html :content="Articles.content" /> <mp-html :content="Articles.content" />
</scroll-view> </scroll-view>
</view>
</template> </template>
<template v-slot:btns> <template v-slot:btns>
<view class="gui-flex gui-row gui-space-between"> <view class="gui-flex gui-row gui-space-between">
@ -310,9 +312,8 @@
options: {}, options: {},
// //
isShowTab: false, isShowTab: false,
DeliveryTypeEnum,
curDelivery: null, curDelivery: null,
contentHeight: 300,
contentHeight: 400,
// //
selectedShopId: 0, // ID selectedShopId: 0, // ID
linkman: '', // linkman: '', //
@ -337,8 +338,6 @@
goodsList: [], goodsList: [],
// //
couponList: [], couponList: [],
//
existAddress: false,
// //
address: null, address: null,
// //
@ -357,7 +356,7 @@
fwxydetail: '', fwxydetail: '',
yszcdetail: '', yszcdetail: '',
Articles: '', Articles: '',
radiochecked: false
radiochecked: true
} }
}, },
@ -366,6 +365,8 @@
*/ */
onLoad(options) { onLoad(options) {
this.options = options this.options = options
const {screenHeight} = uni.getSystemInfoSync()
this.contentHeight = screenHeight * 0.65;
// : // :
uni.$on('syncSelectedId', selectedId => { uni.$on('syncSelectedId', selectedId => {
this.selectedShopId = selectedId this.selectedShopId = selectedId
@ -388,10 +389,6 @@
// //
this.getOrderData() this.getOrderData()
}, },
mounted: function() {
var systemInfo = graceJS.system();
this.contentHeight = systemInfo.windowHeight * 0.65;
},
methods: { methods: {
radioChange() { radioChange() {
this.radiochecked = !this.radiochecked this.radiochecked = !this.radiochecked

129
pages/goods/detail.vue

@ -2,13 +2,11 @@
<gui-page v-if="!isLoading"> <gui-page v-if="!isLoading">
<view slot="gBody"> <view slot="gBody">
<view style="position: fixed;top:0;z-index: 99;height: 80rpx;overflow: hidden;width: 100%;"> <view style="position: fixed;top:0;z-index: 99;height: 80rpx;overflow: hidden;width: 100%;">
<view <view
style="position: fixed;z-index: 98;width: 100%;padding-left: 30rpx;background-color: #fff;padding: 10rpx 0;"
style="position: fixed;z-index: 98;width: 100%;background-color: #fff;padding: 10rpx 0;"
:style="{opacity : !headerClass? 0 : 1}"> :style="{opacity : !headerClass? 0 : 1}">
<gui-switch-navigation <gui-switch-navigation
:items="[{id:1,name:'商品'},{id:2,name:'购买须知'},{id:3,name:'评价'},{id:4,name:'详情'},{id:5,name:'推荐'}]"
:items="[{id:1,name:'商品'},{id:2,name:'购买须知'},{id:4,name:'详情'},{id:5,name:'推荐'}]"
@change="navchange" :currentIndex="navIndex" textAlign="center" :isCenter="true" @change="navchange" :currentIndex="navIndex" textAlign="center" :isCenter="true"
activeLineBg="linear-gradient(to right, #9E1A91, #4D0868)" activeDirection="center" :size="0" activeLineBg="linear-gradient(to right, #9E1A91, #4D0868)" activeDirection="center" :size="0"
:margin="10" padding="30rpx" :margin="10" padding="30rpx"
@ -16,40 +14,45 @@
</view> </view>
</view> </view>
<view style="position: relative;background-color: #fff;"> <view style="position: relative;background-color: #fff;">
<!-- 页面主体区域 01 --> <!-- 页面主体区域 01 -->
<view class="mainitems"> <view class="mainitems">
<view style="position: relative;"> <view style="position: relative;">
<view class="a" style="width: 750rpx;height: 562rpx; background-color: #fff; z-index: 1;">
<view class="a" style="width: 750rpx;height: 562rpx; background-color: #fff; z-index: 1;"
id="slide">
<SlideImage :video="goods.video" :videoCover="goods.videoCover" <SlideImage :video="goods.video" :videoCover="goods.videoCover"
:images="goods.goods_images"/> :images="goods.goods_images"/>
<button @click="onShowShareSheet()" <button @click="onShowShareSheet()"
style="z-index: 998;position: absolute;top: 20rpx;right: 20rpx;padding: 10rpx 20rpx;background:linear-gradient(to right, #9E1A91, #4D0868;font-size: 23rpx;color: #fff;border-radius: 30rpx; line-height: 30rpx;">分享</button>
style="z-index: 998;position: absolute;top: 20rpx;right: 20rpx;padding: 10rpx 20rpx;background:linear-gradient(to right, #9E1A91, #4D0868);font-size: 23rpx;color: #fff;border-radius: 30rpx; line-height: 30rpx;">
分享
</button>
</view> </view>
<view class="b boxbb" <view class="b boxbb"
style="position: absolute; top: 580rpx; left: 0; width: 100%; z-index: 1;padding: 0 20rpx;min-height: 140rpx;"> style="position: absolute; top: 580rpx; left: 0; width: 100%; z-index: 1;padding: 0 20rpx;min-height: 140rpx;">
<view style="background-color: #fff;padding: 20rpx;border-radius: 10rpx;">
<view style="background-color: #fff;padding: 20rpx;border-radius: 10rpx;" id="goodsWrap">
<view class="gui-flex gui-row gui-nowrap gui-align-items-center gui-space-between"> <view class="gui-flex gui-row gui-nowrap gui-align-items-center gui-space-between">
<view><text
style="font-size: 32rpx;font-weight: bold;color: #b53190;">{{ goods.goods_price_min }}</text>
<view>
<text
style="font-size: 32rpx;font-weight: bold;color: #b53190;">
{{ goods.goods_price_min }}
</text>
<text v-if="goods.line_price_min > 0" class="original-price" <text v-if="goods.line_price_min > 0" class="original-price"
style="margin-left: 10rpx;">{{ goods.line_price_min }}</text>
style="margin-left: 10rpx;">{{ goods.line_price_min }}
</text>
</view> </view>
<view style="color: #9e9e9e;font-size: 23rpx;">已售{{ goods.goods_sales }}</view> <view style="color: #9e9e9e;font-size: 23rpx;">已售{{ goods.goods_sales }}</view>
</view> </view>
<view style="font-size: 20rpx;"> <view style="font-size: 20rpx;">
<text></text>未预约未核销随时退
<text></text>
未预约未核销随时退
</view> </view>
<view style="margin: 10rpx 0;font-weight: bold;"> <view style="margin: 10rpx 0;font-weight: bold;">
{{goods.goods_name}}{{goods.goods_name.length}}
{{ goods.goods_name }}
</view> </view>
</view> </view>
<view style="margin-top: 20rpx;" v-if="goods.shop">
<view style="margin-top: 20rpx;" v-if="goods.shop" id="shopWrap">
<view style="background-color: #fff;padding: 20rpx;border-radius: 10rpx;" <view style="background-color: #fff;padding: 20rpx;border-radius: 10rpx;"
@click="handleTargetExtract(goods.shop.shop_id)"> @click="handleTargetExtract(goods.shop.shop_id)">
<view class="gui-flex gui-row gui-nowrap gui-align-items-center gui-space-between"> <view class="gui-flex gui-row gui-nowrap gui-align-items-center gui-space-between">
@ -64,15 +67,19 @@
</view> </view>
<view style="line-height: 40rpx;"> <view style="line-height: 40rpx;">
<view>{{ goods.shop.shop_name }}</view> <view>{{ goods.shop.shop_name }}</view>
<view style="color: #9e9e9e;"><text class="gui-icons "
style="margin-right: 10rpx;">&#xe607; </text> 营业时间
<view style="color: #9e9e9e;">
<text class="gui-icons "
style="margin-right: 10rpx;">&#xe607;
</text>
营业时间
{{ goods.shop.shop_hours }} {{ goods.shop.shop_hours }}
</view> </view>
</view> </view>
</view> </view>
<view style="color: #9e9e9e;"> <view style="color: #9e9e9e;">
<u-icon name="map"></u-icon><text>{{goods.shop.full_address}} </text>
<u-icon name="map"></u-icon>
<text>{{ goods.shop.full_address }}</text>
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
</view> </view>
</view> </view>
@ -81,7 +88,7 @@
<view> <view>
<view class="mainitems" style="margin-top: 20rpx;"> <view class="mainitems" style="margin-top: 20rpx;">
<view style="padding: 20rpx;border-radius: 10rpx;background-color: #fff;"> <view style="padding: 20rpx;border-radius: 10rpx;background-color: #fff;">
<view
<view id="notice"
class="gui-flex gui-row gui-nowrap gui-align-items-center gui-space-between"> class="gui-flex gui-row gui-nowrap gui-align-items-center gui-space-between">
<view style="font-size: 30rpx;font-weight: bold;padding-bottom: 30rpx;">购买须知 <view style="font-size: 30rpx;font-weight: bold;padding-bottom: 30rpx;">购买须知
</view> </view>
@ -122,7 +129,7 @@
</view> </view>
<view class="mainitems"> <view class="mainitems">
<view style="padding: 20rpx;border-radius: 10rpx;background-color: #fff;"> <view style="padding: 20rpx;border-radius: 10rpx;background-color: #fff;">
<view
<view id="detail"
class="gui-flex gui-row gui-nowrap gui-align-items-center gui-space-between" class="gui-flex gui-row gui-nowrap gui-align-items-center gui-space-between"
style="margin-bottom: 20rpx;"> style="margin-bottom: 20rpx;">
<view style="font-size: 30rpx;font-weight: bold;">图文详情</view> <view style="font-size: 30rpx;font-weight: bold;">图文详情</view>
@ -130,7 +137,8 @@
<mp-html :content="goods.content"/> <mp-html :content="goods.content"/>
<view style="margin-top: 20rpx;text-align: center;line-height: 50rpx;" <view style="margin-top: 20rpx;text-align: center;line-height: 50rpx;"
v-if="store && store.wxh"> v-if="store && store.wxh">
<view style="color: #A51480 ;font-weight: bold;">吉媒集团客服微信号{{store.wxh}}
<view style="color: #A51480 ;font-weight: bold;">
吉媒集团客服微信号{{ store.wxh }}
</view> </view>
<view v-if="store.wxmc" style="font-weight: bold;">{{ store.wxmc }}</view> <view v-if="store.wxmc" style="font-weight: bold;">{{ store.wxmc }}</view>
<view v-if="store.gzsj">工作时间{{ store.gzsj }}</view> <view v-if="store.gzsj">工作时间{{ store.gzsj }}</view>
@ -140,7 +148,7 @@
</view> </view>
<view style="height: 20rpx;"></view> <view style="height: 20rpx;"></view>
</view> </view>
<view class="mainitems">
<view class="mainitems" id="recommended">
<recommended/> <recommended/>
<view style="height: 120rpx;"></view> <view style="height: 120rpx;"></view>
</view> </view>
@ -209,7 +217,8 @@
<gui-image :src="goods.service" :width="580"></gui-image> <gui-image :src="goods.service" :width="580"></gui-image>
<!-- 关闭按钮 --> <!-- 关闭按钮 -->
<text class="gui-block-text demo-close gui-icons gui-color-white gui-absolute-rt" <text class="gui-block-text demo-close gui-icons gui-color-white gui-absolute-rt"
@tap.stop="close1">&#xe78a;</text>
@tap.stop="close1">&#xe78a;
</text>
</view> </view>
</gui-popup> </gui-popup>
<!-- 商品SKU弹窗 --> <!-- 商品SKU弹窗 -->
@ -301,6 +310,7 @@
}, },
onPageScroll: function (e) { onPageScroll: function (e) {
this.pageScrollTop = e.scrollTop;
// //
// //
if (e.scrollTop > 10) { if (e.scrollTop > 10) {
@ -315,16 +325,14 @@
if (this.timer != null) { if (this.timer != null) {
clearTimeout(this.timer); clearTimeout(this.timer);
} }
this.timer = setTimeout(() => {
graceJS.selectAll('.mainitems', (items) => { graceJS.selectAll('.mainitems', (items) => {
for (let i = 0; i < items.length; i++) { for (let i = 0; i < items.length; i++) {
if (items[i].top >= 0) {
if (items[i].top >= -50 && items[i].top <= 50) {
this.navIndex = i; this.navIndex = i;
break; break;
} }
} }
}); });
}, 200);
}, },
methods: { methods: {
@ -345,10 +353,7 @@
SettingApi.data() SettingApi.data()
.then(result => { .then(result => {
_this.store = result.data.setting.store _this.store = result.data.setting.store
}) })
}, },
handleTargetExtract(shopId) { handleTargetExtract(shopId) {
this.$navTo('pages/shop/detail', { this.$navTo('pages/shop/detail', {
@ -358,25 +363,58 @@
fanhui() { fanhui() {
uni.navigateBack() uni.navigateBack()
}, },
navchange: function(index) {
navchange(index) {
this.navIndex = index; this.navIndex = index;
// //
this.isTapScroll = true; this.isTapScroll = true;
var needTop = 0; var needTop = 0;
graceJS.selectAll('.mainitems', (items) => {
for (let i = 0; i < this.navIndex + 1; i++) {
if (i > 0) {
needTop += items[i].height;
// graceJS.selectAll('.mainitems',async (items) => {
// for (let i = 0; i < this.navIndex; i++) {
// console.log(items[i])
// if (i > 0) needTop += items[i].height;
// }
// if (this.navIndex > 0) {
// needTop += uni.upx2px(562)
// needTop += await this.getWrapHeight('goodsWrap')
// needTop += await this.getWrapHeight('shopWrap')
// }
// needTop -= this.pageScrollTop
// uni.pageScrollTo({
// scrollTop: needTop,
// duration: 300
// });
// setTimeout(() => {
// this.isTapScroll = false;
// }, 300);
// });
let which = 'slide'
switch (index) {
case 1 : {
which = 'notice'
} }
break;
case 2 : {
which = 'detail'
}
break;
case 3 : {
which = 'recommended'
} }
break;
}
let id = "#" + which
graceJS.select(id, item => {
uni.pageScrollTo({ uni.pageScrollTo({
scrollTop: needTop,
scrollTop: item.top + this.pageScrollTop - uni.upx2px(80) - 20,
duration: 300 duration: 300
}); });
setTimeout(() => {
this.isTapScroll = false;
}, 300);
});
})
// document.querySelector(id).scrollIntoView({
// behavior: "smooth", // instant smooth
// block: "start", // start center end
// inline: "center",
// offset: {top: uni.upx2px(200)}
// });
}, },
// query // query
@ -402,9 +440,6 @@
app.goods = result.data.detail app.goods = result.data.detail
resolve(result) resolve(result)
}) })
.catch(reject) .catch(reject)
@ -454,7 +489,13 @@
onTargetCart() { onTargetCart() {
this.$navTo('pages/cart/index') this.$navTo('pages/cart/index')
}, },
getWrapHeight(id) {
return new Promise(resolve => {
graceJS.select(`#${id}`, item => {
resolve(item.height)
})
})
}
}, },
/** /**

12
pages/goods/list.vue

@ -32,7 +32,7 @@
</view> </view>
</view> </view>
</view> </view>
<scroll-view scroll-x>
<scroll-view scroll-x v-if="childCategoryList.length > 1">
<view class="cate-filter"> <view class="cate-filter">
<u-tag text="全部分类" shape="circle" <u-tag text="全部分类" shape="circle"
@click="changeCategory('all')" @click="changeCategory('all')"
@ -188,7 +188,7 @@ export default {
// //
upOption: { upOption: {
// //
auto: true,
auto: false,
// ; 10 // ; 10
page: { page: {
size: pageSize size: pageSize
@ -211,6 +211,7 @@ export default {
// options // options
this.options = options this.options = options
await this.getChildCategory(options.categoryId) await this.getChildCategory(options.categoryId)
this.list.data = []
// //
this.setShowView() this.setShowView()
@ -227,6 +228,7 @@ export default {
}).then(res => { }).then(res => {
this.childCategoryList = res.data.list this.childCategoryList = res.data.list
this.selectedCategoryList = this.childCategoryList.map(item => parseInt(item.category_id)) this.selectedCategoryList = this.childCategoryList.map(item => parseInt(item.category_id))
console.log(1)
resolve() resolve()
}) })
}) })
@ -240,6 +242,8 @@ export default {
upCallback(page) { upCallback(page) {
const app = this const app = this
// //
console.log(2)
if (this.selectedCategoryList.length > 0) {
app.getGoodsList(page.num) app.getGoodsList(page.num)
.then(list => { .then(list => {
const curPageLen = list.data.length const curPageLen = list.data.length
@ -247,6 +251,7 @@ export default {
app.mescroll.endBySize(curPageLen, totalSize) app.mescroll.endBySize(curPageLen, totalSize)
}) })
.catch(() => app.mescroll.endErr()) .catch(() => app.mescroll.endErr())
}
}, },
// //
@ -303,6 +308,9 @@ export default {
// //
const newList = result.data.list const newList = result.data.list
app.list.data = getMoreListData(newList, app.list, pageNo) app.list.data = getMoreListData(newList, app.list, pageNo)
const curPageLen = newList.data.length
const totalSize = result.data.total
app.mescroll.endBySize(curPageLen, totalSize)
resolve(newList) resolve(newList)
}) })
.catch(reject) .catch(reject)

129
pages/index/index.vue

@ -3,10 +3,6 @@
<gui-page :customFooter="true" iphoneXButtomStyle="background:#F8EEF7;" <gui-page :customFooter="true" iphoneXButtomStyle="background:#F8EEF7;"
:footerSets="{height:120, zIndex:100, bg:'none'}"> :footerSets="{height:120, zIndex:100, bg:'none'}">
<view slot="gBody" :style="appThemeStyle" style="width: 100%;overflow-x: hidden;"> <view slot="gBody" :style="appThemeStyle" style="width: 100%;overflow-x: hidden;">
<view style="width: 100%;overflow-x: hidden"> <view style="width: 100%;overflow-x: hidden">
<view> <view>
@ -28,26 +24,27 @@
</view> </view>
<view style="padding: 10rpx 20rpx;position: relative;width:80%;" @click="sousuo"> <view style="padding: 10rpx 20rpx;position: relative;width:80%;" @click="sousuo">
<gui-search placeholder="请输入关键词搜索" @inputting="inputting" @confirm="confirm" disabled
<gui-search placeholder="请输入关键词搜索" @inputting="inputting" @confirm="confirm"
disabled
@tapme="sousuo"></gui-search> @tapme="sousuo"></gui-search>
</view> </view>
</view> </view>
<view class="diy-navBar" style="color: #666666;">
<view class="data-list avg-sm-5">
<view class="item-nav" v-for="(item,index) in shopList"
@click="handleTargetExtract(item.shop_id)">
<view class="nav-to">
<view class="item-image">
<image class="image" :src="item.logo_url"
style="border: 5rpx solid #633981;">
</image>
</view>
<view class="item-text oneline-hide">{{item.shop_name}}</view>
</view>
</view>
</view>
</view>
<!-- <view class="diy-navBar" style="color: #666666;">-->
<!-- <view class="data-list avg-sm-5">-->
<!-- <view class="item-nav" v-for="(item,index) in shopList"-->
<!-- @click="handleTargetExtract(item.shop_id)">-->
<!-- <view class="nav-to">-->
<!-- <view class="item-image">-->
<!-- <image class="image" :src="item.logo_url"-->
<!-- style="border: 5rpx solid #633981;">-->
<!-- </image>-->
<!-- </view>-->
<!-- <view class="item-text oneline-hide">{{item.shop_name}}</view>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<Page :items="items"/> <Page :items="items"/>
@ -56,7 +53,8 @@
<view style="padding: 20rpx 0;background-color: #F8EEF7;"> <view style="padding: 20rpx 0;background-color: #F8EEF7;">
<gui-switch-navigation activeLineBg="linear-gradient(to right, #9E1A91, #4D0868)" <gui-switch-navigation activeLineBg="linear-gradient(to right, #9E1A91, #4D0868)"
activeLineWidth="80rpx" padding="30rpx" :size="0" textAlign="center"
activeLineWidth="80rpx" padding="30rpx" :size="0"
textAlign="center"
activeDirection="center" activeDirection="center"
:items="[{id:0,name:'推荐'},{id:1,name:'周末活动'},{id:2,name:'附近商品'}]" :items="[{id:0,name:'推荐'},{id:1,name:'周末活动'},{id:2,name:'附近商品'}]"
@change="navchange"></gui-switch-navigation> @change="navchange"></gui-switch-navigation>
@ -82,7 +80,8 @@
<view <view
style=" position: absolute;left: 0;top: 20rpx;color: #fff;font-size: 20rpx;padding: 5rpx 10rpx;"> style=" position: absolute;left: 0;top: 20rpx;color: #fff;font-size: 20rpx;padding: 5rpx 10rpx;">
<image src="../../static/zx.png" style="height: 40rpx;" mode="heightFix">
<image src="../../static/zx.png" style="height: 40rpx;"
mode="heightFix">
</image> </image>
</view> </view>
@ -134,7 +133,8 @@
<view class="desc_footer"> <view class="desc_footer">
<text class="price_x">¥{{ item.goods_price_min }}</text> <text class="price_x">¥{{ item.goods_price_min }}</text>
<text class="price_y col-9" <text class="price_y col-9"
v-if=" item.line_price_min > 0">¥{{ item.line_price_min }}</text>
v-if=" item.line_price_min > 0">¥{{ item.line_price_min }}
</text>
</view> </view>
<view <view
class="demo-shop gui-flex gui-rows gui-nowrap gui-align-items-center gui-space-between"> class="demo-shop gui-flex gui-rows gui-nowrap gui-align-items-center gui-space-between">
@ -156,7 +156,8 @@
mode="aspectFill"></image> mode="aspectFill"></image>
<view <view
style="position: absolute;left: 0;top: 20rpx;color: #fff;font-size: 20rpx;padding: 5rpx 10rpx;"> style="position: absolute;left: 0;top: 20rpx;color: #fff;font-size: 20rpx;padding: 5rpx 10rpx;">
<image src="../../static/zx.png" style="height: 40rpx;" mode="heightFix">
<image src="../../static/zx.png" style="height: 40rpx;"
mode="heightFix">
</image> </image>
</view> </view>
</view> </view>
@ -207,7 +208,8 @@
<view class="desc_footer"> <view class="desc_footer">
<text class="price_x">¥{{ item.goods_price_min }}</text> <text class="price_x">¥{{ item.goods_price_min }}</text>
<text class="price_y col-9" <text class="price_y col-9"
v-if=" item.line_price_min > 0">¥{{ item.line_price_min }}</text>
v-if=" item.line_price_min > 0">¥{{ item.line_price_min }}
</text>
</view> </view>
<view <view
class="demo-shop gui-flex gui-rows gui-nowrap gui-align-items-center gui-space-between"> class="demo-shop gui-flex gui-rows gui-nowrap gui-align-items-center gui-space-between">
@ -223,7 +225,9 @@
<view style="position: fixed;bottom: 200rpx;right: 20rpx;" v-if="top > 500"> <view style="position: fixed;bottom: 200rpx;right: 20rpx;" v-if="top > 500">
<text @click="dingbu" class=" gui-icons" <text @click="dingbu" class=" gui-icons"
style="background: linear-gradient(to top, #4D0868, #9E1A91);color: #fff;padding: 20rpx;border-radius: 50%;">&#xe637;</text>
style="background: linear-gradient(to top, #4D0868, #9E1A91);color: #fff;padding: 20rpx;border-radius: 50%;">
&#xe637;
</text>
</view> </view>
<view v-if="!isAuthor" class="widget-location dis-flex flex-x-center flex-y-center" <view v-if="!isAuthor" class="widget-location dis-flex flex-x-center flex-y-center"
@click="onAuthorize()"> @click="onAuthorize()">
@ -279,7 +283,9 @@
<view v-if="store.goods_id > 0" @click="onTargetDetail(store.goods_id)" <view v-if="store.goods_id > 0" @click="onTargetDetail(store.goods_id)"
style="width: 580rpx;height: 200rpx;background: rgba(187,52,238,0.2);display: flex;justify-content: center;align-items: center;"> style="width: 580rpx;height: 200rpx;background: rgba(187,52,238,0.2);display: flex;justify-content: center;align-items: center;">
<text <text
style="width: 300rpx;padding: 20rpx 0;background-color: #54125f;background: linear-gradient(to top, #4D0868, #9E1A91);color: #fff;text-align: center;border-radius: 40rpx;">查看详情</text>
style="width: 300rpx;padding: 20rpx 0;background-color: #54125f;background: linear-gradient(to top, #4D0868, #9E1A91);color: #fff;text-align: center;border-radius: 40rpx;">
查看详情
</text>
</view> </view>
</view> </view>
@ -291,16 +297,20 @@
</gui-page> </gui-page>
<shortcut bottom="120rpx"/> <shortcut bottom="120rpx"/>
<view class="settle-btn" v-if="showSettle">
<view class="btn">
<text @click="toSettle">我是商家申请免费入驻互动平台</text>
<u-icon name="close-circle-fill" color="white" @click="showSettle = false"/>
</view>
</view>
</view> </view>
</template> </template>
<script> <script>
import store from '@/store' import store from '@/store'
import Shortcut from '@/components/shortcut' import Shortcut from '@/components/shortcut'
import * as UserApi from '@/api/user'
var graceJS = require('@/GraceUI5/js/grace.js'); var graceJS = require('@/GraceUI5/js/grace.js');
import { import {
inArray inArray
@ -376,8 +386,9 @@
is_dingwei: 0, is_dingwei: 0,
page_num: 1, page_num: 1,
latitude: '', latitude: '',
longitude: ''
longitude: '',
showSettle: true,
userInfo: null,
} }
}, },
@ -393,7 +404,6 @@
console.log(options) console.log(options)
if (options.id) { if (options.id) {
store.dispatch('Logout', {}).then(result => { store.dispatch('Logout', {}).then(result => {
console.log('logut') console.log('logut')
@ -405,7 +415,6 @@
} }
_this.getNews() _this.getNews()
_this.getHots() _this.getHots()
console.log(585) console.log(585)
@ -440,7 +449,6 @@
}, 500) }, 500)
}) })
}, },
@ -462,13 +470,14 @@
this.is_pas = 0 this.is_pas = 0
this.flowList = [] this.flowList = []
this.$refs.uWaterfall.clear();
this.$nextTick(() => {
if (this.$refs.uWaterfall) this.$refs.uWaterfall.clear();
})
this.getGoodsList() this.getGoodsList()
} }
}, },
onReachBottom() { onReachBottom() {
this.loadStatus = 'loading'; this.loadStatus = 'loading';
@ -489,7 +498,6 @@
methods: { methods: {
getNews() { getNews() {
const app = this const app = this
const param = { const param = {
@ -560,8 +568,6 @@
Api.getUserInfo(id, token) Api.getUserInfo(id, token)
.then(result => { .then(result => {
console.log(result)
store.dispatch('Login', { store.dispatch('Login', {
mobile: result.data.mobile mobile: result.data.mobile
@ -574,14 +580,16 @@
// app.onNavigateBack(1) // app.onNavigateBack(1)
// }, 2000) // }, 2000)
UserApi.info().then(({data: {userInfo}}) => {
_this.userInfo = userInfo
}) })
.catch(err => {
}) })
.finally(() => app.isLoading = false)
.catch(err => {
}) })
.finally(() => _this.isLoading = false)
})
}, },
@ -809,7 +817,12 @@
backgroundColor: page.style.titleBackgroundColor backgroundColor: page.style.titleBackgroundColor
}) })
}, },
toSettle() {
const url = parseInt(this.userInfo.is_info) === 0 ? '/pages/user/settled/index' : '/pages/user/shop/index'
uni.navigateTo({
url
})
},
}, },
/** /**
@ -1043,4 +1056,30 @@
background-color: #F7F8FA; background-color: #F7F8FA;
border-radius: 100rpx; border-radius: 100rpx;
} }
.settle-btn {
position: fixed;
bottom: 130rpx;
left: calc(50% - 240rpx);
z-index: 11;
width: 480rpx;
.btn {
margin: auto;
background: linear-gradient(90deg, #B6B7F8, #B603D9);
display: flex;
align-items: center;
justify-content: center;
padding: 10rpx 20rpx;
color: #ffffff;
text-align: center;
font-size: 25rpx;
border-radius: 999rpx;
text {
margin-right: 10rpx
}
}
}
</style> </style>

127
pages/order/detail.vue

@ -15,28 +15,45 @@
<view v-if="!isLoading" class="container" :style="appThemeStyle" style="padding: 20rpx;"> <view v-if="!isLoading" class="container" :style="appThemeStyle" style="padding: 20rpx;">
<view style="margin-bottom: 20rpx;display: flex;" <view style="margin-bottom: 20rpx;display: flex;"
v-if="order.pay_status == PayStatusEnum.PENDING.value"> v-if="order.pay_status == PayStatusEnum.PENDING.value">
<view style="font-size: 40rpx;font-weight: bold;margin-bottom: 10rpx;margin-right: 10rpx;"><text class=" gui-icons"
style="">&#xe64c;</text>待付款还剩 </view>
<view style="font-size: 40rpx;font-weight: bold;margin-bottom: 10rpx;margin-right: 10rpx;">
<text class=" gui-icons"
style="">&#xe64c;
</text>
待付款还剩
</view>
<count-down style="font-size: 40rpx;font-weight: bold;" class="state-text" :date="order.expirationTime" separator="zh" theme="text" />
<count-down style="font-size: 40rpx;font-weight: bold;" class="state-text"
:date="order.expirationTime" separator="zh" theme="text"/>
</view> </view>
<view style="margin-bottom: 20rpx;" <view style="margin-bottom: 20rpx;"
v-else-if="order.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value && order.order_status == 10"> v-else-if="order.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value && order.order_status == 10">
<view style="font-size: 40rpx;font-weight: bold;margin-bottom: 10rpx;"><text class=" gui-icons"
style="margin-right: 10rpx;">&#xe64c;</text>待到店使用</view>
<view style="font-size: 40rpx;font-weight: bold;margin-bottom: 10rpx;">
<text class=" gui-icons"
style="margin-right: 10rpx;">&#xe64c;
</text>
待到店使用
</view>
<view>请在 {{ order.become_time }} ()前到店消费</view> <view>请在 {{ order.become_time }} ()前到店消费</view>
</view> </view>
<view style="margin-bottom: 20rpx;" <view style="margin-bottom: 20rpx;"
v-else-if=" order.order_status == 21"> v-else-if=" order.order_status == 21">
<view style="font-size: 40rpx;font-weight: bold;margin-bottom: 10rpx;"><text class=" gui-icons"
style="margin-right: 10rpx;">&#xe64c;</text>订单取消中</view>
<view style="font-size: 40rpx;font-weight: bold;margin-bottom: 10rpx;">
<text class=" gui-icons"
style="margin-right: 10rpx;">&#xe64c;
</text>
订单取消中
</view>
</view> </view>
<view style="margin-bottom: 20rpx;" <view style="margin-bottom: 20rpx;"
v-else-if=" order.order_status == 20"> v-else-if=" order.order_status == 20">
<view style="font-size: 40rpx;font-weight: bold;margin-bottom: 10rpx;"><text class=" gui-icons"
style="margin-right: 10rpx;">&#xe64c;</text>订单已取消</view>
<view style="font-size: 40rpx;font-weight: bold;margin-bottom: 10rpx;">
<text class=" gui-icons"
style="margin-right: 10rpx;">&#xe64c;
</text>
订单已取消
</view>
</view> </view>
<view style="padding: 20rpx;background-color: #fff;margin-bottom: 20rpx;border-radius: 20rpx;"> <view style="padding: 20rpx;background-color: #fff;margin-bottom: 20rpx;border-radius: 20rpx;">
@ -50,7 +67,9 @@
<view class="gui-flex gui-rows gui-nowrap gui-align-items-center gui-space-between" <view class="gui-flex gui-rows gui-nowrap gui-align-items-center gui-space-between"
style="font-weight: bold;"> style="font-weight: bold;">
<text>{{ order.goods[0].goods_name }}</text> <text>{{ order.goods[0].goods_name }}</text>
<text class=" gui-icons" @click="handleTargetGoods(order.goods[0].goods_id)">&#xe601;</text>
<text class=" gui-icons" @click="handleTargetGoods(order.goods[0].goods_id)">
&#xe601;
</text>
</view> </view>
<view style="font-size: 24rpx;line-height: 40rpx;color: #8b8b8b;"> <view style="font-size: 24rpx;line-height: 40rpx;color: #8b8b8b;">
下单时间{{ order.create_time }} 下单时间{{ order.create_time }}
@ -59,63 +78,88 @@
数量{{ order.goods[0].total_num }} 数量{{ order.goods[0].total_num }}
</view> </view>
<view style="font-size: 24rpx;"> <view style="font-size: 24rpx;">
<text style="font-size: 20rpx;"></text><text style="font-size:32rpx">{{ order.goods[0].is_user_grade ? order.goods[0].grade_goods_price : order.goods[0].goods_price }}</text>
<text style="font-size: 20rpx;"></text>
<text style="font-size:32rpx">{{
order.goods[0].is_user_grade ? order.goods[0].grade_goods_price : order.goods[0].goods_price
}}
</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view v-if="order.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value && order.pay_status == PayStatusEnum.SUCCESS.value && order.order_status == 10 || order.order_status == 21" style="padding: 20rpx;background-color: #fff;margin-bottom: 20rpx;border-radius: 20rpx;">
<view style="width: 100%;display: flex;justify-content: center;align-items: center;" v-if="order.order_status == 10">
<view
v-if="order.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value && order.pay_status == PayStatusEnum.SUCCESS.value && order.order_status == 10 || order.order_status == 21"
style="padding: 20rpx;background-color: #fff;margin-bottom: 20rpx;border-radius: 20rpx;">
<view style="width: 100%;display: flex;justify-content: center;align-items: center;"
v-if="order.order_status == 10">
<image <image
:src="qrcodeImage" :src="qrcodeImage"
style="width: 250rpx;height: 250rpx;"></image> style="width: 250rpx;height: 250rpx;"></image>
</view> </view>
<view style="display: flex;margin: 20rpx 0;"> <view style="display: flex;margin: 20rpx 0;">
<view style="width: 530rpx;"> <view style="width: 530rpx;">
<view style="font-size: 32rpx;font-weight: bold;margin-bottom: 5rpx;">券码信息({{order.coupon.length}}张可用)</view>
<view style="font-size: 32rpx;font-weight: bold;margin-bottom: 5rpx;">
券码信息({{ order.coupon.length }}张可用)
</view>
<view style="font-size: 22rpx;">{{ order.become_time }} 23:59:59 到期</view> <view style="font-size: 22rpx;">{{ order.become_time }} 23:59:59 到期</view>
</view> </view>
<view style="display: flex;justify-content: center;align-items: center;"> <view style="display: flex;justify-content: center;align-items: center;">
<view @click="onCancel(order.order_id)" v-if="order.order_status != OrderStatusEnum.APPLY_CANCEL.value && order.pay_status == PayStatusEnum.SUCCESS.value && order.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value"
<view @click="onCancel(order.order_id)"
v-if="order.order_status != OrderStatusEnum.APPLY_CANCEL.value && order.pay_status == PayStatusEnum.SUCCESS.value && order.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value"
style="padding: 8rpx 20rpx;border: 1px solid #8b8b8b;font-size: 24rpx;border-radius: 30rpx;"> style="padding: 8rpx 20rpx;border: 1px solid #8b8b8b;font-size: 24rpx;border-radius: 30rpx;">
申请取消</view>
申请取消
</view>
<view v-else class="f-28 col-8">取消申请中</view> <view v-else class="f-28 col-8">取消申请中</view>
<view v-if="order.goods[0].refund" <view v-if="order.goods[0].refund"
style="padding: 8rpx 20rpx;border: 1px solid #8b8b8b;font-size: 24rpx;border-radius: 30rpx;"> style="padding: 8rpx 20rpx;border: 1px solid #8b8b8b;font-size: 24rpx;border-radius: 30rpx;">
已申请售后</view>
<view @click.stop="handleApplyRefund(order.goods[0].order_goods_id)" v-else-if="order.isAllowRefund"
已申请售后
</view>
<view @click.stop="handleApplyRefund(order.goods[0].order_goods_id)"
v-else-if="order.isAllowRefund"
style="padding: 8rpx 20rpx;border: 1px solid #8b8b8b;font-size: 24rpx;border-radius: 30rpx;"> style="padding: 8rpx 20rpx;border: 1px solid #8b8b8b;font-size: 24rpx;border-radius: 30rpx;">
申请退款</view>
申请退款
</view>
</view> </view>
</view> </view>
<view style="line-height: 45rpx;"> <view style="line-height: 45rpx;">
<view class="gui-flex gui-rows gui-nowrap gui-align-items-center gui-space-between" v-for="(item,index) in order.coupon">
<view class="gui-flex gui-rows gui-nowrap gui-align-items-center gui-space-between"
v-for="(item,index) in order.coupon">
<view style="display: flex;"> <view style="display: flex;">
<view style="width: 80rpx;">券码{{index+1}}</view> · <text style="margin-left: 10rpx;"> {{item.code}}</text>
<view style="width: 80rpx;">券码{{ index + 1 }}</view>
·
<text style="margin-left: 10rpx;"> {{ item.code }}</text>
</view> </view>
<text>{{ item.clerk_id == 0 ? '待使用' : '已使用' }}</text> <text>{{ item.clerk_id == 0 ? '待使用' : '已使用' }}</text>
</view> </view>
</view> </view>
</view> </view>
<view style="background-color: #fff;padding: 20rpx;border-radius: 20rpx;margin-bottom: 20rpx;" @click="handleTargetExtract(order.extract_shop.shop_id)" v-if="order.extract_shop">
<view style="background-color: #fff;padding: 20rpx;border-radius: 20rpx;margin-bottom: 20rpx;"
@click="handleTargetExtract(order.extract_shop.shop_id)" v-if="order.extract_shop">
<view class="gui-flex gui-row gui-nowrap gui-align-items-center gui-space-between"> <view class="gui-flex gui-row gui-nowrap gui-align-items-center gui-space-between">
<view style="font-size: 30rpx;font-weight: bold;">适用门店</view> <view style="font-size: 30rpx;font-weight: bold;">适用门店</view>
<view style="color: #9e9e9e;font-size: 23rpx;">联系商家</view> <view style="color: #9e9e9e;font-size: 23rpx;">联系商家</view>
</view> </view>
<view style="margin:20rpx 0;display: flex;font-size: 25rpx;"> <view style="margin:20rpx 0;display: flex;font-size: 25rpx;">
<view> <view>
<image :src="order.extract_shop.logo_url" style="width: 80rpx;height: 80rpx;border-radius: 50%;margin-right:20rpx;">
<image :src="order.extract_shop.logo_url"
style="width: 80rpx;height: 80rpx;border-radius: 50%;margin-right:20rpx;">
</image> </image>
</view> </view>
<view style="line-height: 40rpx;"> <view style="line-height: 40rpx;">
<view>{{ order.extract_shop.shop_name }}</view> <view>{{ order.extract_shop.shop_name }}</view>
<view style="color: #9e9e9e;"><text class="gui-icons "
style="margin-right: 10rpx;">&#xe607; </text> 营业时间 {{order.extract_shop.shop_hours}}</view>
<view style="color: #9e9e9e;">
<text class="gui-icons "
style="margin-right: 10rpx;">&#xe607;
</text>
营业时间 {{ order.extract_shop.shop_hours }}
</view>
</view> </view>
</view> </view>
<view> <view>
<text class="gui-icons " style="color: #9e9e9e;font-size: 24rpx;">&#xe61c; {{order.extract_shop.full_address}} &#xe601;</text>
<text class="gui-icons " style="color: #9e9e9e;font-size: 24rpx;">&#xe61c;
{{ order.extract_shop.full_address }} &#xe601;
</text>
</view> </view>
</view> </view>
@ -125,22 +169,28 @@
</view> </view>
<view style="line-height: 60rpx;"> <view style="line-height: 60rpx;">
<view style="display: flex;font-size: 26rpx;"> <view style="display: flex;font-size: 26rpx;">
<view style="width: 120rpx;">实付金额</view><text style="color: #8b8b8b;">{{ order.pay_price }}</text>
<view style="width: 120rpx;">实付金额</view>
<text style="color: #8b8b8b;">{{ order.pay_price }}</text>
</view> </view>
<view style="display: flex;font-size: 26rpx;"> <view style="display: flex;font-size: 26rpx;">
<view style="width: 120rpx;">手机号</view><text style="color: #8b8b8b;">{{order.extract.phone}}</text>
<view style="width: 120rpx;">手机号</view>
<text style="color: #8b8b8b;">{{ order.extract.phone }}</text>
</view> </view>
<view style="display: flex;font-size: 26rpx;"> <view style="display: flex;font-size: 26rpx;">
<view style="width: 120rpx;">订单号</view><text style="color: #8b8b8b;">{{ order.order_no }}</text>
<view style="width: 120rpx;">订单号</view>
<text style="color: #8b8b8b;">{{ order.order_no }}</text>
<view @click="handleCopy(order.order_no)" <view @click="handleCopy(order.order_no)"
style="margin-left: 20rpx;padding: 0rpx 20rpx;background-color: #f6eaf5;font-size: 22rpx;color: #9e1a91;">
复制</view>
class="check-btn">
复制
</view>
</view> </view>
<view style="display: flex;font-size: 26rpx;"> <view style="display: flex;font-size: 26rpx;">
<view style="width: 120rpx;">下单时间</view><text style="color: #8b8b8b;">{{ order.create_time }}</text>
<view style="width: 120rpx;">下单时间</view>
<text style="color: #8b8b8b;">{{ order.create_time }}</text>
</view> </view>
<view style="display: flex;font-size: 26rpx;"> <view style="display: flex;font-size: 26rpx;">
<view style="width: 120rpx;">购买数量</view><text style="color: #8b8b8b;">{{order.goods[0].total_num}}</text>
<view style="width: 120rpx;">购买数量</view>
<text style="color: #8b8b8b;">{{ order.goods[0].total_num }}</text>
</view> </view>
</view> </view>
</view> </view>
@ -358,6 +408,7 @@
.state-text { .state-text {
color: $main-bg; color: $main-bg;
} }
.container { .container {
padding-bottom: calc(constant(safe-area-inset-bottom) + 106rpx + 6rpx); padding-bottom: calc(constant(safe-area-inset-bottom) + 106rpx + 6rpx);
padding-bottom: calc(env(safe-area-inset-bottom) + 106rpx + 6rpx); padding-bottom: calc(env(safe-area-inset-bottom) + 106rpx + 6rpx);
@ -800,4 +851,14 @@
} }
} }
.check-btn {
padding: 0 25rpx;
border-radius: 999rpx;
background: linear-gradient(to bottom, #90178b, #590b6e);
color: white;
font-size: 25rpx;
margin: 0 10rpx;
}
</style> </style>

97
pages/order/extract/check.vue

@ -7,16 +7,25 @@
<view v-if="!isLoading" class="container" :style="appThemeStyle" style="padding: 20rpx;"> <view v-if="!isLoading" class="container" :style="appThemeStyle" style="padding: 20rpx;">
<view style="margin-bottom: 20rpx;display: flex;" <view style="margin-bottom: 20rpx;display: flex;"
v-if="order.pay_status == PayStatusEnum.PENDING.value"> v-if="order.pay_status == PayStatusEnum.PENDING.value">
<view style="font-size: 40rpx;font-weight: bold;margin-bottom: 10rpx;margin-right: 10rpx;"><text class=" gui-icons"
>&#xe64c;</text>待付款还剩 </view>
<view style="font-size: 40rpx;font-weight: bold;margin-bottom: 10rpx;margin-right: 10rpx;">
<text class=" gui-icons"
>&#xe64c;
</text>
待付款还剩
</view>
<count-down style="font-size: 40rpx;font-weight: bold;" class="state-text" :date="order.expirationTime" separator="zh" theme="text" />
<count-down style="font-size: 40rpx;font-weight: bold;" class="state-text"
:date="order.expirationTime" separator="zh" theme="text"/>
</view> </view>
<view style="margin-bottom: 20rpx;" <view style="margin-bottom: 20rpx;"
v-else-if="order.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value"> v-else-if="order.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value">
<view style="font-size: 40rpx;font-weight: bold;margin-bottom: 10rpx;"><text class=" gui-icons"
style="margin-right: 10rpx;">&#xe64c;</text>待到店使用</view>
<view style="font-size: 40rpx;font-weight: bold;margin-bottom: 10rpx;">
<text class=" gui-icons"
style="margin-right: 10rpx;">&#xe64c;
</text>
待到店使用
</view>
<view>请在 {{ order.become_time }} ()前到店消费</view> <view>请在 {{ order.become_time }} ()前到店消费</view>
</view> </view>
<view style="padding: 20rpx;background-color: #fff;margin-bottom: 20rpx;border-radius: 20rpx;"> <view style="padding: 20rpx;background-color: #fff;margin-bottom: 20rpx;border-radius: 20rpx;">
@ -38,49 +47,68 @@
数量{{ order.goods[0].total_num }} 数量{{ order.goods[0].total_num }}
</view> </view>
<view style="font-size: 24rpx;"> <view style="font-size: 24rpx;">
<text style="font-size: 20rpx;"></text><text style="font-size:32rpx">{{ order.goods[0].is_user_grade ? order.goods[0].grade_goods_price : order.goods[0].goods_price }}</text>
<text style="font-size: 20rpx;"></text>
<text style="font-size:32rpx">{{
order.goods[0].is_user_grade ? order.goods[0].grade_goods_price : order.goods[0].goods_price
}}
</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view v-if="order.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value && order.pay_status == PayStatusEnum.SUCCESS.value" style="padding: 20rpx;background-color: #fff;margin-bottom: 20rpx;border-radius: 20rpx;">
<view
v-if="order.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value && order.pay_status == PayStatusEnum.SUCCESS.value"
style="padding: 20rpx;background-color: #fff;margin-bottom: 20rpx;border-radius: 20rpx;">
<view style="display: flex;margin: 20rpx 0;"> <view style="display: flex;margin: 20rpx 0;">
<view style="width: 530rpx;"> <view style="width: 530rpx;">
<view style="font-size: 32rpx;font-weight: bold;margin-bottom: 5rpx;">券码信息({{order.coupon.length}}张可用)</view>
<view style="font-size: 32rpx;font-weight: bold;margin-bottom: 5rpx;">
券码信息({{ order.coupon.length }}张可用)
</view>
<view style="font-size: 22rpx;">{{ order.become_time }} 23:59:59 到期</view> <view style="font-size: 22rpx;">{{ order.become_time }} 23:59:59 到期</view>
</view> </view>
</view> </view>
<view style="line-height: 45rpx;"> <view style="line-height: 45rpx;">
<view class="gui-flex gui-rows gui-nowrap gui-align-items-center gui-space-between" v-for="(item,index) in order.coupon">
<view class="gui-flex gui-rows gui-nowrap gui-align-items-center gui-space-between"
v-for="(item,index) in order.coupon">
<view style="display: flex;"> <view style="display: flex;">
<view style="width: 80rpx;">券码{{index+1}}</view> · <text> {{item.code}}</text>
<view style="width: 80rpx;">券码{{ index + 1 }}</view>
·
<text> {{ item.code }}</text>
</view> </view>
<text>{{ item.clerk_id == 0 ? '待使用' : '已使用' }}</text> <text>{{ item.clerk_id == 0 ? '待使用' : '已使用' }}</text>
<view style="width: 100rpx;">
<text class="state-text" @click="hexiao(item.id)" v-if="item.clerk_id == 0">核销</text>
</view>
<button class="check-btn" @click="hexiao(item.id)"
v-if="item.clerk_id == 0">核销
</button>
</view> </view>
</view> </view>
</view> </view>
<view style="background-color: #fff;padding: 20rpx;border-radius: 20rpx;margin-bottom: 20rpx;" v-if="order.extract_shop">
<view style="background-color: #fff;padding: 20rpx;border-radius: 20rpx;margin-bottom: 20rpx;"
v-if="order.extract_shop">
<view class="gui-flex gui-row gui-nowrap gui-align-items-center gui-space-between"> <view class="gui-flex gui-row gui-nowrap gui-align-items-center gui-space-between">
<view style="font-size: 30rpx;font-weight: bold;">适用门店</view> <view style="font-size: 30rpx;font-weight: bold;">适用门店</view>
<view style="color: #9e9e9e;font-size: 23rpx;">联系商家</view> <view style="color: #9e9e9e;font-size: 23rpx;">联系商家</view>
</view> </view>
<view style="margin:20rpx 0;display: flex;font-size: 25rpx;"> <view style="margin:20rpx 0;display: flex;font-size: 25rpx;">
<view> <view>
<image :src="order.extract_shop.logo_url" style="width: 80rpx;height: 80rpx;border-radius: 50%;margin-right:20rpx;">
<image :src="order.extract_shop.logo_url"
style="width: 80rpx;height: 80rpx;border-radius: 50%;margin-right:20rpx;">
</image> </image>
</view> </view>
<view style="line-height: 40rpx;"> <view style="line-height: 40rpx;">
<view>{{ order.extract_shop.shop_name }}</view> <view>{{ order.extract_shop.shop_name }}</view>
<view style="color: #9e9e9e;"><text class="gui-icons "
style="margin-right: 10rpx;">&#xe607; </text> 营业时间 {{order.extract_shop.shop_hours}}</view>
<view style="color: #9e9e9e;">
<text class="gui-icons "
style="margin-right: 10rpx;">&#xe607;
</text>
营业时间 {{ order.extract_shop.shop_hours }}
</view>
</view> </view>
</view> </view>
<view> <view>
<text class="gui-icons " style="color: #9e9e9e;font-size: 24rpx;">&#xe61c; {{order.extract_shop.full_address}} &#xe601;</text>
<text class="gui-icons " style="color: #9e9e9e;font-size: 24rpx;">&#xe61c;
{{ order.extract_shop.full_address }} &#xe601;
</text>
</view> </view>
</view> </view>
@ -90,22 +118,28 @@
</view> </view>
<view style="line-height: 60rpx;"> <view style="line-height: 60rpx;">
<view style="display: flex;font-size: 26rpx;"> <view style="display: flex;font-size: 26rpx;">
<view style="width: 120rpx;">实付金额</view><text style="color: #8b8b8b;">{{ order.pay_price }}</text>
<view style="width: 120rpx;">实付金额</view>
<text style="color: #8b8b8b;">{{ order.pay_price }}</text>
</view> </view>
<view style="display: flex;font-size: 26rpx;"> <view style="display: flex;font-size: 26rpx;">
<view style="width: 120rpx;">手机号</view><text style="color: #8b8b8b;">{{order.extract.phone}}</text>
<view style="width: 120rpx;">手机号</view>
<text style="color: #8b8b8b;">{{ order.extract.phone }}</text>
</view> </view>
<view style="display: flex;font-size: 26rpx;">
<view style="width: 120rpx;">订单号</view><text style="color: #8b8b8b;">{{ order.order_no }}</text>
<view @click="handleCopy(order.order_no)"
style="margin-left: 20rpx;padding: 0rpx 20rpx;background-color: #f6eaf5;font-size: 22rpx;color: #9e1a91;">
复制</view>
<view style="display: flex;font-size: 26rpx;justify-content: flex-start">
<view style="width: 120rpx;">订单号</view>
<text style="color: #8b8b8b;">{{ order.order_no }}</text>
<button @click="handleCopy(order.order_no)"
class="check-btn">
复制
</button>
</view> </view>
<view style="display: flex;font-size: 26rpx;"> <view style="display: flex;font-size: 26rpx;">
<view style="width: 120rpx;">下单时间</view><text style="color: #8b8b8b;">{{ order.create_time }}</text>
<view style="width: 120rpx;">下单时间</view>
<text style="color: #8b8b8b;">{{ order.create_time }}</text>
</view> </view>
<view style="display: flex;font-size: 26rpx;"> <view style="display: flex;font-size: 26rpx;">
<view style="width: 120rpx;">购买数量</view><text style="color: #8b8b8b;">{{order.goods[0].total_num}}</text>
<view style="width: 120rpx;">购买数量</view>
<text style="color: #8b8b8b;">{{ order.goods[0].total_num }}</text>
</view> </view>
</view> </view>
</view> </view>
@ -750,4 +784,13 @@
} }
} }
.check-btn {
padding: 0 25rpx;
border-radius: 999rpx;
background: linear-gradient(to bottom, #90178b, #590b6e);
color: white;
font-size: 25rpx;
margin: 0 10rpx;
}
</style> </style>

244
pages/shop/list.vue

@ -0,0 +1,244 @@
<template>
<view class="container" :style="appThemeStyle">
<mescroll-body ref="mescrollRef" :sticky="true" :down="{ native: true }" :up="upOption">
<!-- 页面头部 -->
<view class="header">
<u-search class="search" v-model="keyword" :placeholder="options.search ? options.search : '搜索店铺'"
@search="getShopList" @custom="getShopList" @clear="getShopList"/>
</view>
<scroll-view scroll-x v-if="cateList.length > 1">
<view class="cate-filter">
<u-tag text="全部分类" shape="circle"
@click="changeCategory('all')"
:bgColor="selectedCategoryList.length === cateList.length ? '#9e1a91' : 'transparent'"
:color="selectedCategoryList.length === cateList.length ? 'white' : '#9e1a91'"
borderColor="#9e1a91"/>
<u-tag :text="item.name" shape="circle" plain v-for="(item, index) in cateList"
:key="index"
@click="changeCategory(item.category_id)"
:bgColor="(selectedCategoryList.length === 1 && selectedCategoryList[0] === item.category_id) ? '#9e1a91' : 'transparent'"
:color="(selectedCategoryList.length === 1 && selectedCategoryList[0] === item.category_id) ? 'white' : '#9e1a91'"
borderColor="#9e1a91"/>
</view>
</scroll-view>
<view class="shop-item" v-for="(item, index) in list.data" :key="index" @click="toDetail(item.shop_id)">
<image :src="item.logo_url" mode="aspectFill"/>
<view class="content">
<text class="title">{{ item.shop_name }}</text>
<view class="cate">
<text class="tips">{{ item.category.name }}</text>
<text class="tips">营业时间:{{ item.shop_hours }}</text>
</view>
<view class="score">
<u-rate size="25" active-color="#f4a213" :current="item.score" :disabled="true"/>
<view style="font-size: 25rpx;">{{ item.comment_count }}人评价</view>
</view>
<view class="address">
<text class="tips">{{ item.full_address }}</text>
<view class="sales-wrap">
<text>销量: {{ item.goods_sales }}</text>
<text>距离: {{ item.distance }}km</text>
</view>
</view>
</view>
</view>
</mescroll-body>
</view>
</template>
<script>
import * as CategoryApi from '@/api/shop/navCategory/index'
import * as ShopApi from '@/api/shop'
import MescrollBody from '@/components/mescroll-uni/mescroll-body.vue'
import MescrollMixin from '@/components/mescroll-uni/mescroll-mixins'
import Search from '@/components/search'
import {
getEmptyPaginateObj,
getMoreListData
} from '@/core/app'
const pageSize = 15
export default {
name: "list",
components: {
MescrollBody,
Search,
},
mixins: [MescrollMixin],
data() {
return {
cateList: [],
selectedCategoryList: [],
upOption: {
//
auto: true,
// ; 10
page: {
size: pageSize
},
// 4
noMoreSize: 4,
},
list: getEmptyPaginateObj(),
keyword: '',
latitude: '',
longitude: '',
}
},
async onLoad(options) {
this.options = options
// await this.getLocation()
await this.getChildCategory(options.shopId)
await this.getShopList(1)
},
methods: {
async getChildCategory(categoryId) {
const {data: {detail}} = await CategoryApi.detail(categoryId)
this.cateList = JSON.parse(detail.shop_category_list)
this.selectedCategoryList = this.cateList.map(item => parseInt(item.category_id))
},
getShopList() {
const app = this
ShopApi.list({
category_list: this.selectedCategoryList.join(),
keyword: this.keyword,
latitude: this.latitude,
longitude: this.longitude,
}).then(result => {
app.list.data = result.data.list
console.log(app.list.data)
app.mescroll.endBySize(app.list.data.length, app.list.data.length)
})
.catch(() => this.mescroll.endErr())
},
upCallback(page) {
const app = this
//
ShopApi.list({
category_list: this.selectedCategoryList.join()
}).then(list => {
app.mescroll.endBySize(app.list.data.length, app.list.data.length)
})
.catch(() => this.mescroll.endErr())
},
handleSearch() {
},
changeCategory(cateId) {
if (cateId === 'all') this.selectedCategoryList = this.cateList.map(item => parseInt(item.category_id))
else this.selectedCategoryList = [parseInt(cateId)]
this.getShopList()
},
toDetail(shopId) {
this.$navTo('pages/shop/detail', {
shopId
})
},
getLocation() {
const _this = this
return new Promise((resolve, reject) => {
uni.getLocation({
type: 'wgs84',
success: (res) => {
resolve(res)
},
fail() {
reject()
_this.$toast('获取定位失败,请点击右下角按钮重新尝试定位')
},
complete: res => {
console.log(res)
}
})
})
},
}
}
</script>
<style scoped lang="scss">
.header {
padding: 20rpx;
}
.cate-filter {
padding: 20rpx 8rpx;
display: flex;
align-items: center;
justify-content: flex-start;
* {
margin-right: 10rpx;
flex-shrink: 0;
}
}
.shop-item {
background-color: white;
border-radius: 30rpx;
padding: 20rpx;
display: flex;
align-items: center;
justify-content: flex-start;
margin: 20rpx;
image {
width: 140rpx;
height: 140rpx;
border-radius: 20rpx;
margin-right: 15rpx;
flex-shrink: 0;
}
.content {
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
.title {
font-size: 30rpx;
font-weight: bold;
}
.tips {
font-size: 25rpx;
color: gray;
margin: 5rpx 0;
}
.score {
display: flex;
align-items: center;
justify-content: flex-start;
}
.cate {
display: flex;
align-items: center;
justify-content: flex-start;
:first-child {
margin-right: 15rpx;
}
}
.address {
display: flex;
align-items: center;
justify-content: space-between;
.sales-wrap {
display: flex;
align-items: flex-start;
justify-content: flex-end;
flex-direction: column;
margin-left: 15rpx;
font-size: 25rpx;
flex-shrink: 0;
color: #ef0021;
}
}
}
}
</style>

8
pages/user/index.vue

@ -120,10 +120,10 @@
</view> </view>
<view v-if="isLogin" @click="handleLogout()"
style="font-size: 18px;width: 90%;text-align: center;padding: 20rpx 0;text-align: center;background: linear-gradient(to top, #0E001F, #7B0373 );margin: 200rpx auto 0 ;color: #fff;border-radius: 40rpx;">
退出登录
</view>
<!-- <view v-if="isLogin" @click="handleLogout()"-->
<!-- style="font-size: 18px;width: 90%;text-align: center;padding: 20rpx 0;text-align: center;background: linear-gradient(to top, #0E001F, #7B0373 );margin: 200rpx auto 0 ;color: #fff;border-radius: 40rpx;">-->
<!-- 退出登录-->
<!-- </view>-->
</view> </view>
<view slot="gFooter" class="gui-flex gui-rows gui-nowrap gui-space-between gui-align-items-end" <view slot="gFooter" class="gui-flex gui-rows gui-nowrap gui-space-between gui-align-items-end"
style="background: linear-gradient(to top, #0E001F, #7B0373 );padding-bottom: 100rpx;"> style="background: linear-gradient(to top, #0E001F, #7B0373 );padding-bottom: 100rpx;">

22
pages/user/shop/addgoods.vue

@ -239,12 +239,12 @@
<mp-html :content="spxq" /> <mp-html :content="spxq" />
</view> </view>
<view class="gui-margin-top" style="padding: 0 120rpx;">
<gui-radio @change="radioChange" :checked="radiochecked">
<text class="gui-text " style="color: #9e9e9e;">我已阅读并同意<text style="color: #b53190;"
@click="onagreement">商家入驻协议</text></text>
</gui-radio>
</view>
<!-- <view class="gui-margin-top" style="padding: 0 120rpx;">-->
<!-- <gui-radio @change="radioChange" :checked="radiochecked">-->
<!-- <text class="gui-text " style="color: #9e9e9e;">我已阅读并同意<text style="color: #b53190;"-->
<!-- @click="onagreement">商家入驻协议</text></text>-->
<!-- </gui-radio>-->
<!-- </view>-->
<view class=" gui-flex gui-rows gui-nowrap gui-justify-content-end"> <view class=" gui-flex gui-rows gui-nowrap gui-justify-content-end">
<button type="default" class="gui-button gui-bg-blue" <button type="default" class="gui-button gui-bg-blue"
style="width: 90%;text-align: center;padding: 0rpx 0;text-align: center;background: linear-gradient(to bottom, #90178b, #590b6e);margin: 80rpx auto 0;color: #fff;border-radius: 40rpx;" style="width: 90%;text-align: center;padding: 0rpx 0;text-align: center;background: linear-gradient(to bottom, #90178b, #590b6e);margin: 80rpx auto 0;color: #fff;border-radius: 40rpx;"
@ -454,7 +454,7 @@
let _this = this let _this = this
CategoryApi.shoplist() CategoryApi.shoplist()
.then(result => { .then(result => {
_this.dataSource = result.data.list
_this.dataSource = result.data.list.filter(item => item.parent_id === 0)
_this.getAllClassify() _this.getAllClassify()
}) })
@ -837,10 +837,10 @@
app.$toast('请编辑商品详情') app.$toast('请编辑商品详情')
return false return false
} }
if (!app.radiochecked) {
app.$toast('请阅读协议')
return false
}
// if (!app.radiochecked) {
// app.$toast('')
// return false
// }
const imagesLength = app.getImagesLength() const imagesLength = app.getImagesLength()
if (imagesLength == 0) { if (imagesLength == 0) {
app.$toast('请上传商品图片') app.$toast('请上传商品图片')

280
pages/user/shop/goodsdetail.vue

@ -19,14 +19,21 @@
</view> </view>
<view class="gui-padding" style="background-color: #fff;border-radius: 10rpx;"> <view class="gui-padding" style="background-color: #fff;border-radius: 10rpx;">
<view class="gui-form-item gui-border-b"> <view class="gui-form-item gui-border-b">
<text class="gui-form-label"><text style="color: red;">*</text>商品名称</text>
<text class="gui-form-label">
<text style="color: red;">*</text>
商品名称
</text>
<view class="gui-form-body"> <view class="gui-form-body">
<input type="text" class="gui-form-input" name="goods_name" <input type="text" class="gui-form-input" name="goods_name"
v-model="goods.goods_name" style="text-align: right;" placeholder="请输入商品名称" />
v-model="goods.goods_name" style="text-align: right;"
placeholder="请输入商品名称"/>
</view> </view>
</view> </view>
<view class="gui-form-item gui-border-b"> <view class="gui-form-item gui-border-b">
<text class="gui-form-label"><text style="color: red;">*</text>商品分类</text>
<text class="gui-form-label">
<text style="color: red;">*</text>
商品分类
</text>
<view class="gui-form-body" style="text-align: right;"> <view class="gui-form-body" style="text-align: right;">
<picker class="item-picker" mode="multiSelector" range-key="name" <picker class="item-picker" mode="multiSelector" range-key="name"
@ -40,11 +47,15 @@
</view> </view>
<view class="gui-form-item gui-border-b"> <view class="gui-form-item gui-border-b">
<text class="gui-form-label"><text style="color: red;">*</text>可用时间</text>
<text class="gui-form-label">
<text style="color: red;">*</text>
可用时间
</text>
<view class="gui-form-body" style="text-align: right;"> <view class="gui-form-body" style="text-align: right;">
<picker mode="selector" range-key="name" :range="timesList" @change="pickerTimes"> <picker mode="selector" range-key="name" :range="timesList" @change="pickerTimes">
<text class="gui-text gui-secondary-text" <text class="gui-text gui-secondary-text"
v-if="TimesIndex > -1">{{timesList[TimesIndex].name}}</text>
v-if="TimesIndex > -1">{{ timesList[TimesIndex].name }}
</text>
<text class="gui-text gui-secondary-text" v-else>请选择可用时间</text> <text class="gui-text gui-secondary-text" v-else>请选择可用时间</text>
</picker> </picker>
@ -53,11 +64,15 @@
<text class="gui-form-icon gui-icons gui-text-center gui-color-gray">&#xe601;</text> <text class="gui-form-icon gui-icons gui-text-center gui-color-gray">&#xe601;</text>
</view> </view>
<view class="gui-form-item gui-border-b"> <view class="gui-form-item gui-border-b">
<text class="gui-form-label"><text style="color: red;">*</text>使用方式</text>
<text class="gui-form-label">
<text style="color: red;">*</text>
使用方式
</text>
<view class="gui-form-body" style="text-align: right;"> <view class="gui-form-body" style="text-align: right;">
<picker mode="selector" range-key="name" :range="usesList" @change="pickerUses"> <picker mode="selector" range-key="name" :range="usesList" @change="pickerUses">
<text class="gui-text gui-secondary-text" <text class="gui-text gui-secondary-text"
v-if="UsesIndex > -1">{{usesList[UsesIndex].name}}</text>
v-if="UsesIndex > -1">{{ usesList[UsesIndex].name }}
</text>
<text class="gui-text gui-secondary-text" v-else>请选择使用方式</text> <text class="gui-text gui-secondary-text" v-else>请选择使用方式</text>
</picker> </picker>
@ -67,7 +82,10 @@
</view> </view>
<view class="gui-form-item"> <view class="gui-form-item">
<text class="gui-form-label"><text style="color: red;">*</text>商品主图</text>
<text class="gui-form-label">
<text style="color: red;">*</text>
商品主图
</text>
</view> </view>
<view class="image-list"> <view class="image-list">
<view class="image-preview" v-for="(image, imageIndex) in formData[0].imageList" <view class="image-preview" v-for="(image, imageIndex) in formData[0].imageList"
@ -84,8 +102,12 @@
</view> </view>
<view style="height: 20rpx;"></view> <view style="height: 20rpx;"></view>
<view class="gui-form-item gui-border-b"> <view class="gui-form-item gui-border-b">
<text class="gui-form-label" style="width: 200rpx;"><text
style="color: red;">*</text>抢购截止日期</text>
<text class="gui-form-label" style="width: 200rpx;">
<text
style="color: red;">*
</text>
抢购截止日期
</text>
<view class="gui-form-body" style="text-align: right;"> <view class="gui-form-body" style="text-align: right;">
<gui-datetime @confirm="confirm1" :value="demo1Val" @change="chang1" <gui-datetime @confirm="confirm1" :value="demo1Val" @change="chang1"
:isSecond="false" :isMinute="false" :isTime="false"> :isSecond="false" :isMinute="false" :isTime="false">
@ -94,8 +116,12 @@
</view> </view>
</view> </view>
<view class="gui-form-item gui-border-b"> <view class="gui-form-item gui-border-b">
<text class="gui-form-label" style="width: 200rpx;"><text
style="color: red;">*</text>使用截止日期</text>
<text class="gui-form-label" style="width: 200rpx;">
<text
style="color: red;">*
</text>
使用截止日期
</text>
<view class="gui-form-body" style="text-align: right;"> <view class="gui-form-body" style="text-align: right;">
<gui-datetime @confirm="confirm2" :value="use_time" :isSecond="false" <gui-datetime @confirm="confirm2" :value="use_time" :isSecond="false"
:isMinute="false" :isTime="false"> :isMinute="false" :isTime="false">
@ -108,7 +134,6 @@
</view> </view>
<view> <view>
<view class="form-box"> <view class="form-box">
<view class="form-item2"> <view class="form-item2">
@ -153,20 +178,23 @@
<view class="form-item" style="height:80rpx;line-height:80rpx"> <view class="form-item" style="height:80rpx;line-height:80rpx">
<view class="f1">商品价</view> <view class="f1">商品价</view>
<view class="f2"><input type="text" @input="gglistInput" :data-index="index" <view class="f2"><input type="text" @input="gglistInput" :data-index="index"
data-field="goods_price" :value="item.goods_price" placeholder="请填写商品价"
data-field="goods_price" :value="item.goods_price"
placeholder="请填写商品价"
placeholder-style="color:#888"></input></view> placeholder-style="color:#888"></input></view>
</view> </view>
<view class="form-item" style="height:80rpx;line-height:80rpx"> <view class="form-item" style="height:80rpx;line-height:80rpx">
<view class="f1">划线价</view> <view class="f1">划线价</view>
<view class="f2"><input type="text" @input="gglistInput" :data-index="index" <view class="f2"><input type="text" @input="gglistInput" :data-index="index"
data-field="line_price" :value="item.line_price" placeholder="请填写划线价"
data-field="line_price" :value="item.line_price"
placeholder="请填写划线价"
placeholder-style="color:#888"></input></view> placeholder-style="color:#888"></input></view>
</view> </view>
<view class="form-item" style="height:80rpx;line-height:80rpx"> <view class="form-item" style="height:80rpx;line-height:80rpx">
<view class="f1">库存</view> <view class="f1">库存</view>
<view class="f2"><input type="text" @input="gglistInput" :data-index="index" <view class="f2"><input type="text" @input="gglistInput" :data-index="index"
data-field="stock" :value="item.stock" placeholder="请填写库存"
data-field="stock" :value="item.stock"
placeholder="请填写库存"
placeholder-style="color:#888"></input></view> placeholder-style="color:#888"></input></view>
</view> </view>
@ -183,18 +211,33 @@
<view class="table" v-for="(titem,tindex) in item.taocanList"> <view class="table" v-for="(titem,tindex) in item.taocanList">
<view class="tr"> <view class="tr">
<view class="th b-r"><text class="col-mm">*</text>名称</view>
<view class="th b-r"><text class="col-mm">*</text>数量</view>
<view class="th b-r"><text class="col-mm">*</text>单位</view>
<view class="th b-r">
<text class="col-mm">*</text>
名称
</view>
<view class="th b-r">
<text class="col-mm">*</text>
数量
</view>
<view class="th b-r">
<text class="col-mm">*</text>
单位
</view>
<!-- <view class="th"><text class="col-mm">*</text>价格</view> --> <!-- <view class="th"><text class="col-mm">*</text>价格</view> -->
</view> </view>
<view class="tr2"> <view class="tr2">
<view class="td b-r"><text
class="twoline-hide">{{titem.name}}</text></view>
<view class="td b-r"><text class="twoline-hide">{{titem.sum}}</text>
<view class="td b-r">
<text
class="twoline-hide">{{ titem.name }}
</text>
</view> </view>
<view class="td b-r"><text
class="twoline-hide">{{titem.unit}}</text>
<view class="td b-r">
<text class="twoline-hide">{{ titem.sum }}</text>
</view>
<view class="td b-r">
<text
class="twoline-hide">{{ titem.unit }}
</text>
</view> </view>
<!-- <view class="td"><text class="twoline-hide">{{titem.money}}</text> <!-- <view class="td"><text class="twoline-hide">{{titem.money}}</text>
</view> --> </view> -->
@ -226,14 +269,15 @@
</view> </view>
</view> </view>
<view style="margin: 20rpx 20rpx " <view style="margin: 20rpx 20rpx "
class="gui-flex gui-rows gui-nowrap gui-align-items-center gui-space-between"> class="gui-flex gui-rows gui-nowrap gui-align-items-center gui-space-between">
<text class="gui-h6 gui-bold"><text style="color: red;">*</text>购买须知</text>
<text class="gui-h6 gui-bold">
<text style="color: red;">*</text>
购买须知
</text>
<text style="font-size: 24rpx;color: #9E1A91 ;" @click="bianjiqi('gmxz')">编辑</text> <text style="font-size: 24rpx;color: #9E1A91 ;" @click="bianjiqi('gmxz')">编辑</text>
</view> </view>
<view class="gui-padding" style="background-color: #fff;border-radius: 10rpx;font-size: 24rpx; <view class="gui-padding" style="background-color: #fff;border-radius: 10rpx;font-size: 24rpx;
@ -242,7 +286,10 @@
</view> </view>
<view style="margin: 20rpx 20rpx " <view style="margin: 20rpx 20rpx "
class="gui-flex gui-rows gui-nowrap gui-align-items-center gui-space-between"> class="gui-flex gui-rows gui-nowrap gui-align-items-center gui-space-between">
<text class="gui-h6 gui-bold"><text style="color: red;">*</text>商品详情</text>
<text class="gui-h6 gui-bold">
<text style="color: red;">*</text>
商品详情
</text>
<text style="font-size: 24rpx;color: #9E1A91 ;" @click="bianjiqi('spxq')">编辑</text> <text style="font-size: 24rpx;color: #9E1A91 ;" @click="bianjiqi('spxq')">编辑</text>
</view> </view>
<view class="gui-padding" style="background-color: #fff;border-radius: 10rpx;min-height: 200rpx; <view class="gui-padding" style="background-color: #fff;border-radius: 10rpx;min-height: 200rpx;
@ -250,12 +297,15 @@
<mp-html :content="spxq"/> <mp-html :content="spxq"/>
</view> </view>
<view class="gui-margin-top" style="padding: 0 120rpx;">
<gui-radio @change="radioChange" :checked="radiochecked">
<text class="gui-text " style="color: #9e9e9e;">我已阅读并同意<text style="color: #b53190;"
@click="onagreement">商家入驻协议</text></text>
</gui-radio>
</view>
<!-- <view class="gui-margin-top" style="padding: 0 120rpx;">-->
<!-- <gui-radio @change="radioChange" :checked="radiochecked">-->
<!-- <text class="gui-text " style="color: #9e9e9e;">我已阅读并同意-->
<!-- <text style="color: #b53190;"-->
<!-- @click="onagreement">商家入驻协议-->
<!-- </text>-->
<!-- </text>-->
<!-- </gui-radio>-->
<!-- </view>-->
<view class=" gui-flex gui-rows gui-nowrap gui-justify-content-end"> <view class=" gui-flex gui-rows gui-nowrap gui-justify-content-end">
<button type="default" class="gui-button gui-bg-blue" <button type="default" class="gui-button gui-bg-blue"
style="width: 90%;text-align: center;padding: 0rpx 0;text-align: center;background: linear-gradient(to bottom, #90178b, #590b6e);margin: 80rpx auto 0;color: #fff;border-radius: 40rpx;" style="width: 90%;text-align: center;padding: 0rpx 0;text-align: center;background: linear-gradient(to bottom, #90178b, #590b6e);margin: 80rpx auto 0;color: #fff;border-radius: 40rpx;"
@ -315,8 +365,6 @@
</u-form-item> --> </u-form-item> -->
</u-form> </u-form>
</view> </view>
@ -343,6 +391,7 @@
import * as GoodsApi from '@/api/goods/index.js' import * as GoodsApi from '@/api/goods/index.js'
import * as CategoryApi from '@/api/category' import * as CategoryApi from '@/api/category'
import * as PageApi from '@/api/page' import * as PageApi from '@/api/page'
const maxImageLength = 6 const maxImageLength = 6
export default { export default {
@ -422,48 +471,35 @@
var systemInfo = graceJS.system(); var systemInfo = graceJS.system();
this.contentHeight = systemInfo.windowHeight * 0.65; this.contentHeight = systemInfo.windowHeight * 0.65;
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) {
async onLoad(options) {
this.goodsId = options.goodsId this.goodsId = options.goodsId
await this.getCategory()
this.getArticleDetail() this.getArticleDetail()
this.getCategory()
this.getTimesList() this.getTimesList()
this.getUsesList() this.getUsesList()
}, },
onShow() { onShow() {
this.spxq = uni.getStorageSync('spxq') this.spxq = uni.getStorageSync('spxq')
this.gmxz = uni.getStorageSync('gmxz') this.gmxz = uni.getStorageSync('gmxz')
}, },
methods: { methods: {
getTimesList() { getTimesList() {
let _this = this let _this = this
PageApi.getTimesList() PageApi.getTimesList()
.then(result => { .then(result => {
_this.timesList = result.data.list _this.timesList = result.data.list
}) })
}, },
getUsesList() { getUsesList() {
let _this = this let _this = this
PageApi.getUsesList() PageApi.getUsesList()
.then(result => { .then(result => {
_this.usesList = result.data.list _this.usesList = result.data.list
}) })
}, },
gglistInput: function (e) { gglistInput: function (e) {
var index = e.currentTarget.dataset.index; var index = e.currentTarget.dataset.index;
var field = e.currentTarget.dataset.field; var field = e.currentTarget.dataset.field;
@ -472,7 +508,6 @@
this.gglist = gglist; this.gglist = gglist;
console.log(gglist) console.log(gglist)
}, },
showTancanPop(index) { showTancanPop(index) {
this.taocanIndex = index this.taocanIndex = index
this.formDataTaocan = { this.formDataTaocan = {
@ -482,7 +517,6 @@
} }
this.taocanShow = true this.taocanShow = true
}, },
queuPi(index, tindex) { queuPi(index, tindex) {
let app = this let app = this
//var index = this.taocanIndex //var index = this.taocanIndex
@ -514,16 +548,8 @@
// }) // })
// return // return
// } // }
app.gglist.forEach((item, key) => { app.gglist.forEach((item, key) => {
var taocanList = item.taocanList ? item.taocanList : []; var taocanList = item.taocanList ? item.taocanList : [];
if (tindex == key) { if (tindex == key) {
if (index >= 0) { if (index >= 0) {
@ -534,7 +560,6 @@
} else { } else {
newArr.push(item) newArr.push(item)
} }
}) })
taocanList = newArr taocanList = newArr
console.log(index) console.log(index)
@ -542,57 +567,28 @@
taocanList = taocanList.concat(app.formDataTaocan) taocanList = taocanList.concat(app.formDataTaocan)
} }
} }
item.taocanList = taocanList item.taocanList = taocanList
// if (key == index) { // if (key == index) {
// var taocanList = item.taocanList ? item.taocanList : [] // var taocanList = item.taocanList ? item.taocanList : []
// taocanList.push(app.formDataTaocan) // taocanList.push(app.formDataTaocan)
// item.taocanList = taocanList // item.taocanList = taocanList
// } // }
return item return item
}) })
console.log(app.gglist)
app.taocanShow = false app.taocanShow = false
}, },
editTaocan(index, gindex) { editTaocan(index, gindex) {
let app = this let app = this
app.taocanShow = true app.taocanShow = true
app.gglist.forEach((item, key) => { app.gglist.forEach((item, key) => {
if (key == gindex) { if (key == gindex) {
app.formDataTaocan = item.taocanList[index] app.formDataTaocan = item.taocanList[index]
app.formDataTaocan.index = index app.formDataTaocan.index = index
} }
}) })
}, },
deleteTaocan(index, gindex) { deleteTaocan(index, gindex) {
let app = this let app = this
// app.gglist.forEach((item, key) => { // app.gglist.forEach((item, key) => {
// if(item.taocanList){ // if(item.taocanList){
// if (key == gindex) { // if (key == gindex) {
@ -615,22 +611,13 @@
newArr.push(dd) newArr.push(dd)
} }
}) })
item.taocanList = newArr item.taocanList = newArr
} }
newgg.push(item) newgg.push(item)
}) })
app.gglist = newgg app.gglist = newgg
console.log(app.gglist) console.log(app.gglist)
}, },
addggname: function (e) { addggname: function (e) {
var ggindex = e.currentTarget.dataset.index; var ggindex = e.currentTarget.dataset.index;
this.guige_name = ''; this.guige_name = '';
@ -646,12 +633,9 @@
var title = e.currentTarget.dataset.title; var title = e.currentTarget.dataset.title;
that.guigedata.forEach(function (element, index) { that.guigedata.forEach(function (element, index) {
element.items.splice(ggindex2, 1) element.items.splice(ggindex2, 1)
return element return element
}) })
that.gglist.splice(ggindex2, 1) that.gglist.splice(ggindex2, 1)
}, },
setggname: function (done, val) { setggname: function (done, val) {
var val = this.guige_name var val = this.guige_name
@ -680,21 +664,12 @@
var gglist = this.gglist; var gglist = this.gglist;
var len = guigedata.length; var len = guigedata.length;
var newlen = 1; var newlen = 1;
var guige = {} var guige = {}
guige.name = this.guige_name guige.name = this.guige_name
guige.goods_price = '' guige.goods_price = ''
guige.line_price = '' guige.line_price = ''
guige.stock = 100 guige.stock = 100
guige.taocanList = [] guige.taocanList = []
this.gglist.push(guige); this.gglist.push(guige);
console.log(555); console.log(555);
console.log(gglist); console.log(gglist);
@ -725,18 +700,14 @@
_this.UsesIndex = index _this.UsesIndex = index
} }
}) })
_this.childArr.forEach(function(elements, index) {
elements.forEach(function(element, indess) {
if (element.category_id == _this.category_id) {
_this.name = element.name
}
});
});
// _this.childArr.forEach(function (elements, index) {
// elements.forEach(function (element, indess) {
// if (element.category_id == _this.category_id) {
// _this.name = element.name
// }
// });
//
// });
_this.goods.goods_images.forEach(function (element, index) { _this.goods.goods_images.forEach(function (element, index) {
// uni.downloadFile({ // uni.downloadFile({
// url: element.preview_url, // // url: element.preview_url, //
@ -754,17 +725,22 @@
}) })
_this.formData[0]['uploaded'].push(element.file_id) _this.formData[0]['uploaded'].push(element.file_id)
}); });
_this.dataSource.forEach((parent, parentIndex) => {
if (parent.children && parent.children.length > 0) {
const index = parent.children.findIndex(child => child.category_id === _this.category_id)
if (index > -1) {
_this.name = parent.children[index].name
_this.classifyIndex = [parentIndex, index]
_this.classifyArr[1] = parent.children
}
}
})
}) })
}, },
submit: function (e) { submit: function (e) {
const app = this const app = this
var fromData = e.detail.value; var fromData = e.detail.value;
if (!fromData['goods_name']) { if (!fromData['goods_name']) {
app.$toast('请填写商品名称') app.$toast('请填写商品名称')
return false return false
@ -798,14 +774,10 @@
app.$toast('请选择使用日期') app.$toast('请选择使用日期')
return false return false
} }
if (app.gglist.length == 0) { if (app.gglist.length == 0) {
app.$toast('请设置套餐') app.$toast('请设置套餐')
return false return false
} }
if (!app.gmxz) { if (!app.gmxz) {
app.$toast('请编辑购买须知') app.$toast('请编辑购买须知')
return false return false
@ -814,22 +786,21 @@
app.$toast('请编辑商品详情') app.$toast('请编辑商品详情')
return false return false
} }
if (!app.radiochecked) {
app.$toast('请阅读协议')
return false
}
// if (!app.radiochecked) {
// app.$toast('')
// return false
// }
const imagesLength = app.getImagesLength() const imagesLength = app.getImagesLength()
if (imagesLength == 0) { if (imagesLength == 0) {
app.$toast('请上传商品图片') app.$toast('请上传商品图片')
return false return false
} }
fromData.uses_id = app.usesList[app.UsesIndex].uses_id fromData.uses_id = app.usesList[app.UsesIndex].uses_id
fromData.times_id = app.timesList[app.TimesIndex].times_id fromData.times_id = app.timesList[app.TimesIndex].times_id
fromData.category_id = app.category_id fromData.category_id = app.category_id
fromData.become_time = app.demo1Val fromData.become_time = app.demo1Val
fromData.use_time = app.use_time
fromData.content = app.spxq fromData.content = app.spxq
fromData.contents = app.gmxz fromData.contents = app.gmxz
@ -838,10 +809,7 @@
// //
app.disabled = true app.disabled = true
// //
console.log(imagesLength) console.log(imagesLength)
if (imagesLength > 0) { if (imagesLength > 0) {
app.uploadFile() app.uploadFile()
.then(() => { .then(() => {
@ -870,7 +838,6 @@
}) })
return imagesLength return imagesLength
}, },
// //
onSubmit(fromData) { onSubmit(fromData) {
const app = this const app = this
@ -882,12 +849,11 @@
app.$toast(result.message) app.$toast(result.message)
setTimeout(() => { setTimeout(() => {
app.disabled = false app.disabled = false
uni.navigateBack()
// uni.navigateBack()
}, 1500) }, 1500)
}) })
.catch(err => app.disabled = false) .catch(err => app.disabled = false)
}, },
// //
uploadFile() { uploadFile() {
const app = this const app = this
@ -897,7 +863,6 @@
// //
const files = [] const files = []
var uploaded = app.formData[0].uploaded var uploaded = app.formData[0].uploaded
console.log(formData) console.log(formData)
var newrr = [] var newrr = []
formData.forEach((item, index) => { formData.forEach((item, index) => {
@ -914,10 +879,8 @@
formDataIndex: index, formDataIndex: index,
images images
}) })
} }
}) })
console.log(files) console.log(files)
// //
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -942,16 +905,22 @@
confirm1: function (res) { confirm1: function (res) {
this.demo1Val = res[0] + '-' + res[1] + '-' + res[2]; this.demo1Val = res[0] + '-' + res[1] + '-' + res[2];
}, },
confirm2: function (res) {
this.use_time = res[0] + '-' + res[1] + '-' + res[2];
},
pickerCategory(e) { pickerCategory(e) {
this.CategoryIndex = e.detail.value; this.CategoryIndex = e.detail.value;
}, },
getCategory() { getCategory() {
return new Promise(resolve => {
let _this = this let _this = this
CategoryApi.shoplist() CategoryApi.shoplist()
.then(result => { .then(result => {
_this.dataSource = result.data.list
_this.dataSource = result.data.list.filter(item => item.parent_id === 0)
_this.getAllClassify() _this.getAllClassify()
_this.getGoods() _this.getGoods()
resolve()
})
}) })
}, },
@ -962,7 +931,7 @@
for (let i = 0; i < dataLen; i++) { for (let i = 0; i < dataLen; i++) {
// push childArr // push childArr
this.childArr.push(this.dataSource[i].children) this.childArr.push(this.dataSource[i].children)
};
}
// //
this.classifyArr[0] = this.dataSource; this.classifyArr[0] = this.dataSource;
@ -1018,8 +987,6 @@
.then(result => { .then(result => {
app.ArticleDetail = result.data.detail app.ArticleDetail = result.data.detail
}) })
}, },
radioChange(e) { radioChange(e) {
this.radiochecked = !this.radiochecked this.radiochecked = !this.radiochecked
@ -1055,10 +1022,13 @@
fanhui() { fanhui() {
uni.navigateBack() uni.navigateBack()
}, },
pickerTimes(e) {
this.TimesIndex = e.detail.value;
},
pickerUses(e) {
this.UsesIndex = e.detail.value;
},
}, },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

Loading…
Cancel
Save