Merge branch 'dev' into test

This commit is contained in:
lifizer
2024-05-09 10:50:37 +08:00
63 changed files with 2533 additions and 5171 deletions
+19
View File
@@ -144,6 +144,20 @@ export function changeCartNum(id, number) {
});
}
/*
* 购物车 获取商品规格
* */
export function getCartGoodAttr(id, uniqueId) {
return request.get(`/product/attr/${id}?uniqueId=${uniqueId}`)
}
/*
* 购物车 商品规格修改
* */
export function cartGoodChangeAttr(data) {
return request.post('/cart/changeAttr', data)
}
/**
* 搜索推荐关键字
*/
@@ -196,3 +210,8 @@ export function storeListApi(data) {
login: false
});
}
// 商品列表
export function getHotels(param) {
return request.get('/api/hotelMain/search', param, { login: false })
}
+15
View File
@@ -539,3 +539,18 @@ export function getRechargeApi() {
export function getUserCenterBanner() {
return request.get("userCenterBanner");
}
/*
* 用户积分信息
*/
export function getUserPointInfo(param) {
return request.get('/user/points/info', param, { login: true })
}
/*
* 用户积分记录
*/
export function getUserPointBill(param) {
return request.get('/user/points/bill', param, { login: true })
}
+12 -2
View File
@@ -54,8 +54,10 @@
}
.value {
width: 200rpx;
color: #9D9D9D;
font-size: 24rpx;
text-align: right;
}
.red {
@@ -180,9 +182,10 @@
.title {
width: 160rpx;
padding: 16rpx;
border-right: 2rpx solid #D2D2D2;
color: #ADADAD;
.title-cont {
padding: 16rpx;
}
}
}
@@ -191,6 +194,13 @@
}
.value {
width: calc(100% - 160rpx);
border-left: 2rpx solid #D2D2D2;
.value-cont {
padding: 16rpx;
}
}
.btn {
width: 100%;
padding: 16rpx;
}
+4 -2
View File
@@ -843,6 +843,8 @@ page {
}
.goodWrapper .item .text {
display: flex;
flex-flow: column;
width: 5.37*100rpx;
position: relative;
}
@@ -866,7 +868,6 @@ page {
.goodWrapper .item .text .money {
font-size: 0.26*100rpx;
margin-top: 0.17*100rpx;
}
.goodWrapper .item .text .evaluate {
@@ -3254,6 +3255,7 @@ page {
.my-order .list .item .item-info .text .money {
text-align: right;
color: #333;
}
.my-order .list .item .totalPrice {
@@ -3422,7 +3424,7 @@ page {
.order-details .wrapper .item .conter {
color: #868686;
width: 5*100rpx;
width: 4.5*100rpx;
text-align: right;
}
+6 -1
View File
@@ -1,6 +1,6 @@
<template>
<view class="components-checkbox-icon jc-center ai-center" :class="{'isSelected':isSelected}" @click="change">
<image class="icon-hook" :src="$VUE_APP_RESOURCES_URL+'/20240109175325131970.png'" mode="scaleToFill" v-if="isSelected"/>
<image class="icon-hook" :src="webUrl + '/20240109175325131970.png'" mode="scaleToFill" v-if="isSelected"/>
</view>
</template>
@@ -19,6 +19,11 @@ export default {
}
}
},
data() {
return {
webUrl: Object.freeze(this.$VUE_APP_RESOURCES_URL)
}
},
computed: {
isSelected: function() {
return this.defaultState
+30 -13
View File
@@ -1,21 +1,35 @@
<template>
<view class="components-coupons">
<image class="coupons__cover" :src="data.image" mode="widthFix"/>
<image
:src="data.image"
class="coupons__cover"
mode="widthFix"
/>
<view class="coupons__section flex jc-between ai-center">
<view>有效期至
<text>{{ data.endTime }}</text>
</view>
<view class="coupons__tag coupons__tag-expire" v-if="data.status===2">已到期</view>
<view class="coupons__tag" @click="goGoods()" v-if="data.status===0 && !radioModel">去使用</view>
<!-- status: 0-未使用1-已使用2-已过期 -->
<view
v-if="data.status === 2"
class="coupons__tag coupons__tag-expire"
>已到期</view>
<view
v-if="data.status === 0 && !radioModel"
class="coupons__tag coupons__tag-expire"
>不可用</view>
<view @click="selectCoupon">
<radio :value="data.id" :checked="data.checked" color="#FF564A" v-if="radioModel && data.status===0"/>
<radio
v-if="radioModel && data.status === 0"
:value="data.id"
:checked="data.checked"
color="#FF564A"
/>
</view>
</view>
<view class="coupons__rules">
<view class="coupons__rules-title" @click="changeRules()">使用规则
<image :class="{'open':isOpen}" :src="webUrl+'/20231125220409665027.png'" mode="scaleToFill"/>
<image :class="{'open':isOpen}" :src="webUrl + '/20231125220409665027.png'" mode="scaleToFill"/>
</view>
<view
:class="isOpen ? 'auto-height' : ''"
@@ -31,7 +45,13 @@
export default {
name: "Coupons",
props: {
data: Object,
data: {
type: Object,
default: () => {
return {}
}
},
// 是否显示选择框
radioModel: {
type: Boolean,
default: false
@@ -51,13 +71,10 @@ export default {
changeRules() {
this.isOpen = !this.isOpen
},
goGoods() {
uni.switchTab({url: '/pages/home/landMark'})
// this.$global.navToGoods(this.data.productId)
},
selectCoupon() {
if (!this.radioModel) return
this.$emit('change', this.data.id)
// 已选中则可以取消选中
this.$emit('change', this.data.checked ? '' : this.data.id)
}
}
}
+46 -39
View File
@@ -2,20 +2,41 @@
<view class="popup-coupons">
<view class="popup-box">
<view class="popup-title bold tc">选择优惠券</view>
<SubSection :current="current" :can-use="canUse" :not-use="notUse" radioModel @change="changeNav"/>
<SubSection
:current="current"
:can-use="canUse"
:not-use="notUse"
radio-model
@change="changeNav"
/>
<view class="list-box">
<view style="margin-bottom: 20rpx" v-for="(item,index) in list" :key="index">
<Coupons :data="item" radioModel @change="selectCoupon"/>
<view
v-for="(item, index) in list"
:key="index"
style="margin-bottom: 20rpx"
>
<Coupons
:data="item"
:radio-model="current === 0"
@change="selectCoupon"
/>
</view>
<view class="tc" v-if="list.length===0">
<view
v-if="list.length === 0"
class="tc"
>
<image class="zero-coupons" :src="webUrl+'/20231201201733142658.png'" mode="scaleToFill"/>
</view>
</view>
</view>
<button disabled></button>
<view class="btn-done bold flex jc-center ai-center" :class="{'btn-disabled':current===1}" @click="setCoupon" v-if="current===0">确定
<view
v-if="current === 0"
:class="{ 'btn-disabled': current === 1 }"
class="btn-done bold flex jc-center ai-center"
@click="setCoupon"
>
确定
</view>
</view>
</template>
@@ -26,16 +47,26 @@ import Coupons from '@/components/Coupons.vue'
export default {
name: 'CouponsPopup',
components: {SubSection, Coupons},
components: { SubSection, Coupons },
props: {
twoList: {
type: Object,
default: {}
default: {
usable: [],
unusable: []
}
}
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
current: 0,
couponId: uni.getStorageSync('couponId') || 0
}
},
computed: {
list() {
let temp = this.current === 0 ? this.twoList['usable'] : this.twoList['unusable']
const temp = this.current === 0 ? this.twoList['usable'] : this.twoList['unusable']
return this.$global.deepClone(temp)
},
canUse() {
@@ -45,44 +76,20 @@ export default {
return this.twoList['unusable'].length
}
},
watch: {
current() {
this.selectCoupon(this.couponId)
}
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
current: 0,
couponId: 0
}
},
mounted() {
this.couponId = uni.getStorageSync('couponId') || 0
this.selectCoupon(this.couponId)
},
methods: {
changeNav(index) {
this.current = index
},
selectCoupon(id) {
const isCancel = this.couponId === id
this.couponId = isCancel ? 0 : id
this.list?.forEach(item => {
if (!isCancel) {
item.checked = id === item.id
} else {
item.checked = false
}
this.couponId = id
this.list.map(item => {
item.checked = id === item.id
})
},
setCoupon() {
if (this.current === 1) return
// if (this.couponId !== 0) {
uni.setStorageSync('couponId', this.couponId)
// }
this.$emit('close')
uni.setStorageSync('couponId', this.couponId)
this.$emit('change')
}
}
}
+77 -38
View File
@@ -1,39 +1,57 @@
<template>
<view class="orderGoods">
<view v-if="title.length>0" class="total acea-row row-middle" >
<view class="acea-row row-left row-middle" style="position: relative;">
<image style="width: 32rpx;height: 32rpx;margin-right: 12rpx;" src="http://admin-api.xdd618.com/file/pic/20210807230759738342.png" mode=""></image>
<text class="title">{{title}}</text>
<!-- <text class="pink-dot"></text> -->
</view>
</view>
<view v-else class="total">{{ cartInfo.length }}件商品</view>
<view
v-if="title.length > 0"
class="total acea-row row-middle"
>
<view
style="position: relative;"
class="acea-row row-left row-middle"
>
<image
style="width: 32rpx;height: 32rpx;margin-right: 12rpx;"
src="http://admin-api.xdd618.com/file/pic/20210807230759738342.png" mode=""
/>
<text class="title">
{{ title }}
</text>
</view>
</view>
<view
v-else
class="total"
>{{ cartInfo.length }}件商品</view>
<view class="goodWrapper">
<view class="item acea-row row-between-wrapper" style="flex-wrap: nowrap;" v-for="cart in cartInfo" :key="cart.id">
<view
v-for="cart in cartInfo"
:key="cart.id"
class="item acea-row row-between-wrapper"
style="flex-wrap: nowrap;"
>
<view class="pictrue" style="margin-right: 20rpx;">
<image :src="cart.productInfo.image" class="image" />
</view>
<view class="text">
<view class="acea-row row-between-wrapper">
<view class="name line1">{{ cart.productInfo.storeName }}</view>
<!-- <view class="num">x {{ cart.cartNum }}</view> -->
<view class="name line1 one-t">{{ cart.productInfo.storeName }}</view>
</view>
<!-- <view
class="attr line1"
v-if="cart.productInfo.attrInfo"
>{{ cart.productInfo.attrInfo.sku }}</view> -->
<view class="acea-row row-middle row-between">
<view
class="attr"
style="height: 38rpx;line-height:38rpx;background-color: #FFF3F2;border-radius: 19rpx;padding: 4rpx 20rpx;"
v-if="cart.productInfo.attrInfo"
>属性{{ cart.productInfo.attrInfo.sku }}</view>
<view v-if="evaluate == 3" class="evaluate" style="bottom: 0 !important;position: relative;height: 36rpx !important;width: 90rpx !important;line-height: 36rpx !important;font-size: 32rpx;border-radius: 18rpx;" @click="routerGo(cart)">评价</view>
</view>
<view class="acea-row row-middle row-between attr-wrap">
<view
v-if="cart.productInfo.attrInfo"
class="attr more-t"
>
规格{{ cart.productInfo.attrInfo.sku }}
</view>
<view
v-if="evaluate == 3"
class="evaluate"
@click="routerGo(cart)"
>评价</view>
</view>
<view class="money font-color-lightred acea-row row-between">
<text>{{ cart.truePrice }}</text>
<text class="num" style="margin-left: 10rpx;">x{{ cart.cartNum }}</text>
</view>
<text>{{ cart.truePrice }}</text>
<text class="num">x{{ cart.cartNum }}</text>
</view>
</view>
</view>
</view>
@@ -68,21 +86,42 @@ export default {
};
</script>
<style scoped>
.pink-dot{
width:24rpx;
height:24rpx;
background:rgba(255,86,74,0.4);
border-radius:50%;
position: absolute;
z-index: 0;
bottom: 24rpx;
right: -12rpx;
}
.title{
font-size:26rpx;
color:#080F1A;
font-weight: bold;
}
.goodWrapper .item .pictrue {
width: 160rpx;
height: 160rpx;
}
.goodWrapper .item .pictrue .image {
display: block;
width: 160rpx;
height: 160rpx;
}
.attr-wrap {
position: relative;
min-height: 80rpx;
margin-top: 8rpx;
align-items: flex-start;
}
.text .attr {
max-width: calc(100% - 130rpx);
margin: 0 !important;
padding: 6rpx 20rpx;
border-radius: 20rpx;
line-height: 28rpx;
box-sizing: border-box;
background-color: #FFF3F2;
}
.evaluate {
position: relative;
top: 0;
height: 36rpx;
width: 90rpx;
border-radius: 36rpx !important;
line-height: 36rpx;
font-size: 28rpx;
}
</style>
+35 -26
View File
@@ -24,14 +24,14 @@
:key="indexn"
:class="{
'on': item.index == indexn,
'disabled': productValue[itemn.attr].stock === 0
'disabled': getAttrItemData(itemn.attr).stock === 0
}"
class="itemn"
@click="tapAttr(indexw, indexn, itemn)"
>
{{ itemn.attr }}
<text
v-if="productValue[itemn.attr].stock === 0"
v-if="getAttrItemData(itemn.attr).stock === 0"
class="tag"
>缺货</text>
</view>
@@ -66,18 +66,22 @@ export default {
type: Object,
default: () => {}
},
productValue: {
type: Object,
default: () => {}
// 使用字符串再转成对象的原因是,当key='2.5g'时,会变成key='2',导致数据丢失
productValueStr: {
type: String,
default: '{}'
},
productValueArr: {
type: Array,
default: () => {
return []
}
},
cartNum: {
type: Number,
default: () => 1
}
},
data: function() {
return {};
},
methods: {
previewImg:function(imgUrl){
uni.previewImage({
@@ -85,50 +89,55 @@ export default {
})
},
closeAttr: function() {
this.$emit("changeFun", { action: "changeattr", value: false });
this.$emit("changeFun", { action: "changeattr", value: false })
},
CartNumDes: function() {
this.$emit("changeFun", { action: "ChangeCartNum", value: false });
this.$emit("changeFun", { action: "ChangeCartNum", value: false })
},
CartNumAdd: function() {
this.$emit("changeFun", { action: "ChangeCartNum", value: 1 });
this.$emit("changeFun", { action: "ChangeCartNum", value: 1 })
},
getAttrItemData(attr) {
let result = {}
this.productValueArr.map(item => {
if (item.attrItemkey === attr) {
result = item
}
})
return result
},
tapAttr: function(indexw, indexn, itemn) {
if (this.productValue[itemn.attr].stock === 0) {
if (this.getAttrItemData(itemn.attr).stock === 0) {
return
}
// 修改商品规格不生效的原因:
// H5端下面写法,attr更新,但是除H5外其他端不支持,
// 尽量避免下面的骚写法,不要在子组件内更新props
// 这里修改是为了能获取到被选中的属性
this.attr.productAttr[indexw].index = indexn;
let that = this;
let value = that
.getCheckedValue()
.sort()
.join(",");
that.$emit("changeFun", {
this.attr.productAttr[indexw].index = indexn
const value = this.getCheckedValue().sort().join(",")
this.$emit("changeFun", {
action: "ChangeAttr",
value: {
value,
indexw,
indexn
}
});
})
},
//获取被选中属性
// 获取被选中属性
getCheckedValue: function() {
let productAttr = this.attr.productAttr;
let value = [];
const productAttr = this.attr.productAttr
const value = []
for (let i = 0; i < productAttr.length; i++) {
for (let j = 0; j < productAttr[i].attrValueArr.length; j++) {
if (productAttr[i].index === j) {
value.push(productAttr[i].attrValueArr[j]);
value.push(productAttr[i].attrValueArr[j])
}
}
}
return value;
return value
}
}
};
}
</script>
+16 -3
View File
@@ -1,9 +1,9 @@
<template>
<view class="evaluateWtapper">
<view
class="evaluateItem"
v-for="(item, evaluateWtapperIndex) in reply"
:key="evaluateWtapperIndex"
class="evaluateItem"
>
<view class="pic-text acea-row row-middle">
<view class="pictrue">
@@ -17,8 +17,21 @@
<view class="time">{{ item.createTime }} {{ item.sku||'' }}</view>
<view class="evaluate-infor">{{ item.comment }}</view>
<view class="imgList acea-row">
<view class="pictrue" v-for="(itemn, eq) in item.picturesArr" :key="eq">
<image :src="itemn" class="image" @click="previewImage(item.picturesArr,eq)" />
<view v-if="item.video" class="pictrue">
<video
:src="item.video"
:poster="item.video + '?vframe/jpg/offset/1'"
controls
play-btn-position="center"
class="image"
/>
</view>
<view
v-for="(itemn, eq) in item.picturesArr"
:key="eq"
class="pictrue"
>
<image :src="itemn" class="image" @click="previewImage(item.picturesArr, eq)" />
</view>
</view>
<view class="reply" v-if="item.merchantReplyContent">
+17 -2
View File
@@ -1,13 +1,28 @@
<template>
<view class="noCommodity">
<view class="noPictrue">
<image :src="webUrl+'/20210203153900181449.png'" class="image"/>
<image
v-if="type === 'good'"
:src=" webUrl + '/20210203153900181449.png'"
class="image"
/>
<image
v-if="type === 'hotel'"
:src=" webUrl + '/no-hotel.png'"
class="image"
/>
</view>
</view>
</template>
<script>
export default {
name: "NoGoodData",
name: 'NoGoodData',
props: {
type: {
type: String,
default: 'good'
}
},
data: function() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL
@@ -1,6 +1,11 @@
<template name="sunui-upimg">
<view class="sunui-uploader-bd">
<view class="sunui-uploader-files">
<view
v-if="showBlankPlaceholder"
:style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'"
class="sunui-uploader-file"
/>
<block v-for="(item, index) in upload_before_list" :key="index">
<view class="sunui-uploader-file" :class="[item.upload_percent < 100 ? 'sunui-uploader-file-status' : '']" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'">
<image class="sunui-uploader-img" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'" :src="item.path" mode="aspectFill" @tap="preview(index)" v-if="type === 'image'" />
@@ -10,7 +15,10 @@
</view>
</block>
<view v-show="upload_before_list.length < upload_count" hover-class="sunui-uploader-hover" class="sunui-uploader-inputbox" @tap="choose" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'">
<view :style="'line-height:'+ upload_img_wh + 'rpx;'"><text class="iconfont icon-mn_shangchuantupian" style="color: #666;"></text></view>
<view :style="'line-height:'+ upload_img_wh + 'rpx;'">
<text v-if="type === 'image'" class="iconfont icon-mn_shangchuantupian" style="color: #666;"></text>
<u-icon v-if="type === 'video'" size="48px" name="play-circle" style="color: #666;"></u-icon>
</view>
</view>
</view>
</view>
@@ -48,6 +56,11 @@ export default {
},
name: 'sunui-upimg',
props: {
//
showBlankPlaceholder: {
type: Boolean,
default: false
},
upload_video_max: {
type: Number,
default: 30 // (M)
@@ -94,6 +107,21 @@ export default {
default: true
}
},
watch: {
dataList: {
handler(val) {
this.upload_before_list = val
this.upload_cache_list = []
if (val.length > 0) {
val.map(item => {
item && this.upload_cache_list.push(item.path)
})
}
this.emit()
},
immediate: true
}
},
onReady(res) {
this.$nextTick(() => {
for (let i = 0; i < 10; i++) {
@@ -101,40 +129,6 @@ export default {
}
});
},
created() {
},
mounted() {
},
watch: {
// url(val) {
// this.upload_before_list.map((item) => {
// this.upload_cache_list.push(item.path);
// });
// this.emit();
// }
dataList:{
handler(val){
console.log('dataList change'+JSON.stringify(val));
this.upload_before_list = val;
if(this.upload_before_list.length>0){
this.upload_cache_list = [];
this.upload_before_list.map((item) => {
//
if(item.path.substring(0,4) == 'http' && item.path.substring(0,11) != 'http://tmp/')
{
this.upload_cache_list.push(item.path);
}
});
}else{
this.upload_cache_list = [];
}
this.emit();
},
immediate: true
}
},
methods: {
videoPlay(e) {
let index = e.currentTarget.dataset.index;
@@ -161,9 +155,9 @@ export default {
});
});
/* uni.showLoading({
uni.showLoading({
title: `正在上传...`,
}); */
})
Promise.all(promises).then((data) => {
// uni.hideLoading();
@@ -171,9 +165,10 @@ export default {
this.upload_cache_list.push(...data);
console.log("after uploaded upload_cache_list:"+JSON.stringify(this.upload_cache_list))
this.emit();
uni.hideLoading()
}).catch((res) => {
console.log(res);
// uni.hideLoading();
uni.hideLoading()
});
},
choose() {
@@ -378,7 +373,7 @@ export default {
}
.icon-mn_shangchuantupian {
font-size: 3em;
font-size: 48px;
}
.sunui-uploader-img {
@@ -397,7 +392,7 @@ export default {
.sunui-uploader-inputbox {
position: relative;
margin-bottom: 16rpx;
margin: 0 16rpx 16rpx 0;
box-sizing: border-box;
background-color: #ededed;
display: flex;
@@ -446,7 +441,6 @@ export default {
color: #fff;
z-index: 9;
}
.sunui-uploader-bd {
padding: 0;
margin: 0;
+3 -1
View File
@@ -15,8 +15,10 @@ import {
WX_LIVE_APPID
} from "@/config";
import uView from "uview-ui";
import GooSkeleton from '@/components/GooSkeleton/index.vue'
Vue.use(uView);
Vue.use(uView)
Vue.component('GooSkeleton', GooSkeleton)
Vue.mixin(mixin)
// 注册全局组件
+11 -95
View File
@@ -58,7 +58,7 @@
{
"path": "pages/shop/GoodSearch/index",
"style": {
"navigationBarTitleText": "搜索商品"
"navigationBarTitleText": "搜索"
}
},
{
@@ -78,7 +78,7 @@
{
"path": "pages/shop/GoodsList/index",
"style": {
"navigationBarTitleText": "商品列表"
"navigationBarTitleText": "搜索"
}
},
{
@@ -287,96 +287,6 @@
"navigationBarTitleText": "退货列表"
}
},
{
"path": "pages/orderAdmin/OrderIndex/index",
"style": {
"navigationBarTitleText": "商家订单统计"
}
},
{
"path": "pages/orderAdmin/AdminOrderList/index",
"style": {
"navigationBarTitleText": "订单"
}
},
{
"path": "pages/orderAdmin/GoodsDeliver/index",
"style": {
"navigationBarTitleText": "发货"
}
},
{
"path": "pages/orderAdmin/AdminOrder/index",
"style": {
"navigationBarTitleText": "商家订单列表"
}
},
{
"path": "pages/orderAdmin/Statistics/index",
"style": {
"navigationBarTitleText": "商家统计数据"
}
},
{
"path": "pages/orderAdmin/OrderCancellation/index",
"style": {
"navigationBarTitleText": "商家取消订单"
}
},
{
"path": "pages/activity/Poster/index",
"style": {
"navigationBarTitleText": "推广海报"
}
},
{
"path": "pages/activity/DargainDetails/index",
"style": {
"navigationBarTitleText": "帮砍价"
}
},
{
"path": "pages/activity/GoodsBargain/index",
"style": {
"navigationBarTitleText": "砍价列表"
}
},
{
"path": "pages/activity/BargainRecord/index",
"style": {
"navigationBarTitleText": "砍价记录"
}
},
{
"path": "pages/activity/GoodsGroup/index",
"style": {
"navigationBarTitleText": "团购商品列表"
}
},
{
"path": "pages/activity/GroupDetails/index",
"style": {
"navigationBarTitleText": "团购商品详情"
}
},
{
"path": "pages/activity/GroupRule/index",
"style": {
"navigationBarTitleText": "团购规则"
}
},
{
"path": "pages/activity/GoodsSeckill/index",
"style": {
"navigationBarTitleText": "秒杀"
}
},
{
"path": "pages/activity/SeckillDetails/index",
"style": {
"navigationBarTitleText": "秒杀详情"
}
},
{
"path": "pages/map/index",
"style": {
@@ -448,6 +358,12 @@
"style": {
"navigationBarTitleText": "我的喜欢"
}
},
{
"path": "pages/user/Points/index",
"style": {
"navigationBarTitleText": "积分"
}
}
],
"subPackages": [
@@ -917,7 +833,7 @@
{
"name": "商品详情",
"path": "pages/shop/GoodsCon/index",
"query": "id=277"
"query": "id=588"
},
{
"name": "店铺详情",
@@ -955,8 +871,8 @@
"query": ""
},
{
"name": "特色礼品",
"path": "pkg_product/views/giftList",
"name": "搜索",
"path": "pages/shop/GoodsList/index",
"query": ""
}
]
-131
View File
@@ -1,131 +0,0 @@
<template>
<view class="bargain-record" ref="container">
<view class="item" v-for="(item, bargainrecordIndex) in bargain" :key="bargainrecordIndex">
<view class="picTxt acea-row row-between-wrapper">
<view class="pictrue">
<image :src="item.image" />
</view>
<view class="text acea-row row-column-around">
<view class="line1">{{ item.title }}</view>
<count-down
:isDay="true"
:tipText="'倒计时 '"
:dayText="' 天 '"
:hourText="' 时 '"
:minuteText="' 分 '"
:secondText="' 秒'"
:datatime="item.datatime"
></count-down>
<view class="money font-color-red">
已砍至
<text class="symbol"></text>
<text class="num">{{ item.residuePrice }}</text>
</view>
</view>
</view>
<view class="bottom acea-row row-between-wrapper">
<view class="purple" v-if="item.status === 1">活动进行中</view>
<view class="success" v-else-if="item.status === 3">砍价成功</view>
<view class="end" v-else>活动已结束</view>
<view class="acea-row row-middle row-right">
<view
class="bnt cancel"
v-if="item.status === 1"
@click="getBargainUserCancel(item.bargainId)"
>取消活动</view>
<view
class="bnt bg-color-red"
v-if="item.status === 1"
@click="goDetail(item.bargainId)"
>继续砍价</view>
<view class="bnt bg-color-red" v-else @click="goList">重开一个</view>
</view>
</view>
</view>
<Loading :loaded="status" :loading="loadingList"></Loading>
</view>
</template>
<script>
import CountDown from "@/components/CountDown";
import { getBargainUserList, getBargainUserCancel } from "@/api/activity";
import Loading from "@/components/Loading";
export default {
name: "BargainRecord",
components: {
CountDown,
Loading
},
props: {},
data: function() {
return {
bargain: [],
status: false, //砍价列表是否获取完成 false 未完成 true 完成
loadingList: false, //当前接口是否请求完成 false 完成 true 未完成
page: 1, //页码
limit: 20 //数量
};
},
mounted: function() {
this.getBargainUserList();
},
onReachBottom() {
!this.loadingList && this.getBargainUserList();
},
methods: {
goDetail: function(id) {
this.$yrouter.push({
path: "/pages/activity/DargainDetails/index",
query: { id, partake: 0 }
});
},
goList: function() {
this.$yrouter.push({
path: "/pages/activity/GoodsBargain/index"
});
},
getBargainUserList: function() {
var that = this;
if (that.loadingList) return;
if (that.status) return;
getBargainUserList({ page: that.page, limit: that.limit })
.then(res => {
that.status = res.data.length < that.limit;
that.bargain.push.apply(that.bargain, res.data);
that.page++;
that.loadingList = false;
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
getBargainUserCancel: function(bargainId) {
var that = this;
getBargainUserCancel({ bargainId: bargainId })
.then(res => {
uni.showToast({
title: res.msg,
icon: "success",
duration: 2000
});
that.status = false;
that.loadingList = false;
that.page = 1;
that.bargain = [];
that.getBargainUserList();
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
}
}
};
</script>
-617
View File
@@ -1,617 +0,0 @@
<template>
<view class="bargain">
<!-- 在header上加 on 为请求支援 -->
<view :class="[bargainPartake != userInfo.uid ? 'header on' : 'header']">
<view class="people">{{ lookCount }}人查看 {{ shareCount }}人分享 {{ userCount }}人参与</view>
<!-- 帮助砍价帮砍成功-->
<view class="pictxt acea-row row-center-wrapper" v-if="bargainPartake != userInfo.uid">
<view class="pictrue">
<image :src="bargainUserInfo.avatar" />
</view>
<view class="text">
{{ bargainUserInfo.nickname }}
<text>邀请您帮忙砍价</text>
</view>
</view>
<count-down
:isDay="true"
:tipText="'倒计时 '"
:dayText="' 天 '"
:hourText="' 时 '"
:minuteText="' 分 '"
:secondText="' 秒'"
:datatime="datatime"
></count-down>
</view>
<view class="wrapper">
<view class="pictxt acea-row row-between-wrapper" @click="openAlone">
<view class="pictrue">
<image :src="bargain.image" />
<view class="bargain_view">
查看商品
<view class="iconfont icon-jiantou iconfonts"></view>
</view>
</view>
<view class="text acea-row row-column-around">
<view class="line2" v-text="bargain.title"></view>
<view class="money font-color-red">
已砍至:
<text class="num" v-text="price"></text>
</view>
<view class="acea-row row-middle">
<view class="successNum" v-text="'原价' + bargain.price"></view>
<view class="successNum" v-text="'已有' + bargainSumCount + '人砍价成功'"></view>
</view>
</view>
</view>
<view class="cu-progress acea-row row-middle round margin-top">
<view
class="acea-row row-middle bg-red"
:style="{ width: loading ? pricePercent + '%' : '' }"
></view>
</view>
<view class="balance acea-row row-between-wrapper">
<view v-text="'已砍' + alreadyPrice + '元'"></view>
<view v-if="surplusPrice === 0">砍价成功</view>
<view v-else v-text="'还剩' + surplusPrice + '元'"></view>
</view>
<!-- 帮助砍价帮砍成功-->
<view
class="bargainSuccess"
v-if="bargainPartake != userInfo.uid && !statusUser && !helpListLoading"
>
<span class="iconfont icon-xiaolian"></span>已成功帮助好友砍价
</view>
<!-- 砍价成功-->
<view
class="bargainSuccess"
v-if="
surplusPrice === 0 &&
bargainPartake === userInfo.uid &&
userBargainStatus === 1 &&
!helpListLoading
"
>
<span class="iconfont icon-xiaolian"></span>恭喜您砍价成功,快去支付吧~
</view>
<view
v-if="userBargainStatus == 0 && bargainPartake === userInfo.uid"
class="bargainBnt"
@click="goParticipate"
>立即参与砍价</view>
<view
class="bargainBnt"
@click="goPoster"
v-if="
surplusPrice > 0 &&
bargainPartake === userInfo.uid &&
userBargainStatus === 1 &&
!helpListLoading
"
>邀请好友帮砍价</view>
<view
class="bargainBnt"
@click="getBargainHelp"
v-else-if="
bargainPartake != userInfo.uid &&
userBargainStatus == 1 &&
statusUser &&
!helpListLoading
"
>帮好友砍一刀</view>
<view
class="bargainBnt"
@click="getBargainStart"
v-if="bargainPartake != userInfo.uid && !statusUser && !helpListLoading"
>我也要参与</view>
<view
class="bargainBnt"
@click="goPay"
v-if="
surplusPrice === 0 &&
bargainPartake === userInfo.uid &&
userBargainStatus === 1
"
>立即支付</view>
<view class="bargainBnt on" @click="goList">抢更多商品</view>
<view class="tip">
已有
<span class="font-color-red" v-text="helpCount"></span>
位好友成功帮您砍价
</view>
<view class="lock"></view>
</view>
<view class="bargainGang">
<view class="title font-color-red acea-row row-center-wrapper">
<view class="pictrue">
<image :src="webUrl+'/20230304134450627525.png'" />
</view>
<view class="titleCon">砍价帮</view>
<view class="pictrue on">
<image :src="webUrl+'/20230304134450627525.png'" />
</view>
</view>
<view class="list">
<view
class="item acea-row row-between-wrapper"
v-for="(item, bargainHelpListIndex) in bargainHelpList"
:key="bargainHelpListIndex"
>
<view class="pictxt acea-row row-between-wrapper">
<view class="pictrue">
<image :src="item.avatar" />
</view>
<view class="text">
<view class="name line1" v-text="item.nickname"></view>
<view class="line1" v-text="item.add_time"></view>
</view>
</view>
<view class="money font-color-red">
<text class="iconfont icon-kanjia"></text>
砍掉{{ item.price }}元
</view>
</view>
</view>
<view
class="load font-color-red"
v-if="!helpListStatus && !helpListLoading"
@click="getBargainHelpList"
>点击加载更多</view>
<view class="lock"></view>
</view>
<view class="goodsDetails">
<view class="title font-color-red acea-row row-center-wrapper">
<view class="pictrue">
<image :src="webUrl+'/20230304134450627525.png'" />
</view>
<view class="titleCon">商品详情</view>
<view class="pictrue on">
<image :src="webUrl+'/20230304134450627525.png'" />
</view>
</view>
<view class="conter" v-html="bargain.description"></view>
<view class="lock"></view>
</view>
<view class="goodsDetails">
<view class="title font-color-red acea-row row-center-wrapper">
<view class="pictrue">
<image :src="webUrl+'/20230304134450627525.png'" />
</view>
<view class="titleCon">活动规则</view>
<view class="pictrue on">
<image :src="webUrl+'/20230304134450627525.png'" />
</view>
</view>
<view class="conter" v-html="bargain.rule"></view>
</view>
<view class="bargainTip" :class="active === true ? 'on' : ''">
<!-- <view class="pictrue">
<image src="@/static/images/bargainBg.jpg" />
<view class="iconfont icon-guanbi" @click="close"></view>
</view>-->
<view class="cutOff" v-if="bargainPartake === userInfo.uid">
您已砍掉
<text class="font-color-red" v-text="bargainHelpPrice"></text>元,听说分享次数越多砍价成功的机会越大哦!
</view>
<view class="cutOff on" v-else>
<view class="help font-color-red" v-text="'成功帮砍' + bargainHelpPrice + '元'"></view>,您也可以砍价低价拿哦,快去挑选心仪的商品吧~
</view>
<view class="tipBnt" @click="goPoster" v-if="bargainPartake === userInfo.uid">邀请好友帮砍价</view>
<view class="tipBnt" @click="getBargainStart" v-else>我也要参与</view>
</view>
<view class="mask" @touchmove.prevent :hidden="active === false" @click="close"></view>
</view>
</template>
<script>
import CountDown from "@/components/CountDown";
import {
getBargainDetail,
getBargainShare,
getBargainStart,
getBargainHelp,
getBargainHelpPrice,
getBargainHelpList,
getBargainHelpCount,
getBargainStartUser
} from "@/api/activity";
import { postCartAdd } from "@/api/store";
import { mapGetters } from "vuex";
import {} from "@/libs/wechat";
import { isWeixin, parseQuery, handleQrCode } from "@/utils/index";
const NAME = "DargainDetails";
export default {
name: "DargainDetails",
components: {
CountDown
},
props: {},
data: function() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
price: 0,
bargainId: 0, //砍价编号
bargainPartake: 0, //参与砍价
bargain: [], //砍价产品信息
partake: null,
bargainSumCount: 0, //砍价成功人数
activeMsg: "",
active: false,
loading: false,
datatime: 0,
lookCount: 0, //查看人数
shareCount: 0, //分享人数
userCount: 0, //参与人数
bargainHelpPrice: 0, //砍掉金额
bargainHelpList: [],
helpListStatus: false, //砍价列表是否获取完成 false 未完成 true 完成
helpListLoading: false, //当前接口是否请求完成 false 完成 true 未完成
page: 1, //页码
limit: 2, //数量
helpCount: 0, //砍价帮总人数
surplusPrice: 0, //剩余金额
alreadyPrice: 0, //已砍掉价格
pricePercent: 0, //砍价进度条
bargainUserInfo: [], //砍价 开启砍价用户信息
userBargainStatus: 2, //砍价状态
statusUser: false ,// 是否帮别人砍,没砍是true,砍了false
share:{
title:'',
path: `/pages/activity/DargainDetails/index/?id=${this.$yroute.query.id}&partake=${this.userInfo.uid}`,
imageUrl:'',
desc:'',
content:''
}
};
},
computed: mapGetters(["userInfo", "isLogin"]),
// watch: {
// $yroute: function(n) {
// var that = this;
// if (n.name === NAME) {
// that.mountedStart();
// }
// }
// },
mounted: function() {
var that = this;
that.mountedStart();
setTimeout(function() {
that.loading = true;
}, 500);
},
methods: {
//参与砍价
goParticipate() {
if (this.bargainPartake === this.userInfo.uid) this.getBargainStart();
else this.getBargainStartUser();
this.getBargainHelpCount();
},
openAlone: function() {
this.$yrouter.push({ path: "/detail/" + this.bargain.productId });
},
mountedStart: function() {
var that = this;
let url = handleQrCode();
if (url) {
that.bargainId = url.bargainId;
that.partake = url.uid;
} else {
that.bargainId = that.$yroute.query.id;
that.partake = parseInt(that.$yroute.query.partake);
}
if (
this.partake === undefined ||
this.partake <= 0 ||
isNaN(this.partake)
) {
that.bargainPartake = that.userInfo.uid;
// that.$yrouter.push({
// path: "/pages/activity/DargainDetails/index",
// query: { id: that.bargainId, partake: that.bargainPartake }
// });
} else {
that.bargainPartake = parseInt(this.partake);
}
that.getBargainHelpCountStart();
that.getBargainDetail();
that.getBargainShare(0);
// if (that.bargainPartake !== that.userInfo.uid) that.getBargainStartUser();
if (that.bargainPartake === that.userInfo.uid) {
// that.getBargainStart();
} else {
that.getBargainStartUser();
}
},
goPay: function() {
var data = {};
var that = this;
data.productId = that.bargain.productId;
data.cartNum = that.bargain.num;
data.uniqueId = "";
data.bargainId = that.bargainId;
data.new = 1;
postCartAdd(data)
.then(res => {
that.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: { id: res.data.cartId }
});
})
.catch(err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
},
goPoster: function() {
var that = this;
that.getBargainShare(that.bargainId);
this.$yrouter.push({
path: "/pages/activity/Poster/index",
query: { id: that.bargainId, type: 2 }
});
},
goList: function() {
this.$yrouter.push({
path: "/pages/activity/GoodsBargain/index"
});
},
//砍价分享
//bargainId 0 获取 查看人数 分享人数 参与人数
//bargainId 砍价产品编号 添加分享次数 获取 查看人数 分享人数 参与人数
getBargainShare: function(bargainId) {
var that = this;
getBargainShare({ bargainId: bargainId }).then(res => {
that.lookCount = res.data.lookCount;
that.shareCount = res.data.shareCount;
that.userCount = res.data.userCount;
});
},
// 获取产品详情
getBargainDetail: function() {
var that = this;
getBargainDetail(that.bargainId)
.then(res => {
res.data.bargain = res.data.bargain.replace(
/\<img/gi,
'<img style="max-width:100%;height:auto;"'
);
that.bargain = res.data.bargain;
that.datatime = that.bargain.stopTime / 1000;
that.getBargainHelpCount();
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
//开启砍价
getBargainStart: function() {
var that = this;
getBargainStart({ bargainId: that.bargainId })
.then(() => {
that.bargainPartake = that.userInfo.uid;
that.getBargainHelp();
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
//参与砍价
getBargainHelp: function() {
var that = this;
if (
that.surplusPrice === 0 &&
that.bargainPartake !== that.userInfo.uid
) {
return uni.showToast({
title: "好友已经砍价成功",
icon: "success",
duration: 2000
});
}
var data = {
bargainId: that.bargainId,
bargainUserUid: that.bargainPartake
};
getBargainHelp(data)
.then(res => {
that.activeMsg = res.data.status;
if (
res.data.status === "SUCCESSFUL" &&
that.bargainPartake !== that.userInfo.uid
) {
uni.showToast({
title: "您已经砍过了",
icon: "none",
duration: 2000
});
return;
}
that.helpListStatus = false;
that.page = 1;
that.bargainHelpList = [];
that.getBargainHelpPrice();
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
//获取砍掉的金额
getBargainHelpPrice: function() {
var that = this;
getBargainHelpPrice({
bargainId: that.bargainId,
bargainUserUid: that.bargainPartake
})
.then(res => {
that.bargainHelpPrice = res.data.price;
that.getBargainHelpCount();
that.getBargainHelpList();
switch (that.activeMsg) {
case "SUCCESSFUL":
break;
case "SUCCESS":
that.active = true;
break;
}
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
//砍价帮
getBargainHelpList: function() {
var that = this;
if (that.helpListLoading === true) return;
if (that.helpListStatus === true) return;
that.helpListLoading = true;
getBargainHelpList({
bargainId: that.bargainId,
bargainUserUid: that.bargainPartake,
page: that.page,
limit: that.limit
})
.then(res => {
that.helpListStatus = res.data.length < that.limit;
that.helpListLoading = false;
that.page++;
that.bargainHelpList.push.apply(that.bargainHelpList, res.data);
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
getBargainHelpCountStart: function() {
var that = this;
getBargainHelpCount({
bargainId: that.bargainId,
bargainUserUid: that.bargainPartake
})
.then(() => {})
.catch(() => {
this.$yrouter.push({
path: "/pages/activity/DargainDetails/index",
query: { id: that.bargainId, partake: that.userInfo.uid }
});
// that.$router.push({
// path:
// "/activity/dargain_detail/" +
// that.bargainId +
// "/" +
// that.userInfo.uid
// });
});
},
getBargainHelpCount: function() {
var that = this;
getBargainHelpCount({
bargainId: that.bargainId,
bargainUserUid: that.bargainPartake
})
.then(res => {
that.userBargainStatus = res.data.status;
that.helpCount = res.data.count;
that.surplusPrice = res.data.price;
that.alreadyPrice = res.data.alreadyPrice;
that.pricePercent = res.data.pricePercent;
that.price = (that.bargain.price - that.alreadyPrice).toFixed(2);
console.log(that);
})
.catch(() => {
that.bargainPartake = that.userInfo.uid;
// that.$yrouter.push({
// path: "/pages/activity/DargainDetails/index",
// query: { id: that.bargainId, partake: that.userInfo.uid }
// });
});
},
getBargainStartUser: function() {
var that = this;
getBargainStartUser({
bargainId: that.bargainId,
bargainUserUid: that.bargainPartake
})
.then(res => {
that.bargainUserInfo = res.data;
that.getBargainHelpList();
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
close: function() {
this.active = false;
}
}
// ,
// onShareAppMessage() {
// return {
// path: `/pages/activity/DargainDetails/index/?id=${this.$yroute.query.id}&partake=${this.userInfo.uid}`
// };
// }
};
</script>
<style lang="less">
page {
background-color: #eb3729;
}
.bargainBnt_hui {
font-size: 0.3 * 100rpx;
font-weight: bold;
color: #fff;
width: 6 * 100rpx;
height: 0.8 * 100rpx;
border-radius: 0.4 * 100rpx;
background: #bbb;
text-align: center;
line-height: 0.8 * 100rpx;
margin-top: 0.32 * 100rpx;
}
.bargain_view {
left: 0;
right: 0;
height: 0.48 * 100rpx;
background: rgba(0, 0, 0, 0.5);
opacity: 1;
border-radius: 0 0 0.06 * 100rpx 0.06 * 100rpx;
position: absolute;
bottom: 0;
font-size: 0.22 * 100rpx;
color: #fff;
text-align: center;
line-height: 0.48 * 100rpx;
}
.iconfonts {
font-size: 0.22 * 100rpx;
}
</style>
-84
View File
@@ -1,84 +0,0 @@
<template>
<view class="bargain-list">
<!-- <view class="header">
<image src="@/static/images/cut-bg.png" alt="">
</view>-->
<view class="list" v-if="bargainLis.length > 0">
<view class="item acea-row row-between-wrapper" v-for="(item, bargainLisIndex) in bargainLis"
:key="bargainLisIndex">
<view class="pictrue">
<image :src="item.image" />
</view>
<view class="text acea-row row-column-around">
<view class="line1" v-text="item.title"></view>
<view class="num">
<text class="iconfont icon-pintuan"></text>
{{ item.people }}人正在参与
</view>
<view class="money font-color-red">
可砍至:
<text class="price">{{item.minPrice}}</text>
</view>
</view>
<view class="cutBnt bg-color-red" @click="goDetail(item.id)">
<text class="iconfont icon-kanjia"></text>参与砍价
</view>
</view>
<view class="load font-color-red" v-if="!status" @click="getBargainList">点击加载更多</view>
</view>
</view>
</template>
<script>
import {
getBargainList
} from "@/api/activity";
export default {
name: "GoodsBargain",
components: {},
props: {},
data: function() {
return {
bargainLis: [], //砍价列表
status: false, //砍价列表是否获取完成 false 未完成 true 完成
loading: false, //当前接口是否请求完成 false 完成 true 未完成
page: 1, //页码
limit: 20 //数量
};
},
mounted: function() {
this.getBargainList();
},
methods: {
getBargainList: function() {
var that = this;
if (that.loading) return;
if (that.status) return;
that.loading = true;
getBargainList({
page: that.page,
limit: that.limit
}).then(res => {
that.status = res.data.length < that.limit;
that.bargainLis.push.apply(that.bargainLis, res.data);
that.page++;
that.loading = false;
});
},
goDetail: function(id) {
this.$yrouter.push({
path: "/pages/activity/DargainDetails/index",
query: {
id,
partake: 0
}
});
}
}
};
</script>
<style>
page {
background-color: rgb(245, 245, 245);
}
</style>
-91
View File
@@ -1,91 +0,0 @@
<template>
<view class="group-list" ref="container">
<view class="list" v-if="combinationList.length>0">
<view
class="item acea-row row-between-wrapper"
v-for="(item, combinationListIndex) in combinationList"
:key="combinationListIndex"
@click="link(item.id)"
>
<view class="pictrue">
<image :src="item.image" />
</view>
<view class="text">
<view class="line1" v-text="item.title"></view>
<view class="acea-row">
<view class="team acea-row row-middle cart-color">
<view class="iconfont icon-pintuan"></view>
<view class="num" v-text="item.people + '人团'"></view>
</view>
</view>
<view class="bottom acea-row row-between-wrapper">
<view class="money">
<text class="num" v-text="item.price"></text>
<text class="y-money" v-text="'¥' + item.productPrice"></text>
</view>
<view class="groupBnt bg-color-red">
去拼团
<text class="iconfont icon-jiantou"></text>
</view>
</view>
</view>
</view>
<Loading :loaded="status" :loading="loadingList"></Loading>
</view>
<view class="noCommodity" style="background-color: #fff;" v-if="combinationList.length === 0">
<view class="noPictrue">
<image :src="webUrl+'/20210203153900181449.png'" class="image" />
</view>
</view>
</view>
</template>
<script>
import { getCombinationList } from "@/api/activity";
import Loading from "@/components/Loading";
export default {
name: "GoodsGroup",
components: {
Loading
},
props: {},
data: function() {
return {
webUrl:this.$VUE_APP_RESOURCES_URL,
combinationList: [],
status: false, //砍价列表是否获取完成 false 未完成 true 完成
loading: false, //当前接口是否请求完成 false 完成 true 未完成
page: 1, //页码
limit: 20, //数量
loadingList: false
};
},
mounted: function() {
// document.querySelector('body').setAttribute('style', 'background-color:#eb3729');
this.getCombinationList();
},
onReachBottom() {
!this.loadingList && this.getCombinationList();
},
methods: {
getCombinationList: function() {
var that = this;
if (that.loading) return;
if (that.status) return;
getCombinationList({ page: that.page, limit: that.limit }).then(res => {
that.status = res.data.length < that.limit;
that.combinationList.push.apply(that.combinationList, res.data);
that.page++;
that.loading = false;
});
},
link: function(id) {
this.$yrouter.push({
path: "/pages/activity/GroupDetails/index",
query: { id }
});
}
}
};
</script>
-261
View File
@@ -1,261 +0,0 @@
<template>
<view class="flash-sale" ref="container">
<view class="header" v-if="headerImg">
<image :src="headerImg"/>
</view>
<scroll-view scroll-y="false" scroll-x="true">
<view class="timeScroll">
<view v-for="(item, index) in timeList" :key="index">
<view v-if="active==index" class="timeItem active" @click="setTime(index)">
<view class="time">{{ item.time }}</view>
<view class="state">{{ item.state }}</view>
</view>
<view v-if="active!=index" class="timeItem" @click="setTime(index)">
<view class="time">{{ item.time }}</view>
<view class="state">{{ item.state }}</view>
</view>
</view>
</view>
</scroll-view>
<view v-for="(item, index) in timeList" :key="index">
<view v-if="active == index">
<view class="countDown font-color-red acea-row row-center-wrapper">
<view v-if="item.status === 0" class="activity">活动已结束</view>
<count-down
:isDay="false"
:tipText="'距结束仅剩 '"
:dayText="false"
:hourText="' : '"
:minuteText="' : '"
:secondText="false"
:datatime="datatime"
v-if="item.status === 1"
></count-down>
<view v-if="item.status === 2" class="activity">活动即将开始</view>
</view>
<view class="list">
<view
class="item acea-row row-between-wrapper"
v-for="(itemSeckill, indexSeckill) in seckillList"
:key="indexSeckill"
>
<view class="pictrue">
<image :src="itemSeckill.image"/>
</view>
<view class="text acea-row row-column-around">
<view class="line1" v-text="itemSeckill.title"></view>
<view class="money">
限时价
<text class="num font-color-red" v-text="'¥' + itemSeckill.price"></text>
</view>
<view class="progress cart-color">
<view class="bg-red" :style="{ width: loading ? itemSeckill.percent + '%' : '' }"></view>
<view class="piece font-color-red" v-text="'仅剩' + itemSeckill.stock + '件'"></view>
</view>
</view>
<view
class="grab bg-color-red"
v-if="item.status === 1 && itemSeckill.stock > 0"
@click="goDetail(itemSeckill.id)"
>马上抢
</view>
<view class="grab" v-if="item.status === 1 && itemSeckill.stock <= 0">已售磬</view>
<view class="grab bg-color-red" v-if="item.status === 2">即将开始</view>
<view class="grab bg-color-red" v-if="item.status === 0">已结束</view>
</view>
</view>
<view
class="noCommodity"
style="background-color: #fff;"
v-if="seckillList.length === 0 && page > 1"
>
<view class="noPictrue">
<image :src="webUrl+'/20210203153900181449.png'" class="image"/>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {getSeckillConfig, getSeckillList} from "@/api/activity";
import CountDown from "@/components/CountDown";
export default {
name: "GoodsSeckill",
components: {
CountDown
},
props: {},
data: function () {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
headerImg: "",
timeList: [],
sticky: false,
loading: false,
datatime: 0,
active: 0,
seckillList: [],
status: false, //砍价列表是否获取完成 false 未完成 true 完成
loadingList: false, //当前接口是否请求完成 false 完成 true 未完成
page: 1, //页码
limit: 5, //数量
title: []
};
},
mounted: function () {
this.mountedStart();
},
onReachBottom() {
!this.loadingList && this.getSeckillList();
},
methods: {
changeTime: function (index) {
this.active = index;
this.getSeckillList();
},
mountedStart: function () {
var that = this;
uni.showLoading();
getSeckillConfig().then(res => {
that.$set(that, "headerImg", res.data.lovely);
that.$set(that, "timeList", res.data.seckillTime);
that.$set(that, "active", res.data.seckillTimeIndex);
let title = [];
title = res.data.seckillTime.map((item, index) => {
return {
name: "div",
attrs: {
class: "timeItem"
},
children: [
{
name: "div",
attrs: {
class: "time"
},
children: [
{
type: "text",
text: item.time
}
]
},
{
name: "div",
attrs: {
class: "state"
},
children: [
{
type: "text",
text: item.state
}
]
}
]
};
});
that.$set(that, "title", title);
that.datatime = that.timeList[that.active].stop;
that.getSeckillList();
that.$nextTick(function () {
that.sticky = true;
uni.hideLoading();
});
});
},
setTime: function (index) {
var that = this;
that.page = 1;
that.loadingList = false;
that.status = false;
that.active = index;
that.datatime = that.timeList[that.active].stop;
this.seckillList = [];
that.getSeckillList();
},
getSeckillList: function () {
var that = this;
if (that.loadingList) return;
if (that.status) return;
var time = that.timeList[that.active].id;
getSeckillList(time, {
page: that.page,
limit: that.limit
}).then(res => {
that.status = res.data.length < that.limit;
that.seckillList.push.apply(that.seckillList, res.data);
that.page++;
uni.hideLoading();
});
},
goDetail: function (id) {
var that = this;
var time = that.timeList[that.active].stop;
this.$yrouter.push({
path: "/pages/activity/SeckillDetails/index",
query: {
id,
time
}
});
}
}
};
</script>
<style scoped lang="less">
.timeScroll {
display: flex;
align-items: center;
flex-direction: row;
}
.timeItem {
font-size: 0.22 * 100rpx;
color: #282828;
width: 150rpx;
text-align: center;
padding: 0.11 * 100rpx 0;
background-color: none;
&.active {
.time {
color: #eb3729;
}
.state {
background-color: #eb3729;
color: #fff;
opacity: 1;
border-radius: 30rpx;
padding: 0 0.2 * 100rpx;
font-weight: 800;
height: 0.37 * 100rpx;
line-height: 0.37 * 100rpx;
}
}
}
.timeItem .time {
font-size: 0.32 * 100rpx;
font-weight: bold;
height: 0.37 * 100rpx;
line-height: 0.37 * 100rpx;
}
.timeItem .state {
height: 0.37 * 100rpx;
line-height: 0.37 * 100rpx;
}
.activity {
color: #333;
}
.flash-sale .list .item .grab {
background-color: #999;
}
</style>
-375
View File
@@ -1,375 +0,0 @@
<template>
<view :class="[posterImageStatus ? 'noscroll product-con' : 'product-con']" v-show="domStatus">
<product-con-swiper :imgUrls="imgUrls"></product-con-swiper>
<view class="wrapper">
<view class="share acea-row row-between row-bottom">
<view class="money font-color-red">
<text class="num" v-text="storeInfo.price"></text>
<text class="y-money" v-text="'¥' + storeInfo.productPrice"></text>
</view>
</view>
<view class="introduce" v-text="storeInfo.title"></view>
<view class="label acea-row row-between-wrapper">
<view v-text="'类型:' + storeInfo.people + '人团'"></view>
<view v-text="'库存:' + storeInfo.stock + storeInfo.unitName"></view>
<view v-text="'已拼:' + storeInfo.sales + storeInfo.unitName"></view>
</view>
</view>
<view class="notice acea-row row-middle">
<view class="num font-color-red">
<text class="iconfont icon-laba"></text>
已拼{{ storeInfo.sales
}}{{ storeInfo.unitName }}
<text class="line">|</text>
</view>
<view class="swiper-no-swiping swiper">
<swiper class="swiper-wrapper" :options="swiperTip" :autoplay="true" :interval="3000">
<block v-for="(item, itemNewIndex) in itemNew" :key="itemNewIndex">
<swiper-item>
<view class="line1">{{ item }}</view>
</swiper-item>
</block>
</swiper>
</view>
</view>
<view class="assemble">
<view v-for="(item, groupListindex) in groupList" :key="groupListindex">
<view class="item acea-row row-between-wrapper" v-if="groupListindex < groupListCount">
<view class="pictxt acea-row row-between-wrapper">
<view class="pictrue">
<image :src="item.avatar" class="image" />
</view>
<view class="text line1" v-text="item.nickname"></view>
</view>
<view class="right acea-row row-middle">
<view>
<view class="lack">
<text>还差</text>
<text class="font-color-red" v-text="item.count"></text>
<text>人成团</text>
</view>
<count-down
:isDay="false"
:tipText="'剩余 '"
:dayText="false"
:hourText="':'"
:minuteText="':'"
:secondText="false"
:datatime="item.stopTime/1000"
></count-down>
</view>
<view class="spellBnt" @click="groupRule(item.id)">
去拼单
<text class="iconfont icon-jiantou"></text>
</view>
</view>
</view>
</view>
<view class="more" v-if="groupList.length > groupListCount" @click="setGroupListCount">
查看更多
<text class="iconfont icon-xiangxia"></text>
</view>
</view>
<view class="playWay">
<view class="title acea-row row-between-wrapper">
<view>拼团玩法</view>
</view>
<view class="way acea-row row-middle">
<view class="item">
<text class="num"></text>开团/参团
</view>
<view class="iconfont icon-arrow"></view>
<view class="item">
<text class="num"></text>邀请好友
</view>
<view class="iconfont icon-arrow"></view>
<view class="item">
<view>
<text class="num"></text>满员发货
</view>
</view>
</view>
</view>
<view class="userEvaluation">
<view class="title acea-row row-between-wrapper">
<view v-text="'用户评价(' + replyCount + ')'"></view>
<view class="praise" @click="goReply">
<text class="font-color-red" v-text="replyChance + '%'"></text>好评率
<text class="iconfont icon-jiantou"></text>
</view>
</view>
<UserEvaluation :reply="reply"></UserEvaluation>
</view>
<view class="product-intro">
<view class="title">产品介绍</view>
<view class="conter" v-html="storeInfo.description"></view>
<!-- <view class="conter" v-html=""></view> -->
</view>
<view style="height:100rpx;"></view>
<view class="footer-group acea-row row-between-wrapper">
<!-- <view class="customerSer acea-row row-center-wrapper row-column">
<view class="iconfont icon-kefu"></view>
<view>客服</view>
</view>-->
<view class="customerSer acea-row row-center-wrapper row-column" @click="setCollect">
<view class="iconfont" :class="userCollect ? 'icon-shoucang1' : 'icon-shoucang'"></view>
<text>收藏</text>
</view>
<view class="bnt bg-color-violet" @click="openAlone">单独购买</view>
<view class="bnt bg-color-red" @click="openTeam">立即开团</view>
</view>
<ProductWindow v-if="cartNum" v-on:changeFun="changeFun" :attr="attr" :cartNum="cartNum"></ProductWindow>
<StorePoster
v-on:setPosterImageStatus="setPosterImageStatus"
:posterImageStatus="posterImageStatus"
:posterData="posterData"
></StorePoster>
</view>
</template>
<script>
// import { swiper, swiperSlide } from "vue-awesome-swiper";
import ProductConSwiper from "@/components/ProductConSwiper";
import CountDown from "@/components/CountDown";
import UserEvaluation from "@/components/UserEvaluation";
import ProductWindow from "@/components/ProductWindow";
import StorePoster from "@/components/StorePoster";
import { getCombinationDetail } from "@/api/activity";
import { postCartAdd } from "@/api/store";
import { imageBase64 } from "@/api/public";
import {
getCoupon,
getCollectAdd,
getCollectDel,
getUserInfo
} from "@/api/user";
const NAME = "GroupDetails";
export default {
name: "GroupDetails",
components: {
ProductConSwiper,
CountDown,
UserEvaluation,
// swiper,
// swiperSlide,
ProductWindow,
StorePoster
},
props: {},
data: function() {
return {
domStatus: false,
posterData: {
image: "",
title: "",
price: "",
code: ""
},
posterImageStatus: false,
reply: [],
replyCount: 0,
replyChance: 0,
imgUrls: [],
storeInfo: {},
itemNew: {},
groupListCount: 2,
groupList: {},
swiperTip: {
direction: "vertical",
autoplay: {
disableOnInteraction: false,
delay: 2000
},
loop: true,
speed: 1000,
observer: true,
observeParents: true
},
attr: {
cartAttr: false,
productSelect: {
image: "",
store_name: "",
price: "",
stock: "",
unique: "",
cart_num: 1
}
},
cartNum: 1,
userCollect: false
};
},
watch: {
$yroute: function(n) {
var that = this;
if (n.name === NAME) {
that.mountedStart();
}
}
},
onShow: function() {
this.mountedStart();
},
methods: {
openAlone: function() {
this.$yrouter.push({
path: "/pages/shop/GoodsCon/index",
query: { id: this.storeInfo.productId }
});
// this.$yrouter.replace({ path: "/detail/" + this.storeInfo.productId });
},
//收藏商品
setCollect: function() {
let that = this,
id = that.storeInfo.id,
category = "product";
if (that.userCollect) {
getCollectDel(id, category).then(function() {
that.userCollect = !that.userCollect;
});
} else {
getCollectAdd(id, category).then(function() {
that.userCollect = !that.userCollect;
});
}
},
mountedStart: function() {
var that = this;
let id = that.$yroute.query.id;
getCombinationDetail(id).then(res => {
that.userCollect = res.data.userCollect;
res.data.storeInfo.description = res.data.storeInfo.description.replace(
/\<img/gi,
'<img style="max-width:100%;height:auto;"'
);
that.$set(that, "storeInfo", res.data.storeInfo);
that.$set(that, "imgUrls", res.data.storeInfo.sliderImageArr);
that.$set(that, "itemNew", res.data.pinkOkList);
that.$set(that, "groupList", res.data.pink);
that.$set(that, "reply", [res.data.reply]);
that.$set(that, "replyCount", res.data.replyCount);
that.$set(that, "replyChance", res.data.replyChance);
that.setProductSelect();
that.posterData.image = that.storeInfo.image;
if (that.storeInfo.title.length > 30) {
that.posterData.title = that.storeInfo.title.substring(0, 30) + "...";
} else {
that.posterData.title = that.storeInfo.title;
}
that.posterData.price = that.storeInfo.price;
that.posterData.code = that.storeInfo.code_base;
that.domStatus = true;
//that.getImageBase64();
});
},
getImageBase64: function() {
let that = this;
imageBase64(this.posterData.image, that.posterData.code).then(res => {
that.posterData.image = res.data.image;
that.posterData.code = res.data.code;
});
},
setPosterImageStatus: function() {
// var sTop = document.body || document.documentElement;
// sTop.scrollTop = 0;
this.posterImageStatus = !this.posterImageStatus;
},
groupRule: function(id) {
var that = this;
that.$yrouter.push({
path: "/pages/activity/GroupRule/index",
query: { id }
});
},
goReply: function() {
var that = this;
that.$yrouter.push({
path: "/pages/shop/EvaluateList/index",
query: { id: that.storeInfo.product_id }
});
},
setGroupListCount: function() {
this.groupListCount = this.groupListCount + 2;
},
//将父级向子集多次传送的函数合二为一;
changeFun: function(opt) {
if (typeof opt !== "object") opt = {};
let action = opt.action || "";
let value = opt.value === undefined ? "" : opt.value;
this[action] && this[action](value);
},
changeattr: function(res) {
var that = this;
that.attr.cartAttr = res;
},
ChangeCartNum: function(res) {
var that = this;
that.attr.productSelect.cart_num = 1;
that.cartNum = 1;
uni.showToast({
title: "每人每次限购1" + that.storeInfo.unitName,
icon: "none",
duration: 2000
});
},
setProductSelect: function() {
var that = this;
var attr = that.attr;
attr.productSelect.image = that.storeInfo.image;
attr.productSelect.store_name = that.storeInfo.title;
attr.productSelect.price = that.storeInfo.price;
attr.productSelect.stock = that.storeInfo.stock;
attr.cartAttr = false;
that.$set(that, "attr", attr);
},
openTeam: function() {
var that = this;
if (that.attr.cartAttr == false) {
that.attr.cartAttr = !this.attr.cartAttr;
} else {
var data = {};
data.productId = that.storeInfo.productId;
data.cartNum = that.attr.productSelect.cart_num;
data.uniqueId = that.attr.productSelect.unique;
data.combinationId = that.storeInfo.id;
data.new = 1;
postCartAdd(data)
.then(res => {
that.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: { id: res.data.cartId }
});
})
.catch(err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
}
}
}
};
</script>
<style scoped lang="less">
.product-con .wrapper {
padding-bottom: 0.26 * 100rpx;
}
.noscroll {
height: 100%;
overflow: hidden;
}
.product-con .footer-group .bnt {
// flex:1;
width: 43%;
}
.product-con .footer-group .bnt.bg-color-violet {
background-color: #fa8013;
}
</style>
-248
View File
@@ -1,248 +0,0 @@
<template>
<view class="group-con">
<view class="header acea-row row-between-wrapper">
<view class="pictrue">
<image :src="storeCombination.image" />
</view>
<view class="text">
<view class="line1" v-text="storeCombination.title"></view>
<view class="money">
<text></text>
<text class="num" v-text="storeCombination.price"></text>
<text class="team cart-color" v-text="storeCombination.people + '人拼'"></text>
</view>
</view>
<view v-if="pinkBool === -1" class="iconfont icon-pintuanshibai"></view>
<view v-else-if="pinkBool === 1" class="iconfont icon-pintuanchenggong font-color-red"></view>
</view>
<view class="wrapper">
<view class="title acea-row row-center-wrapper">
<view class="line"></view>
<view class="name acea-row row-center-wrapper">
<text>剩余</text>
<count-down
:isDay="false"
:tipText="false"
:dayText="false"
:hourText="' : '"
:minuteText="' : '"
:secondText="false"
:datatime="pinkT.stopTime/1000"
></count-down>
<text>结束</text>
</view>
<view class="line"></view>
</view>
<view class="tips-warp">
<text class="tips font-color-red" v-if="pinkBool === 1">恭喜您拼团成功</text>
<text class="tips" v-else-if="pinkBool === -1">还差{{ count }}拼团失败</text>
<text class="tips font-color-red" v-else-if="pinkBool === 0">拼团中还差{{ count }}人拼团成功</text>
</view>
<view
class="list acea-row row-middle"
:class="[pinkBool === 1 || pinkBool === -1 ? 'result' : '',iShidden ? 'on' : '']"
>
<view class="pictrue">
<image :src="pinkT.avatar" />
</view>
<view class="acea-row row-middle" v-if="pinkAll.length > 0">
<view class="pictrue" v-for="(item, pinkAllIndex) in pinkAll" :key="pinkAllIndex">
<image :src="item.avatar" />
</view>
</view>
<view class="pictrue" v-for="countIndex in count" :key="countIndex">
<image class="img-none" :src="webUrl+'/20230304204903336964.png'" />
</view>
</view>
<view
v-if="(pinkBool === 1 || pinkBool === -1) && count > 9"
class="lookAll acea-row row-center-wrapper"
@click="lookAll"
>
{{ iShidden ? "收起" : "查看全部" }}
<text class="iconfont" :class="iShidden ? 'icon-xiangshang' : 'icon-xiangxia'"></text>
</view>
<view
class="teamBnt bg-color-red"
v-if="userBool === 1 && isOk == 0 && pinkBool === 0"
@click="goPoster"
>邀请好友参团</view>
<view
class="teamBnt bg-color-red"
v-else-if="userBool === 0 && pinkBool === 0 && count > 0"
@click="pay"
>我要参团</view>
<view
class="teamBnt bg-color-red"
v-if="pinkBool === 1 || pinkBool === -1"
@click="goDetail(storeCombination.id)"
>再次开团</view>
<view class="cancel" @click="getCombinationRemove" v-if="pinkBool === 0 && userBool === 1">
<text class="iconfont icon-guanbi3"></text>
<text>取消开团</text>
</view>
<view class="lookOrder" v-if="pinkBool === 1" @click="goOrder">
<text>查看订单信息</text>
<text class="iconfont icon-xiangyou"></text>
</view>
</view>
</view>
</template>
<script>
import CountDown from "@/components/CountDown";
import { getCombinationPink, getCombinationRemove } from "@/api/activity";
import { postCartAdd } from "@/api/store";
import { isWeixin, parseQuery, handleQrCode } from "@/utils/index";
const NAME = "GroupRule";
export default {
name: NAME,
components: {
CountDown
},
props: {},
data: function() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
currentPinkOrder: "", //当前拼团订单
isOk: 0, //判断拼团是否完成
pinkBool: 0, //判断拼团是否成功|0=失败,1=成功
userBool: 0, //判断当前用户是否在团内|0=未在,1=在
pinkAll: [], //团员
pinkT: [], //团长信息
storeCombination: [], //拼团产品
pinkId: 0,
count: 0, //拼团剩余人数
iShidden: false
};
},
watch: {
$yroute(n) {
var that = this;
if (n.name === NAME) {
that.pinkId = that.$yroute.query.id;
that.getCombinationPink();
}
}
},
mounted: function() {
var that = this;
let url = handleQrCode();
if (url) {
that.pinkId = url.pinkId;
} else {
that.pinkId = that.$yroute.query.id;
}
that.getCombinationPink();
},
methods: {
pay: function() {
var that = this;
var data = {};
data.productId = that.storeCombination.productId;
data.cartNum = that.pinkT.totalNum;
data.uniqueId = "";
data.combinationId = that.storeCombination.id;
data.new = 1;
postCartAdd(data)
.then(res => {
that.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: {
id: res.data.cartId,
pinkid: that.pinkId
}
});
})
.catch(err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
},
goPoster: function() {
var that = this;
this.$yrouter.push({
path: "/pages/activity/Poster/index",
query: {
id: that.pinkId,
type: 1
}
});
},
goOrder: function() {
var that = this;
this.$yrouter.push({
path: "/pages/order/OrderDetails/index",
query: {
id: that.currentPinkOrder
}
});
},
//拼团列表
goList: function() {
this.$yrouter.push({
path: "/pages/activity/GoodsGroup/index"
});
},
//拼团详情
goDetail: function(id) {
this.$yrouter.push({
path: "/pages/activity/GroupDetails/index",
query: {
id
}
});
},
//拼团信息
getCombinationPink: function() {
var that = this;
getCombinationPink(that.pinkId).then(res => {
that.$set(that, "storeCombination", res.data.storeCombination);
that.$set(that, "pinkT", res.data.pinkT);
that.$set(that, "pinkAll", res.data.pinkAll);
that.$set(that, "count", res.data.count);
that.$set(that, "userBool", res.data.userBool);
that.$set(that, "pinkBool", res.data.pinkBool);
that.$set(that, "isOk", res.data.isOk);
that.$set(that, "currentPinkOrder", res.data.currentPinkOrder);
});
},
//拼团取消
getCombinationRemove: function() {
var that = this;
getCombinationRemove({
id: that.pinkId,
cid: that.storeCombination.id
})
.then(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
lookAll: function() {
this.iShidden = !this.iShidden;
}
}
};
</script>
<style lang="less">
.tips-warp {
text-align: center;
margin-top: 20rpx;
}
</style>
-79
View File
@@ -1,79 +0,0 @@
<template>
<view class="poster-poster" v-if="status === false">
<view class="tip">
<text class="iconfont icon-shuoming"></text>提示长按图片保存至手机相册
</view>
<view class="poster">
<image :src="image" mode="widthFix" show-menu-by-longpress />
</view>
</view>
</template>
<script>
import { getBargainPoster, getCombinationPoster } from "@/api/activity";
export default {
name: "Poster",
components: {},
props: {},
data: function() {
return {
status: true,
id: 0,
image: ""
};
},
mounted: function() {
var that = this;
var id = that.$yroute.query.id;
var type = that.$yroute.query.type;
that.id = id;
if (type == 2) {
that.getBargainPoster();
} else {
that.getCombinationPoster();
}
},
methods: {
getBargainPoster: function() {
var that = this;
getBargainPoster({ bargainId: that.id, from: "wechat" })
.then(res => {
that.image = res.data.url;
that.status = false;
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
// 拼团海报
getCombinationPoster: function() {
var that = this;
getCombinationPoster({ id: that.id, from: "wechat" })
.then(res => {
that.image = res.data.url;
that.status = false;
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
}
}
};
</script>
<style scoped lang="less">
page {
background-color: #eb3729;
}
.poster-poster {
height: unset !important;
}
</style>
-235
View File
@@ -1,235 +0,0 @@
<template>
<view :class="[posterImageStatus ? 'noscroll product-con' : 'product-con']" v-show="domStatus">
<product-con-swiper :imgUrls="imgUrls"></product-con-swiper>
<view class="nav acea-row row-between-wrapper">
<view class="money">
<text class="num" v-text="storeInfo.price"></text>
<text class="y-money" v-text="'¥' + storeInfo.price"></text>
</view>
<view class="acea-row row-middle">
<view class="times">
<view>距秒杀结束仅剩</view>
<count-down
:isDay="false"
:tipText="false"
:dayText="false"
:hourText="' : '"
:minuteText="' : '"
:secondText="false"
:datatime="datatime"
></count-down>
</view>
<view class="iconfont icon-jiantou"></view>
</view>
</view>
<view class="wrapperRush">
<view class="introduce acea-row row-between">
<view class="infor" v-text="storeInfo.title"></view>
<!-- <view class="iconfont icon-fenxiang" @click="setPosterImageStatus"></view> -->
</view>
<view class="label acea-row row-middle">
<view class="stock" v-text="'库存:' + storeInfo.stock + '件'"></view>
<view v-text="'销量:' + storeInfo.sales + '件'"></view>
</view>
</view>
<view class="product-intro">
<view class="title">产品介绍</view>
<view class="conter" v-html="storeInfo.description"></view>
</view>
<view style="height:100rpx;"></view>
<view class="footerRush acea-row row-between-wrapper">
<!-- <view
class="customerSer acea-row row-center-wrapper row-column"
@click="routerGo()"
>
<view class="iconfont icon-kefu"></view>
<view>客服</view>
</view> -->
<view class="bnt bg-color-red" @click="tapBuy">立即购买</view>
</view>
<ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cartNum"></ProductWindow>
<StorePoster
v-on:setPosterImageStatus="setPosterImageStatus"
:posterImageStatus="posterImageStatus"
:posterData="posterData"
></StorePoster>
</view>
</template>
<style scoped lang="less">
.noscroll {
height: 100%;
overflow: hidden;
}
</style>
<script>
import ProductConSwiper from "@/components/ProductConSwiper";
import CountDown from "@/components/CountDown";
import ProductWindow from "@/components/ProductWindow";
import StorePoster from "@/components/StorePoster";
import { getSeckillDetail } from "@/api/activity";
import { postCartAdd } from "@/api/store";
import { imageBase64 } from "@/api/public";
const NAME = "SeckillDetails";
export default {
name: "SeckillDetails",
components: {
ProductConSwiper,
CountDown,
ProductWindow,
StorePoster
},
props: {},
data: function() {
return {
domStatus: false,
posterData: {
image: "",
title: "",
price: "",
code: ""
},
posterImageStatus: false,
action: "",
imgUrls: [],
storeInfo: [],
replyCount: 0,
reply: [],
cartNum: 1,
attr: {
cartAttr: false,
productSelect: {
image: "",
store_name: "",
price: "",
stock: "",
unique: "",
cart_num: 1
}
},
datatime: 0
};
},
watch: {
$yroute: function(n) {
var that = this;
if (n.name === NAME) {
that.mountedStart();
}
}
},
mounted: function() {
this.mountedStart();
},
methods: {
routerGo(item) {
this.$yrouter.push({ path: '/pages/user/CustomerList/index' })
},
mountedStart: function() {
var that = this;
let id = that.$yroute.query.id;
that.datatime = parseInt(that.$yroute.query.time);
getSeckillDetail(id).then(res => {
res.data.storeInfo.description = res.data.storeInfo.description.replace(
/\<img/gi,
'<img style="max-width:100%;height:auto;"'
);
that.$set(that, "storeInfo", res.data.storeInfo);
that.$set(that, "imgUrls", res.data.storeInfo.sliderImageArr);
that.$set(that, "replyCount", res.data.replyCount);
that.$set(that, "reply", res.data.reply);
that.posterData.image = that.storeInfo.image_base;
that.updateTitle();
if (that.storeInfo.title.length > 30) {
that.posterData.title = that.storeInfo.title.substring(0, 30) + "...";
} else {
that.posterData.title = that.storeInfo.title;
}
that.posterData.price = that.storeInfo.price;
that.posterData.code = that.storeInfo.code_base;
that.setProductSelect();
that.domStatus = true;
});
},
updateTitle() {
// document.title = this.storeInfo.title || this.$yroute.meta.title;
},
setPosterImageStatus: function() {
// var sTop = document.body || document.documentElement;
// sTop.scrollTop = 0;
this.posterImageStatus = !this.posterImageStatus;
},
//将父级向子集多次传送的函数合二为一;
changeFun: function(opt) {
if (typeof opt !== "object") opt = {};
let action = opt.action || "";
let value = opt.value === undefined ? "" : opt.value;
this[action] && this[action](value);
},
changeattr: function(res) {
var that = this;
that.attr.cartAttr = res;
},
ChangeCartNum: function(res) {
var that = this;
if (res) {
if (that.attr.productSelect.cart_num < that.storeInfo.stock) {
that.attr.productSelect.cart_num++;
this.cartNum++;
}
} else {
if (that.attr.productSelect.cart_num > 1) {
that.attr.productSelect.cart_num--;
this.cartNum--;
}
}
},
setProductSelect: function() {
var that = this;
var attr = that.attr;
attr.productSelect.image = that.storeInfo.image;
attr.productSelect.store_name = that.storeInfo.title;
attr.productSelect.price = that.storeInfo.price;
attr.productSelect.stock = that.storeInfo.stock;
attr.cartAttr = false;
that.$set(that, "attr", attr);
},
selecAttrTap: function() {
this.cartAttr = true;
},
tapBuy: function() {
var that = this;
if (that.attr.cartAttr == false) {
that.attr.cartAttr = !this.attr.attrcartAttr;
} else {
var data = {};
data.productId = that.storeInfo.productId;
data.cartNum = that.attr.productSelect.cart_num;
data.uniqueId = that.attr.productSelect.unique;
data.secKillId = that.storeInfo.id;
data.new = 1;
postCartAdd(data)
.then(res => {
that.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: { id: res.data.cartId }
});
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none',
duration: 2000
});
});
}
}
}
};
</script>
<style scoped lang="less">
.product-con .nav {
padding: 0 0.2*100rpx;
}
</style>
+540 -119
View File
@@ -1,105 +1,255 @@
<template>
<view class="pages-cart" v-if="ready">
<u-navbar leftIcon="trash" title="购物车" fixed @leftClick="remove"/>
<view class="tc" style="margin-top: 300rpx" v-if="list.length===0">
<image style="width: 420rpx;height: 418rpx" :src="$VUE_APP_RESOURCES_URL+'/20240106211138206789.png'" mode="scaleToFill"/>
</view>
<view class="group-item" v-for="(item,index) in list" :key="index">
<view class="flex jc-between">
<view class="flex ai-center">
<CheckboxIcon style="margin-right: 24rpx;" :default-state="item['state']" :mark="[index]" @change="onChange"/>
<image class="store-cover" :src="item['merAvatar']"
mode="scaleToFill"/>
<view style="color:#333333;font-size: 30rpx">{{ item['merName'] }}</view>
<view
:style="{
'padding-top': (statusBarHeight + 54) + 'px'
}"
class="pages-cart"
>
<u-navbar
:left-icon="selectCount > 0 ? 'trash' : ''"
title="购物车"
fixed
@leftClick="remove"
/>
<view v-if="isLoad">
<view
v-if="list.length === 0"
class="tc"
style="margin-top: 300rpx"
>
<image
:src="$VUE_APP_RESOURCES_URL + '/20240106211138206789.png'"
style="width: 420rpx;height: 418rpx"
mode="scaleToFill"
/>
</view>
<view
v-for="(item, index) in list"
:key="index"
class="group-item"
>
<view class="flex jc-between">
<view class="flex ai-center">
<CheckboxIcon
:default-state="item['state']"
:mark="[index]"
style="margin-right: 24rpx;"
@change="onChange"
/>
<image
:src="item['merAvatar']"
class="store-cover"
mode="scaleToFill"
/>
<view style="color:#333333;font-size: 30rpx">{{ item['merName'] }}</view>
</view>
<view
class="flex ai-center"
style="color:#E92727;font-size: 24rpx"
@click="navToStore(item['hotelId'])"
>
进店逛逛
<image
:src="$VUE_APP_RESOURCES_URL + '/20240109234706982937.png'"
style="width: 24rpx;height: 24rpx"
mode="scaleToFill"
/>
</view>
</view>
<view class="flex ai-center" style="color:#E92727;font-size: 24rpx" @click="navToStore(item['hotelId'])">
进店逛逛
<image style="width: 24rpx;height: 24rpx" :src="$VUE_APP_RESOURCES_URL+'/20240109234706982937.png'" mode="scaleToFill"/>
<view class="good-box">
<view
v-for="(good, gIndex) in item['carts']"
:key="gIndex"
class="good flex ai-center"
>
<CheckboxIcon
:default-state="good['state']"
:mark="[index, gIndex]"
style="margin-right: 24rpx;"
@change="onChange"
/>
<image
v-if="good['productInfo']['attrInfo']['image']"
:src="good['productInfo']['attrInfo']['image']"
class="good-cover flex-0"
mode="scaleToFill"
@click="navToGood(good['productId'])"
/>
<image
v-else
:src="good['productInfo']['image']"
mode="scaleToFill"
class="good-cover flex-0"
@click="navToGood(good['productId'])"
/>
<view style="width: 100%">
<view
class="one-t"
@click="navToGood(good['productId'])"
>{{ good['productInfo']['storeName'] }}</view>
<view
class="sku ai-center"
@click="changeGoodAttrHandle(good)"
>
规格:{{ good['productInfo']['attrInfo']['sku'] }}
</view>
<view
class="flex jc-between ai-center"
style="width: 100%;margin-top: 26rpx;"
>
<view
style="color:#E92727;font-size: 32rpx;"
@click="navToGood(good['productId'])"
>
<text class="bold" style="font-size: 24rpx">¥</text>
{{ good['truePrice'] }}
</view>
<u-number-box
:value="good.cartNum"
:max="good['productInfo']['attrInfo']['stock']"
integer
disabledInput
iconStyle="color: #fff"
class="num-step"
@change="e => changeNumHandle(index, gIndex, good, e)"
>
<template v-slot:minus>
<view class="num-btn flex jc-center ai-center">
<u-icon name="minus" size="12" color="#FFFFFF"/>
</view>
</template>
<template v-slot:input>
<view class="num-input tc">{{ good['cartNum'] }}</view>
</template>
<template v-slot:plus>
<view class="num-btn flex jc-center ai-center">
<u-icon name="plus" size="12" color="#FFFFFF"/>
</view>
</template>
</u-number-box>
</view>
</view>
</view>
</view>
</view>
<view class="goods-box">
<view class="goods flex ai-center" v-for="(goods,gIndex) in item['carts']" :key="gIndex">
<CheckboxIcon style="margin-right: 24rpx;" :default-state="goods['state']" :mark="[index,gIndex]"
@change="onChange"/>
<image class="goods-cover flex-0" :src="goods['productInfo']['attrInfo']['image']" mode="scaleToFill"
@click="navToGoods(goods['productId'])"
v-if="goods['productInfo']['attrInfo']['image']"/>
<image class="goods-cover flex-0" :src="goods['productInfo']['image']" mode="scaleToFill"
@click="navToGoods(goods['productId'])" v-else/>
<view style="width: 100%">
<view class="one-t" @click="navToGoods(goods['productId'])">{{ goods['productInfo']['storeName'] }}</view>
<view class="sku ai-center" @click="navToGoods(goods['productId'])">
规格{{ goods['productInfo']['attrInfo']['sku'] }}
</view>
<view class="flex jc-between ai-center" style="width: 100%;margin-top: 26rpx;">
<view style="color:#E92727;font-size: 32rpx;" @click="navToGoods(goods['productId'])">
<text class="bold" style="font-size: 24rpx"></text>
{{ goods['truePrice'] }}
<view class="footer-fixed flex jc-between ai-center">
<view style="margin-left: 32rpx;">
<CheckboxIcon
style="margin-right: 24rpx;"
:default-state="isAll"
:mark="[-1]"
@change="onChange"
/>
<text style="color:#666666;font-size: 32rpx">全选({{ selectCount }})</text>
</view>
<view class="flex ai-center">
<view style="margin-right: 20rpx;color:#666666;font-size: 32rpx">合计:
<text class="bold" style="color:#E92727">¥{{ total }}</text>
</view>
<view class="btn-submit bold flex jc-center ai-center" @click="submit">结算</view>
</view>
</view>
<view
v-show="showAttr"
class="good-attr-wrap"
>
<view class="layer" @click="closeAttr" />
<view class="content">
<view class="close">
<text class="iconfont icon-guanbi" @click="closeAttr"></text>
</view>
<view class="good-info">
<view class="name-img">
<image :src="currGoodAttr.image" class="img" />
<view class="name">
<view class="more-t">
{{ currGood.productInfo.storeName }}
</view>
<view class="price">
<text class="txt">¥</text>{{ currGoodAttr.price }}
</view>
</view>
<u-number-box class="num-step" v-model="goods['cartNum']" :name="goods['id']"
:max="goods['productInfo']['attrInfo']['stock']" integer disabledInput
iconStyle="color: #fff" @change="changeNum">
<template v-slot:minus>
<view class="num-btn flex jc-center ai-center">
<u-icon name="minus" size="12" color="#FFFFFF"/>
</view>
</template>
<template v-slot:input>
<view class="num-input tc">{{ goods['cartNum'] }}</view>
</template>
<template v-slot:plus>
<view class="num-btn flex jc-center ai-center">
<u-icon name="plus" size="12" color="#FFFFFF"/>
</view>
</template>
</u-number-box>
</view>
</view>
<view class="attr-wrap">
<view
v-for="(item, index) in goodAttr.productAttr"
:key="index"
class="item"
>
<view class="title">{{ item.attrName }}</view>
<view class="acea-row row-middle">
<view
v-for="(attr, attrIndex) in item.attrValue"
:key="attr"
:class="{
'on': attr.check,
'disabled': getAttrItemData(attr.attr).stock === 0
}"
class="attr"
@click="attrItemClick(attr, attrIndex, index)"
>
{{ attr.attr }}
<text
v-if="getAttrItemData(attr.attr).stock === 0"
class="tag"
>缺货</text>
</view>
</view>
</view>
</view>
<view class="bottom">
<view
:class="currGoodAttr.stock === 0 ? 'disabled' : ''"
class="btn"
@click="changeAttrConfirm"
>
确认
</view>
</view>
</view>
</view>
</view>
<view class="footer-fixed flex jc-between ai-center">
<view style="margin-left: 32rpx;">
<CheckboxIcon style="margin-right: 24rpx;" :default-state="isAll" :mark="[-1]" @change="onChange"/>
<text style="color:#666666;font-size: 32rpx">全选({{ selectCount }})</text>
</view>
<view class="flex ai-center">
<view style="margin-right: 20rpx;color:#666666;font-size: 32rpx">合计:
<text class="bold" style="color:#E92727">{{ total }}</text>
</view>
<view class="btn-submit bold flex jc-center ai-center" @click="submit">结算</view>
</view>
</view>
<goo-skeleton
v-else
:show-avatar="false"
/>
</view>
</template>
<script>
import {changeCartNum, getCartGroup, postCartDel} from "@/api/store";
import CheckboxIcon from "@/components/CheckboxIcon.vue";
import {VUE_APP_RESOURCES_URL} from '../config/index'
import {
changeCartNum,
getCartGroup,
postCartDel,
getCartGoodAttr,
cartGoodChangeAttr
} from '@/api/store'
import CheckboxIcon from '@/components/CheckboxIcon.vue'
export default {
components: {CheckboxIcon},
components: {
CheckboxIcon
},
data() {
return {
ready: false,
webUrl: VUE_APP_RESOURCES_URL,
statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
isLoad: false,
list: [],
isAll: false
isAll: false,
currGood: {},
currGoodAttr: {},
goodAttr: {
productAttr: [],
productValueArr: []
},
showAttr: false
}
},
computed: {
total() {
let price = 0
this.list.forEach(item => {
item['carts'].forEach(goods => {
if (goods.state) price += Math.round(goods['cartNum'] * goods['truePrice'] * 100) / 100
item['carts'].forEach(good => {
if (good.state) price += Math.round(good['cartNum'] * good['truePrice'] * 100) / 100
})
})
return Math.round(price * 100) / 100
@@ -107,38 +257,43 @@ export default {
selectCount() {
let count = 0
this.list.forEach(item => {
item['carts'].forEach(goods => {
if (goods.state) count++
item['carts'].forEach(good => {
if (good.state) count += good.cartNum || 1
})
})
return count
}
},
created() {
this.getCart()
},
onShow() {
if (!this.isLoad) {
return
}
this.closeAttr()
this.getCart()
this.ready = true
},
methods: {
async getCart() {
const res = await getCartGroup()
if (res.success) {
this.isLoad = true
this.list = res.data['valid']
this.handleAll(false)
}
},
handleAll(state) {
this.isAll = state
this.list = this.list.map(item => {
item.state = state
item.carts = item.carts.map(goods => {
goods.state = state
return goods
item.carts = item.carts.map(good => {
good.state = state
return good
})
return item
})
},
navToStore(id) {
if (id === 0) {
uni.showToast({
@@ -148,65 +303,78 @@ export default {
})
return
}
uni.navigateTo({
url: '/pagesInn/inn/innHome?id=' + id
})
},
onChange(state, mark) {
if (mark.length === 1) {
if (mark[0] === -1) {
this.handleAll(state)
} else {
this.list[mark[0]]['state'] = state
this.list[mark[0]]['carts'] = this.list[mark[0]]['carts'].map(goods => {
goods.state = state
return goods
this.list[mark[0]]['carts'] = this.list[mark[0]]['carts'].map(good => {
good.state = state
return good
})
}
}
if (mark.length === 2) {
this.list[mark[0]]['carts'][mark[1]]['state'] = state
const length = this.list[mark[0]]['carts'].length
let count = 0
this.list[mark[0]]['carts'] = this.list[mark[0]]['carts'].map((goods, gIndex) => {
if (gIndex === mark[1]) goods['state'] = state
if (goods['state']) count++
return goods
this.list[mark[0]]['carts'] = this.list[mark[0]]['carts'].map((good, gIndex) => {
if (gIndex === mark[1]) good['state'] = state
if (good['state']) count++
return good
})
this.list[mark[0]]['state'] = count === length
}
let shopCheckNumber = 0
this.list.map(item => {
if (item.state) {
shopCheckNumber++
}
})
this.isAll = shopCheckNumber === this.list.length
},
changeNum(event) {
changeCartNum(event.name, event.value)
changeNumHandle(index, gIndex, good, e) {
const { type } = e
const value = good.cartNum + (type === 'plus' ? 1 : -1)
const id = good.id
uni.showLoading()
changeCartNum(id, value).then(res => {
const { success } = res
if (success) {
uni.hideLoading()
this.$set(this.list[index].carts[gIndex], 'cartNum', value)
}
}).catch(() => {
setTimeout(() => {
uni.hideLoading()
}, 3000)
})
},
handleIds() {
if (this.selectCount === 0) {
uni.showToast({
title: "请选择产品",
icon: "none",
title: '请选择产品',
icon: 'none',
duration: 2000
})
return []
}
let ids = []
const ids = []
this.list.forEach(item => {
item['carts'].forEach(goods => {
if (goods['state']) ids.push(goods['id'])
item['carts'].forEach(good => {
if (good['state']) ids.push(good['id'])
})
})
return ids
},
remove() {
const ids = this.handleIds()
if (ids.length === 0) return
uni.showModal({
title: '确认删除已选商品?',
content: '',
@@ -215,20 +383,151 @@ export default {
confirmText: '确认',
success: async (result) => {
if (result.confirm) {
const res = await postCartDel(ids)
if (res.success) await this.getCart()
uni.showLoading()
postCartDel(ids).then(res => {
const { success } = res
if (success) {
this.getCart()
}
}).finally(() => {
uni.hideLoading()
})
}
}
})
},
changeGoodAttrHandle(good) {
if (good.seckillId) {
return
}
const id = good.productInfo.id
const unique = good.productInfo.attrInfo.unique
uni.showLoading()
getCartGoodAttr(id, unique).then(res => {
const { success, data } = res
if (success) {
this.currGood = good
this.goodAttr.productAttr = data.productAttr
for (const key in data.productValue) {
this.goodAttr.productValueArr.push({
attrItemkey: key,
...data.productValue[key]
})
}
this.goodAttr.productAttr.map((item, index) => {
item.attrValue.map((attr, attrIndex) => {
attr.check = data.defaultSkuIndex[index] === attrIndex
})
})
this.currGoodAttr = data.productValue[data.defaultSku.sort().join(',')]
this.showAttr = true
}
}).finally(() => {
uni.hideLoading()
})
},
getAttrItemData(attr) {
let result = {
stock: 0
}
// 只有一组规格
if (this.goodAttr.productAttr.length === 1) {
this.goodAttr.productValueArr.map(item => {
if (item.attrItemkey === attr) {
result = item
}
})
} else {
result.stock = 1
}
return result
},
// 规格切换
attrItemClick(attr, attrIndex, index) {
const tempArr = JSON.parse(JSON.stringify(this.goodAttr))
tempArr.productAttr[index].attrValue.map(attrItem => {
attrItem.check = false
})
// 预设目标规格选中
tempArr.productAttr[index].attrValue[attrIndex].check = true
const arr = []
tempArr.productAttr.map((item) => {
item.attrValue.map((attrItem) => {
if (attrItem.check) {
// 将预选中的规格组合起来
arr.push(attrItem.attr)
}
})
})
if (arr.length > 0) {
const attrStr = arr.sort().join(',')
let targat = null
this.goodAttr.productValueArr.map(item => {
if (item.attrItemkey === attrStr) {
targat = item
}
})
if (targat) {
const stock = targat.stock
this.currGoodAttr = targat
this.goodAttr.productAttr[index].attrValue.map(attrItem => {
attrItem.check = false
})
this.goodAttr.productAttr[index].attrValue[attrIndex].check = true
if (stock === 0) {
uni.showToast({
title: '库存不足',
icon: 'none',
duration: 3000
})
}
this.$forceUpdate()
} else {
uni.showToast({
title: '库存不足',
icon: 'none',
duration: 3000
})
}
}
},
// 确认切换
changeAttrConfirm() {
if (this.currGoodAttr.stock === 0) {
return
}
uni.showLoading()
cartGoodChangeAttr({
id: this.currGood.id,
uniqueId: this.currGoodAttr.unique
}).then(res => {
const { success } = res
if (success) {
this.getCart()
this.closeAttr()
}
}).catch(() => {
uni.hideLoading()
}).finally(() => {
uni.hideLoading()
})
},
closeAttr() {
this.currGoodAttr = {}
this.currGood = {}
this.showAttr = false
},
navToGood(id) {
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: { id }
})
},
submit() {
const ids = this.handleIds()
if (ids.length === 0) return
const param = ids.join(',')
uni.navigateTo({
url: '/pages/order/OrderSubmission/index?id=' + param
url: '/pages/order/OrderSubmission/index?id=' + ids.join(',')
})
}
}
@@ -242,7 +541,6 @@ view {
.pages-cart {
min-height: 100vh;
padding-top: calc(var(--status-bar-height) + 54px);
padding-bottom: 100rpx;
}
@@ -261,11 +559,11 @@ view {
}
}
.goods-box {
.goods {
.good-box {
.good {
margin-top: 24rpx;
.goods-cover {
.good-cover {
width: 160rpx;
height: 160rpx;
margin-right: 16rpx;
@@ -323,4 +621,127 @@ view {
font-size: 32rpx;
}
}
.good-attr-wrap {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 9999;
.layer {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
background-color: rgba(0, 0, 0, 0.5);
}
.content {
position: absolute;
left: 0;
right: 0;
bottom: 0;
z-index: 5;
max-height: 75vh;
padding: 30rpx;
border-top-left-radius: 30rpx;
border-top-right-radius: 30rpx;
box-sizing: border-box;
background-color: #fff;
overflow-y: auto;
.close {
position: absolute;
top: 30rpx;
right: 30rpx;
.iconfont {
font-size: 16px;
color: #666;
}
}
.good-info {
padding: 20rpx 0 0 0;
.name-img {
display: flex;
.img {
display: block;
width: 160rpx;
height: 160rpx;
margin: 0 20rpx 0 0;
}
.name {
width: calc(100% - 220rpx);
color: #333;
font-size: 16px;
}
.price {
margin: 20rpx 0 0 0;
color: #E92727;
font-size: 16px;
.txt{
font-size: 12px;
}
}
}
}
.attr-wrap {
padding: 30rpx 0 0 0;
.item + .item {
margin: 20rpx 0 0 0;
}
.title {
margin: 0 0 10rpx 0;
color: #999;
font-size: 28rpx;
}
.attr {
position: relative;
padding: 7rpx 33rpx;
margin: 14rpx 14rpx 0 0;
border: 1rpx solid #bbb;
border-radius: 6rpx;
color: #333;
font-size: 26rpx;
&.on {
color: #fff;
border-color: #eb3729;
background-color: #eb3729;
}
&.disabled {
color: #333;
border-color: #f1f1f1;
background-color: #f1f1f1;
.tag {
position: absolute;
top: -18upx;
right: -18upx;
height: 28upx;
padding: 0 6upx;
border-radius: 6upx;
color: #fff;
line-height: 28upx;
font-size: 10px;
background-color: #FD5749;
}
}
}
}
.bottom {
padding: 30rpx 0 0 0;
.btn {
height: 80rpx;
border-radius: 40rpx;
line-height: 80rpx;
text-align: center;
color: #fff;
font-size: 16px;
background-color: #E92727;
&.disabled {
color: #666;
background-color: #f1f1f1;
}
}
}
}
}
</style>
+14 -3
View File
@@ -57,9 +57,20 @@
@click="bannerItemTapHandle(banner)"
/>
</view>
<!--9-2 推荐信息-->
<view class="recommendInfo" v-if="recommendInfo && type < 2">
<template v-if="(type === 0 && recommendInfo.hotelList) || (type === 1 && recommendInfo.productList)">
<!--全国特产和文玩的推荐信息-->
<view
v-if="recommendInfo && type < 2"
class="recommendInfo"
>
<!--bug#1060-增加控制-->
<template
v-if="recommendInfo.displayStatus === 1 &&
(
(type === 0 && recommendInfo.hotelList) ||
(type === 1 && recommendInfo.productList)
)
"
>
<view class="red-border-title">{{ recommendInfo.title }}</view>
<image
:src="recommendInfo.backgroundImage"
+9 -3
View File
@@ -68,18 +68,19 @@
<view class="text">暂无数据</view>
</view>
</view>
<goo-skeleton v-else />
<goo-skeleton
v-else
:show-avatar="false"
/>
</view>
</view>
</template>
<script>
import { getHotelList, getHotelTypeList } from "@/api/inn.js"
import { getCurAddress, getLocation } from "@/utils/common"
import GooSkeleton from '@/components/GooSkeleton/index.vue'
import FunHotelItem from './components/HotelItem'
export default {
components: {
GooSkeleton,
FunHotelItem
},
data() {
@@ -104,6 +105,11 @@ export default {
return arr
}
},
onReachBottom() {
// 后端接口结构需要调整下,需要补充总页数,前端可判断当前页数大于等于总页数则不发送网络请求
this.page++
this.fetchList()
},
onLoad() {
this.getMapData()
getHotelTypeList().then(({data}) => {
+32 -7
View File
@@ -54,22 +54,32 @@
<view class="acea-row row-middle row-between" style="padding-top: 20rpx;background: #fff;">
<view @click="goGoodSearch()" class="search acea-row row-middle" style="flex-grow: 1;">
<text class="iconfont icon-xiazai5" style="color: #acacac;"></text>
搜索商品
搜索
</view>
</view>
<!-- 导航v9 -->
<view style="padding:24rpx 30rpx;background-color: #FFFFFF">
<u-scroll-list indicatorActiveColor="#FF6666">
<u-scroll-list
:indicator="menus.length > 10"
:indicator-active-color="'#FF6666'"
>
<view v-for="n in menuArr[0].length" :key="n">
<view class="flex flex-col ai-center" style="width: 138rpx;margin-bottom: 32rpx;"
@click="$global.commonJump(menuArr[0][n]['uniapp_url'])">
<view
class="flex flex-col ai-center"
style="width: 138rpx;margin-bottom: 32rpx;"
@click="$global.commonJump(menuArr[0][n]['uniapp_url'])"
>
<image style="width: 86rpx;height: 86rpx" :src="menuArr[0][n]['pic']" mode="scaleToFill"/>
<view class="one-t tc" style="width: 100%;margin-top: 16rpx;color:#666666;font-size: 26rpx">
{{ menuArr[0][n]['name'] }}
</view>
</view>
<view class="flex flex-col ai-center" style="width: 138rpx" v-if="menuArr[1][n]"
@click="$global.commonJump(menuArr[1][n]['uniapp_url'])">
<view
v-if="menuArr[1][n]"
class="flex flex-col ai-center"
style="width: 138rpx"
@click="$global.commonJump(menuArr[1][n]['uniapp_url'])"
>
<image style="width: 86rpx;height: 86rpx" :src="menuArr[1][n]['pic']" mode="scaleToFill"/>
<view class="one-t tc" style="width: 100%;margin-top: 16rpx;color:#666666;font-size: 26rpx">
{{ menuArr[1][n]['name'] }}
@@ -410,8 +420,12 @@ export default {
this.getUnreadMsgList();
}
//获取团购商品
// 获取团购商品
this.getGroupGoods();
// fix bug#1113
// if (this.bastList.length > 0) {
// this.getBastList()
// }
},
onShareAppMessage() {
return {
@@ -528,6 +542,17 @@ export default {
});
});
},
getBastList() {
getHomeData().then(res => {
const { success, data } = res
if (success) {
for (let i = 0; i < data.bastList.length; i++) {
data.bastList[i].hide = true
}
this.$set(that, 'bastList', data.bastList)
}
})
},
getGroupGoods() {
var params = {
page: 1,
+86 -32
View File
@@ -35,34 +35,41 @@
<view class="item-info acea-row row-between row-top" v-for="(cart,cartInfoIndex) in order.cartInfo"
:key="cartInfoIndex">
<view class="pictrue">
<image :src="cart.productInfo.image" @click.stop="
$yrouter.push({ path: '/pages/shop/GoodsCon/index',query:{id:cart.productInfo.id} })
" v-if="cart.combinationId === 0 && cart.bargainId === 0 &&cart.seckillId === 0"/>
<image :src="cart.productInfo.image" @click.stop="
$yrouter.push({
path: '/pages/activity/GroupDetails/index',query:{id:cart.combinationId}
})
" v-else-if="cart.combinationId > 0"/>
<image :src="cart.productInfo.image" @click.stop="
$yrouter.push({
path: '/pages/activity/DargainDetails/index',query:{id:cart.bargainId}
})
" v-else-if="cart.bargainId > 0"/>
<image :src="cart.productInfo.image" @click.stop="
$yrouter.push({
path: '/pages/activity/SeckillDetails/index',query:{id:cart.seckillId}
})
" v-else-if="cart.seckillId > 0"/>
<image
v-if="cart.combinationId === 0 && cart.bargainId === 0 &&cart.seckillId === 0"
:src="cart.productInfo.image"
@click.stop="gotoGoodDetail(cart, 1, { id: cart.productInfo.id })"
/>
<image
v-else-if="cart.combinationId > 0"
:src="cart.productInfo.image"
@click.stop="gotoGoodDetail(cart, 2, { id: cart.combinationId })"
/>
<image
v-else-if="cart.bargainId > 0"
:src="cart.productInfo.image"
@click.stop="gotoGoodDetail(cart, 3, { id: cart.bargainId })"
/>
<image
v-else-if="cart.seckillId > 0"
:src="cart.productInfo.image"
@click.stop="gotoGoodDetail(cart, 4, { id: cart.seckillId })"
/>
</view>
<view class="text acea-row row-between">
<view class="acea-row row-column" style="width: 100%">
<view class="name line2">{{ cart.productInfo.storeName }}</view>
<view class="attr line1" style="color: #999999;" v-if="cart.productInfo.attrInfo">
属性{{ cart.productInfo.attrInfo.sku }}
<view class="text">
<view class="acea-row name-wrap">
<view class="name more-t">{{ cart.productInfo.storeName }}</view>
<view class="money">
<view>{{ force2Decimal(cart.truePrice) }}</view>
</view>
</view>
<view class="money">
<view>{{ force2Decimal(cart.truePrice) }}</view>
<view class="acea-row attr-wrap">
<view
v-if="cart.productInfo.attrInfo"
class="attr"
>
规格{{ cart.productInfo.attrInfo.sku }}
</view>
<view>x{{ cart.cartNum }}</view>
</view>
</view>
@@ -195,9 +202,18 @@ export default {
})
},
goRefund(order) {
uni.navigateTo({
url: `/pkg_orders/views/refund?id=${order.orderId}`
})
if (this.type === 4) {
uni.showToast({
title: '订单已收货,如需退款请联系客服',
mask: false,
icon: 'none',
duration: 3000
})
} else {
uni.navigateTo({
url: `/pkg_orders/views/refund?id=${order.orderId}`
})
}
},
goLogistics(order) {
this.$yrouter.push({
@@ -224,6 +240,30 @@ export default {
}
}
},
gotoGoodDetail(cart, type, query){
// isProductStillExist:0-不存在,1-存在
const isProductStillExist = cart.isProductStillExist || 0
if (isProductStillExist === 0) {
this.$dialog.toast({ mes: '商品已下架' })
return
}
let path = ''
switch(type) {
case 1:
path = '/pages/shop/GoodsCon/index'
break
case 2:
path = '/pages/activity/GroupDetails/index'
break
case 3:
path = '/pages/activity/DargainDetails/index'
break
case 4:
path = '/pages/activity/SeckillDetails/index'
break
}
this.$yrouter.push({ path, query })
},
getOrderData() {
getOrderData().then(res => {
this.orderData = res.data;
@@ -318,6 +358,11 @@ export default {
case -3:
status = "已驳回";
break;
case 9:
status = "已取消";
break;
default:
break;
}
return status;
},
@@ -393,7 +438,7 @@ page {
.shop-info {
padding: 20rpx 16rpx;
border-bottom: 2rpx solid #DADADA;
border-bottom: 2rpx solid #eee;
.name {
margin-left: 6rpx;
@@ -417,8 +462,7 @@ page {
.item-info {
margin: 0 30rpx;
padding: 22rpx 0 0;
border-top: 1rpx solid #eee;
padding: 0 0 0 0;
}
.totalPrice {
@@ -426,7 +470,7 @@ page {
}
.bottom {
border-top: 2rpx solid #DADADA;
border-top: 2rpx solid #eee;
.bnt {
display: flex;
@@ -503,4 +547,14 @@ page {
}
}
}
.my-order .list .item .item-info .name-wrap,
.my-order .list .item .item-info .attr-wrap {
justify-content: space-between;
}
.my-order .list .item .item-info .attr-wrap {
margin: 10rpx 0 0 0;
}
.my-order .list .item .item-info .text .name {
width: calc(100% - 160rpx);
}
</style>
+2 -2
View File
@@ -72,10 +72,10 @@
{{ orderInfo.realName }}
<text class="phone">{{ orderInfo.userPhone }}</text>
</view>
<view class="acea-row row-middle">
<!-- <view class="acea-row row-middle">
<image style="width: 32rpx;height: 32rpx;" :src="webUrl+'/20210808005541949297.png'" mode=""
@click="call(orderInfo.userPhone)"></image>
</view>
</view> -->
</view>
<view>{{ orderInfo.userAddress }}</view>
</view>
+116 -43
View File
@@ -162,16 +162,33 @@
<view>运费</view>
<view class="money">{{ force2Decimal(orderPrice.payPostage) }}</view>
</view>
<view class="item acea-row row-between-wrapper" v-if="orderPrice.couponPrice > 0">
<!-- <view class="item acea-row row-between-wrapper" v-if="orderPrice.couponPrice > 0">
<view>优惠券抵扣</view>
<view class="money">-{{ force2Decimal(orderPrice.couponPrice) }}</view>
</view>
<view class="item acea-row row-between-wrapper" v-if="orderPrice.deductionPrice > 0">
<view>积分抵扣</view>
<view class="money">-{{ force2Decimal(orderPrice.deductionPrice) }}</view>
</view> -->
</view>
<view v-if="canUsePoints" class="coupon-cell">
<view class="flex jc-between ai-center">
<view class="title">积分抵扣</view>
<view class="flex ai-center">
<u-switch
v-model="usePointsCheck"
size="20"
@change="usePointsCheckChange"
/>
</view>
</view>
<view v-if="usePointsCheck" class="flex jc-between ai-center points-cell">
<view>积分{{ orderPrice.usedPoints }}</view>
<view class="flex ai-center">
-{{ force2Decimal(orderPrice.deductionPrice) }}
</view>
</view>
</view>
<view class="coupon-cell flex jc-between ai-center" @click="changeCoupons">
<view class="title">优惠券</view>
<view class="flex ai-center">
@@ -185,8 +202,18 @@
</view>
<!-- v9 优惠券开始 -->
<u-popup :show="show" :round="10" mode="bottom" closeOnClickOverlay @close="changeCoupons">
<CouponsPopup :two-list="couponList" @close="changeCoupons" v-if="couponList.usable"/>
<u-popup
:show="show"
:round="10"
mode="bottom"
close-on-click-overlay
@close="changeCoupons"
>
<CouponsPopup
v-if="couponList.usable.length > 0"
:two-list="couponList"
@change="changeCoupons"
/>
</u-popup>
<!-- v9 优惠券结束 -->
@@ -194,23 +221,27 @@
<view class="footer acea-row row-between-wrapper" style="height: 80rpx;">
<view style="margin-left: 30rpx;">
<text style="color: #000000;font-size: 24rpx;font-weight: bold;">合计:</text>
<text class="" style="color: #FF564A;font-size: 28rpx;font-weight: bold;">{{
force2Decimal(orderPrice.payPrice)
}}
<text class="" style="color: #FF564A;font-size: 28rpx;font-weight: bold;">
{{ force2Decimal(orderPrice.payPrice) }}
</text>
</view>
<view class="settlement acea-row row-middle row-center" @click="subscribePay">立即结算</view>
</view>
<AddressWindow
@checked="changeAddress"
@redirect="addressRedirect"
v-model="showAddress"
:checked="addressInfo.id"
ref="mychild"
></AddressWindow>
<passkeyborad :money="orderPrice.payPrice" showMoney :show="isShowPayPwdPop" ref='payPwdPop' @close="pwdPopClose"
@finish="pwdPopFinish"></passkeyborad>
v-model="showAddress"
ref="mychild"
:checked="addressInfo.id"
@checked="changeAddress"
@redirect="addressRedirect"
/>
<passkeyborad
ref='payPwdPop'
showMoney
:money="orderPrice.payPrice"
:show="isShowPayPwdPop"
@close="pwdPopClose"
@finish="pwdPopFinish"
/>
</view>
</template>
@@ -272,10 +303,21 @@ export default {
lotteryRecordId:'',
payPassword: null,
// v9-2
couponList: {},
couponId: 0,
couponList: {
unusable: [],
usable: []
},
couponId: uni.getStorageSync('couponId') || 0,
couponIndex: -1,
show: false
show: false,
// 是否使用积分开关
usePointsCheck: false,
// 要使用的积分数量(传0为不使用积分,目前需求是默认使用最大可使用的积分,所以只要传大于0的数值都会变为自动使用最大可用积分)
usePointsNumber: 0,
// 订单是否可以使用积分
canUsePoints: false,
// 订单最大可使用积分数量
maxPoints: 0
};
},
computed: mapGetters(["userInfo", "storeItems"]),
@@ -331,13 +373,17 @@ export default {
force2Decimal(value) {
return this.$force2Decimal(value);
},
usePointsCheckChange(e) {
this.computedPrice()
},
// 计算订单金额
computedPrice(f) {
console.log(f)
let shipping_type = this.shipping_type;
postOrderComputed(this.orderGroupInfo.orderKey, {
addressId: this.addressInfo.id,
useIntegral: this.useIntegral ? 1 : 0,
couponId: this.couponId || 0,
usePoints: this.usePointsCheck ? 1 : 0,
shipping_type: parseInt(shipping_type) + 1
}).then(res => {
const data = res.data;
@@ -350,39 +396,61 @@ export default {
});
} else {
this.orderPrice = data.result;
if (this.usePointsCheck) {
this.usePointsNumber = data.result.usedPoints
} else {
this.usePointsNumber = 0
}
}
});
},
getCartInfo() {
var that = this;
// const cartIds = this.$yroute.query.id;
if (!that.cartid && !that.lotteryRecordId) {
const _this = this
if (!_this.cartid && !_this.lotteryRecordId) {
uni.showToast({
title: "参数有误",
icon: "none",
duration: 2000
});
return this.$yrouter.back();
})
return this.$yrouter.back()
}
postOrderConfirm(that.cartid,that.lotteryRecordId)
.then(res => {
that.offlinePayStatus = res.data.offline_pay_status;
that.orderGroupInfo = res.data;
that.deduction = res.data.deduction;
that.couponList = res.data.couponList
that.addressInfo = res.data.addressInfo || {};
that.systemStore = res.data.systemStore || {};
that.storeSelfMention = res.data.storeSelfMention;
that.couponId = uni.getStorageSync('couponId') || 0
that.computedPrice()
postOrderConfirm(_this.cartid,_this.lotteryRecordId).then(res => {
const { data } = res
_this.offlinePayStatus = data.offline_pay_status
_this.orderGroupInfo = data
_this.deduction = data.deduction
_this.couponList = data.couponList
if (_this.couponId > 0) {
_this.couponList['usable'].map((item, index) => {
if (item.id === _this.couponId) {
item.checked = true
_this.couponIndex = index
} else {
item.checked = false
}
})
.catch(err => {
uni.showToast({
title: err.msg,
icon: "none",
duration: 2000
});
});
uni.removeStorageSync('couponId')
} else {
uni.removeStorageSync('couponId')
}
_this.canUsePoints = data.canUsePoints
_this.maxPoints = data.maxPoints
// 如果允许使用积分,则默认开启
if (data.canUsePoints) {
_this.usePointsCheck = true
_this.usePointsNumber = data.maxPoints
}
_this.addressInfo = data.addressInfo || {}
_this.systemStore = data.systemStore || {}
_this.storeSelfMention = data.storeSelfMention
_this.computedPrice()
}).catch(err => {
uni.showToast({
title: err.msg,
icon: "none",
duration: 2000
})
})
},
addressTap: function () {
//改用跳转页面方式
@@ -514,6 +582,7 @@ export default {
addressId: this.addressInfo.id,
useIntegral: this.useIntegral ? 1 : 0,
couponId: this.couponId || 0,
usePoints: this.usePointsNumber || 0,
payType: this.active,
pinkId: this.pinkId,
seckillId: this.orderGroupInfo.seckill_id,
@@ -806,4 +875,8 @@ export default {
background-color: #FFFFFF;
font-size: 24rpx;
}
.points-cell {
padding: 20rpx 0 0 0;
color: #999;
}
</style>
-354
View File
@@ -1,354 +0,0 @@
<template>
<view class="order-details pos-order-details">
<view class="header acea-row row-middle">
<view class="state">{{ title }}</view>
<view class="data">
<view class="order-num">订单{{ orderInfo.orderId }}</view>
<view>
<text class="time">
<data-format :date="orderInfo.addTime"></data-format>
</text>
</view>
</view>
</view>
<view class="orderingUser acea-row row-middle">{{ orderInfo.nickname }}</view>
<view class="address">
<view class="name">
{{ orderInfo.realName}}
<text class="phone">{{ orderInfo.userPhone }}</text>
</view>
<view>{{ orderInfo.userAddress }}</view>
</view>
<view class="line">
<image :src="webUrl+'/20230304135025917856.png'" />
</view>
<view class="pos-order-goods">
<view
class="goods acea-row row-between-wrapper"
v-for="(item, orderInfoIndex) in orderInfo.cartInfo"
:key="orderInfoIndex"
>
<view class="picTxt acea-row row-between-wrapper">
<view class="pictrue">
<image :src="item.productInfo.image" />
</view>
<view class="text acea-row row-between row-column">
<view class="info line2">{{ item.productInfo.storeName }}</view>
<view class="attr">{{ item.productInfo.sku }}</view>
</view>
</view>
<view class="money">
<view class="x-money">{{ item.productInfo.price }}</view>
<view class="num">x{{ item.cartNum }}</view>
<view class="y-money">{{ item.productInfo.otPrice ? item.productInfo.otPrice : 0 }}</view>
</view>
</view>
</view>
<view class="public-total">
{{ orderInfo.totalNum }}件商品应支付
<text class="money">{{ orderInfo.payPrice }}</text>
( 邮费 ¥{{
orderInfo.payPostage
}}
)
</view>
<view class="wrapper">
<view class="item acea-row row-between">
<view>订单编号</view>
<view class="conter acea-row row-middle row-right">
{{ orderInfo.orderId
}}
<text
class="copy copy-data"
@click="copyClipboard(orderInfo.orderId)"
>复制</text>
</view>
</view>
<view class="item acea-row row-between">
<view>下单时间</view>
<view class="conter">
<data-format :date="orderInfo.addTime"></data-format>
</view>
</view>
<view class="item acea-row row-between">
<view>支付状态</view>
<view class="conter">{{ orderInfo.paid == 1 ? "已支付" : "未支付" }}</view>
</view>
<view class="item acea-row row-between">
<view>支付方式</view>
<view class="conter">{{ payType }}</view>
</view>
<view class="item acea-row row-between">
<view>买家留言</view>
<view class="conter">{{ orderInfo.mark }}</view>
</view>
</view>
<view class="wrapper">
<view class="item acea-row row-between">
<view>支付金额</view>
<view class="conter">{{ orderInfo.totalPrice }}</view>
</view>
<view class="item acea-row row-between">
<view>优惠券抵扣</view>
<view class="conter">-{{ orderInfo.couponPrice }}</view>
</view>
<view class="actualPay acea-row row-right">
实付款
<text class="money font-color-red">{{ orderInfo.payPrice }}</text>
</view>
</view>
<view
class="wrapper"
v-if="orderInfo.delivery_type != 'fictitious' && orderInfo._status._type === 2"
>
<view class="item acea-row row-between">
<view>配送方式</view>
<view class="conter" v-if="orderInfo.delivery_type === 'express'">快递</view>
<view class="conter" v-if="orderInfo.delivery_type === 'send'">送货</view>
</view>
<view class="item acea-row row-between">
<view v-if="orderInfo.delivery_type === 'express'">快递公司</view>
<view v-if="orderInfo.delivery_type === 'send'">送货人</view>
<view class="conter">{{ orderInfo.delivery_name }}</view>
</view>
<view class="item acea-row row-between">
<view v-if="orderInfo.delivery_type === 'express'">快递单号</view>
<view v-if="orderInfo.delivery_type === 'send'">送货人电话</view>
<view class="conter">
{{ orderInfo.delivery_id
}}
<text
class="copy copy-data"
@click="copyClipboard(orderInfo.delivery_id)"
>复制</text>
</view>
</view>
</view>
<view style="height:100rpx;"></view>
<view class="footer acea-row row-right row-middle">
<view class="more"></view>
<view class="bnt cancel" @click="modify(0)" v-if="types == 0">一键改价</view>
<view class="bnt cancel" @click="modify(0)" v-if="types == -1">立即退款</view>
<view
class="bnt cancel"
v-if="orderInfo.pay_type === 'offline' && orderInfo.paid === 0"
@click="offlinePay"
>确认付款</view>
<view class="bnt delivery" v-if="types == 1" @click="goGoodsDeliver(orderInfo)">去发货</view>
</view>
<PriceChange
:change="change"
:orderInfo="orderInfo"
v-on:closechange="changeclose($event)"
v-on:savePrice="savePrice"
:status="status"
></PriceChange>
</view>
</template>
<script>
import PriceChange from "@/components/PriceChange";
import DataFormat from "@/components/DataFormat";
import {
getAdminOrderDetail,
setAdminOrderPrice,
setAdminOrderRemark,
setOfflinePay,
setOrderRefund
} from "@/api/admin";
import { required, num } from "@/utils/validate";
import { validatorDefaultCatch } from "@/utils/dialog";
import { copyClipboard } from "@/utils";
export default {
name: "AdminOrder",
components: {
PriceChange,
DataFormat
},
props: {},
data: function() {
return {
order: false,
change: false,
order_id: "",
orderInfo: {
_status: {}
},
status: "",
title: "",
payType: "",
types: ""
};
},
watch: {
"$yroute.query.oid": function(newVal) {
let that = this;
if (newVal != undefined) {
that.order_id = newVal;
that.getIndex();
}
}
},
mounted: function() {
this.order_id = this.$yroute.query.oid;
this.getIndex();
},
methods: {
goGoodsDeliver(orderInfo) {
this.$yrouter.push({
path: "/pages/orderAdmin/GoodsDeliver/index",
query: { oid: orderInfo.orderId }
});
},
copyClipboard,
more: function() {
this.order = !this.order;
},
modify: function(status) {
this.change = true;
this.status = status;
},
changeclose: function(msg) {
this.change = msg;
},
getIndex: function() {
let that = this;
getAdminOrderDetail(that.order_id).then(
res => {
that.orderInfo = res.data;
that.types = res.data._status._type;
that.title = res.data._status._title;
that.payType = res.data._status._payType;
},
err => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
}
);
},
async savePrice(opt) {
let that = this,
data = {},
price = opt.price,
remark = opt.remark,
refund_price = opt.refund_price.toString();
data.orderId = that.orderInfo.orderId;
if (that.status == 0 && that.orderInfo.refundStatus === 0) {
try {
await this.$validator({
price: [
required(required.message("金额")),
num(num.message("金额"))
]
}).validate({ price });
} catch (e) {
return validatorDefaultCatch(e);
}
data.price = price;
setAdminOrderPrice(data).then(
function() {
that.change = false;
uni.showToast({
title: "改价成功",
icon: "success",
duration: 2000
});
that.getIndex();
},
function() {
that.change = false;
uni.showToast({
title: "改价失败",
icon: "none",
duration: 2000
});
}
);
} else if (that.status == 0 && that.orderInfo.refundStatus === 1) {
try {
await this.$validator({
refund_price: [
required(required.message("金额")),
num(num.message("金额"))
]
}).validate({ refund_price });
} catch (e) {
return validatorDefaultCatch(e);
}
data.price = refund_price;
data.type = opt.type;
setOrderRefund(data).then(
res => {
that.change = false;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.getIndex();
},
err => {
that.change = false;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.getIndex();
}
);
} else {
try {
await this.$validator({
remark: [required(required.message("备注"))]
}).validate({ remark });
} catch (e) {
return validatorDefaultCatch(e);
}
data.remark = remark;
setAdminOrderRemark(data).then(
res => {
that.change = false;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.getIndex();
},
err => {
that.change = false;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
}
);
}
},
offlinePay: function() {
setOfflinePay({ order_id: this.orderInfo.order_id }).then(
res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
this.getIndex();
},
err => {
uni.showToast({
title: err.msg,
icon: "none",
duration: 2000
});
}
);
}
}
};
</script>
-330
View File
@@ -1,330 +0,0 @@
<template>
<view class="pos-order-list" ref="container">
<view class="nav acea-row row-around row-middle">
<view class="item" :class="where.status == 0 ? 'on' : ''" @click="changeStatus(0)">待付款</view>
<view class="item" :class="where.status == 1 ? 'on' : ''" @click="changeStatus(1)">待发货</view>
<view class="item" :class="where.status == 2 ? 'on' : ''" @click="changeStatus(2)">待收货</view>
<view class="item" :class="where.status == 3 ? 'on' : ''" @click="changeStatus(3)">待评价</view>
<view class="item" :class="where.status == 4 ? 'on' : ''" @click="changeStatus(4)">已完成</view>
<view class="item" :class="where.status == -3 ? 'on' : ''" @click="changeStatus(-3)">退款</view>
</view>
<view class="list">
<view class="item" v-for="(item, listIndex) in list" :key="listIndex">
<view class="order-num acea-row row-middle" @click="toDetail(item)">
<text>订单号{{ item.orderId }}</text>
<text class="time">
<text>下单时间</text>
<data-format :date="item.addTime"></data-format>
</text>
</view>
<view class="pos-order-goods" v-for="(val, key) in item.cartInfo" :key="key">
<view class="goods acea-row row-between-wrapper" @click="toDetail(item)">
<view class="picTxt acea-row row-between-wrapper">
<view class="pictrue">
<image :src="val.productInfo.image" />
</view>
<view class="text acea-row row-between row-column">
<view class="info line2">{{ val.productInfo.storeName }}</view>
<view class="attr" v-if="val.productInfo.sku">{{ val.productInfo.sku }}</view>
</view>
</view>
<view class="money">
<view class="x-money">{{ val.productInfo.price }}</view>
<view class="num">x{{ val.cartNum }}</view>
<view class="y-money">{{ val.productInfo.otPrice }}</view>
</view>
</view>
</view>
<view class="public-total">
{{ item.totalNum }}件商品应支付
<text class="money">{{ item.payPrice }}</text>
( 邮费 ¥{{
item.totalPostage
}}
)
</view>
<view class="operation acea-row row-between-wrapper">
<view class="more">
<!-- <view class="iconfont icon-gengduo" @click="more(index)"></view>-->
<!-- <view class="order" v-show="current === index">-->
<!-- <view class="items">-->
<!-- {{ where.status > 0 ? "删除" : "取消" }}订单-->
<!-- </view>-->
<!-- <view class="arrow"></view>-->
<!-- </view>-->
</view>
<view class="acea-row row-middle">
<view class="bnt" @click="modify(item, 0)" v-if="where.status == 0">一键改价</view>
<view class="bnt" @click="modify(item, 0)" v-if="where.status == -3 && item.refundStatus === 1">立即退款</view>
<view class="bnt cancel" v-if="item.pay_type === 'offline' && item.paid === 0" @click="offlinePay(item)">确认付款</view>
<view class="bnt" v-if="where.status == 1" @click="goGoodsDeliver(item)">去发货</view>
</view>
</view>
</view>
</view>
<Loading :loaded="loaded" :loading="loading"></Loading>
<PriceChange :change="change" :orderInfo="orderInfo" v-on:closechange="changeclose($event)" v-on:savePrice="savePrice"
:status="status"></PriceChange>
</view>
</template>
<script>
import PriceChange from "@/components/PriceChange";
import Loading from "@/components/Loading";
import DataFormat from "@/components/DataFormat";
import {
getAdminOrderList,
setAdminOrderPrice,
setAdminOrderRemark,
setOfflinePay,
setOrderRefund
} from "@/api/admin";
import {
required,
num
} from "@/utils/validate";
import {
validatorDefaultCatch
} from "@/utils/dialog";
export default {
name: "AdminOrderList",
components: {
PriceChange,
Loading,
DataFormat
},
props: {},
data: function() {
return {
current: "",
change: false,
types: 0,
where: {
page: 1,
limit: 5,
status: 0
},
list: [],
loaded: false,
loading: false,
orderInfo: {},
status: ""
};
},
watch: {
"$yroute.query.types": function(newVal) {
let that = this;
if (newVal != undefined) {
that.where.status = newVal;
that.init();
}
},
types: function() {
this.getIndex();
}
},
mounted: function() {
let that = this;
that.where.status = that.$yroute.query.types;
that.current = "";
that.getIndex();
},
onReachBottom() {
!this.loading && this.getIndex();
},
methods: {
goGoodsDeliver(item) {
this.$yrouter.push({
path: "/pages/orderAdmin/GoodsDeliver/index",
query: {
oid: item.orderId
}
});
},
more: function(index) {
if (this.current === index) this.current = "";
else this.current = index;
},
modify: function(item, status) {
this.change = true;
this.orderInfo = item;
this.status = status;
},
changeclose: function(msg) {
this.change = msg;
},
async savePrice(opt) {
let that = this,
data = {},
price = opt.price.toString(),
refund_price = opt.refund_price.toString(),
refund_status = that.orderInfo.refundStatus,
remark = opt.remark;
data.orderId = that.orderInfo.orderId;
if (that.status == 0 && refund_status === 0) {
try {
await this.$validator({
price: [
required(required.message("金额")),
num(num.message("金额"))
]
}).validate({
price
});
} catch (e) {
return validatorDefaultCatch(e);
}
data.price = price;
setAdminOrderPrice(data).then(
function() {
that.change = false;
uni.showToast({
title: "改价成功",
icon: "success",
duration: 2000
});
that.init();
},
function() {
that.change = false;
uni.showToast({
title: "改价失败",
icon: "none",
duration: 2000
});
}
);
} else if (that.status == 0 && refund_status === 1) {
try {
await this.$validator({
refund_price: [
required(required.message("金额")),
num(num.message("金额"))
]
}).validate({
refund_price
});
} catch (e) {
return validatorDefaultCatch(e);
}
data.price = refund_price;
data.type = opt.type;
setOrderRefund(data).then(
res => {
that.change = false;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.init();
},
err => {
that.change = false;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
}
);
} else {
try {
await this.$validator({
remark: [required(required.message("备注"))]
}).validate({
remark
});
} catch (e) {
return validatorDefaultCatch(e);
}
data.remark = remark;
setAdminOrderRemark(data).then(
res => {
that.change = false;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.init();
},
err => {
that.change = false;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
}
);
}
},
init: function() {
this.list = [];
this.where.page = 1;
this.loaded = false;
this.loading = false;
this.getIndex();
this.current = "";
},
getIndex: function() {
let that = this;
if (that.loading || that.loaded) return;
that.loading = true;
getAdminOrderList(that.where).then(
res => {
that.loading = false;
that.loaded = res.data.length < that.where.limit;
that.list.push.apply(that.list, res.data);
that.where.page = that.where.page + 1;
},
err => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
}
);
},
changeStatus: function(val) {
if (this.where.status != val) {
this.where.status = val;
this.init();
}
},
toDetail: function(item) {
this.$yrouter.push({
path: "/pages/orderAdmin/AdminOrder/index",
query: {
oid: item.orderId
}
});
},
offlinePay: function(item) {
setOfflinePay({
order_id: item.order_id
}).then(
res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
this.init();
},
error => {
uni.showToast({
title: error.msg,
icon: 'none',
duration: 2000
});
}
);
}
}
};
</script>
<style lang="less">
</style>
-231
View File
@@ -1,231 +0,0 @@
<template>
<view class="deliver-goods">
<header>
<view class="order-num acea-row row-between-wrapper">
<view class="num line1">订单号{{ delivery.orderId }}</view>
<view class="name line1">{{ delivery.nickname }}</view>
</view>
<view class="address">
<view class="name">
{{ delivery.realName }}
<text class="phone">{{ delivery.userPhone }}</text>
</view>
<view>{{ delivery.userAddress }}</view>
</view>
<view class="line">
<image :src="webUrl+'/20230304135025917856.png'" />
</view>
</header>
<view class="wrapper">
<view class="item acea-row row-between-wrapper">
<view>发货方式</view>
<view class="mode acea-row row-middle row-right">
<view
class="goods"
:class="active === typesIndex ? 'on' : ''"
v-for="(item, typesIndex) in types"
:key="typesIndex"
@click="changeType(item, typesIndex)"
>
{{ item.title }}
<text class="iconfont icon-xuanzhong2"></text>
</view>
</view>
</view>
<view class="list" v-show="active === 0">
<picker
mode="selector"
:range="logistics"
class="mode"
range-key="name"
@change="changeLog"
>
<view class="item acea-row row-between-wrapper">
<view>快递公司</view>
<input
type="text"
placeholder="填写快递公司"
disabled="disabled"
v-model="deliveryNames"
class="mode"
/>
<!-- <input type="text" placeholder="填写快递公司" v-model="deliveryName" class="mode" /> -->
</view>
</picker>
<view class="item acea-row row-between-wrapper">
<view>快递单号</view>
<input type="text" placeholder="填写快递单号" v-model="deliveryId" class="mode" />
</view>
</view>
<view class="list" v-show="active === 1">
<view class="item acea-row row-between-wrapper">
<view>送货人</view>
<input type="text" placeholder="填写送货人" v-model="deliveryName" class="mode" />
</view>
<view class="item acea-row row-between-wrapper">
<view>送货电话</view>
<input type="text" placeholder="填写送货电话" v-model="deliveryId" class="mode" />
</view>
</view>
</view>
<view style="height:100rpx;"></view>
<view class="confirm" @click="saveInfo">确认提交</view>
</view>
</template>
<script>
import { getAdminOrderDelivery, setAdminOrderDelivery } from "@/api/admin";
import { getLogistics } from "@/api/public";
import { required } from "@/utils/validate";
import { validatorDefaultCatch } from "@/utils/dialog";
export default {
name: "GoodsDeliver",
components: {},
props: {},
data: function() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
types: [
{
type: "express",
title: "发货"
}
// {
// type: "send",
// title: "送货"
// },
// {
// type: "fictitious",
// title: "无需发货"
// }
],
active: 0,
order_id: "",
delivery: [],
logistics: [],
delivery_type: "express",
deliveryName: "",
deliveryId: "",
deliveryNames: "请选择"
};
},
watch: {
"$yroute.query.oid": function(newVal) {
let that = this;
if (newVal != undefined) {
that.order_id = newVal;
that.getIndex();
}
}
},
mounted: function() {
this.order_id = this.$yroute.query.oid;
this.getIndex();
this.getLogistics();
},
methods: {
changeLog: function(value) {
this.deliveryNames = this.logistics[value.detail.value].name;
this.deliveryName = this.logistics[value.detail.value].id;
},
changeType: function(item, index) {
this.active = index;
this.delivery_type = item.type;
this.deliveryName = "";
this.deliveryId = "";
},
getIndex: function() {
let that = this;
getAdminOrderDelivery(that.order_id).then(
res => {
that.delivery = res.data;
},
error => {
uni.showToast({
title: error.msg,
icon: "none",
duration: 2000
});
}
);
},
getLogistics: function() {
let that = this;
getLogistics().then(
res => {
console.log(res.data);
that.logistics = res.data;
},
error => {
uni.showToast({
title: error.msg,
icon: "none",
duration: 2000
});
}
);
},
async saveInfo() {
let that = this,
delivery_type = that.delivery_type,
deliveryName = that.deliveryName.toString(),
deliveryId = that.deliveryId,
save = {};
console.log(deliveryName);
save.orderId = that.order_id;
save.deliveryType = that.delivery_type;
switch (delivery_type) {
case "express":
try {
await this.$validator({
deliveryName: [required(required.message("快递公司"))],
deliveryId: [required(required.message("快递单号"))]
}).validate({ deliveryName, deliveryId });
} catch (e) {
return validatorDefaultCatch(e);
}
save.deliveryName = deliveryName;
save.deliveryId = deliveryId;
that.setInfo(save);
break;
case "send":
try {
await this.$validator({
deliveryName: [required(required.message("发货人姓名"))],
deliveryId: [required(required.message("发货人电话"))]
}).validate({ deliveryName, deliveryId });
} catch (e) {
return validatorDefaultCatch(e);
}
save.deliveryName = deliveryName;
save.deliveryId = deliveryId;
that.setInfo(save);
break;
}
},
setInfo: function(item) {
let that = this;
console.log(item);
setAdminOrderDelivery(item)
.then(res => {
console.log(res);
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.$yrouter.go(-1);
})
.catch(err => {
console.log(err);
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
}
}
};
</script>
@@ -1,184 +0,0 @@
<template>
<view class="OrderCancellation">
<view class="header">
<image mode="aspectFit" :src="`${staticUrl}/writeOffBg.jpg`" @click="openQRCode" />
</view>
<view class="whiteBg">
<view class="input">
<input type="number" placeholder="0" v-model="verify_code" />
</view>
<view class="bnt" @click="storeCancellation">立即核销</view>
</view>
<view class="scan" v-if="iswechat">
<image :src="webUrl+'/20200729154546061002.gif'" @click="openQRCode" />
</view>
<WriteOff :iShidden="iShidden" :orderInfo="orderInfo" @cancel="cancel" @confirm="confirm"></WriteOff>
</view>
</template>
<script>
import WriteOff from "@/components/WriteOff";
import {
isWeixin
} from "@/utils";
// import { wechatEvevt } from "@/libs/wechat";
import {
orderVerific
} from "@/api/order";
const NAME = "OrderCancellation";
export default {
name: NAME,
components: {
WriteOff
},
props: {},
data: function() {
return {
staticUrl:this.$STATIC_RESOURCE_URL,
webUrl: VUE_APP_RESOURCES_URL,
iShidden: true,
iswechat: isWeixin(),
orderInfo: {},
verify_code: ""
};
},
mounted: function() {},
methods: {
cancel: function(res) {
this.iShidden = res;
},
confirm: function() {
orderVerific(this.verify_code, 1)
.then(res => {
this.iShidden = true;
this.verify_code = "";
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
},
storeCancellation: function() {
let ref = /[0-9]{12}/;
if (!this.verify_code) {
uni.showToast({
title: "请输入核销码",
icon: "none",
duration: 2000
});
return;
}
if (!ref.test(this.verify_code)) {
uni.showToast({
title: "请输入正确的核销码",
icon: "none",
duration: 2000
});
return;
}
uni.showLoading({
title: "查询中"
});
orderVerific(this.verify_code, 0)
.then(res => {
uni.hideLoading();
this.orderInfo = res.data;
this.iShidden = false;
uni.showToast({
title: res.msg,
icon: "success",
duration: 2000
});
})
.catch(error => {
uni.hideLoading();
uni.showToast({
title: error.msg ||
error.response.data.msg ||
error.response.data.message,
icon: "none",
duration: 2000
});
});
},
openQRCode: function() {
let that = this;
// 这里需要调用扫码功能
}
}
};
</script>
<style scoped lang="less">
.OrderCancellation .header {
width: 100%;
height: 3 * 100rpx;
background-size: 100% 100%;
image {
width: 100%;
height: 3 * 100rpx;
}
}
.OrderCancellation .whiteBg {
width: 6.9 * 100rpx;
background-color: #fff;
margin: -0.93 * 100rpx auto 0 auto;
padding-top: 0.8 * 100rpx;
padding-bottom: 30rpx;
z-index: 99;
position: relative;
border-radius: 0.06 * 100rpx 0.06 * 100rpx 0 0;
}
.OrderCancellation .whiteBg .input {
width: 5.8 * 100rpx;
margin: 0 auto;
border-bottom: 0.01 * 100rpx solid #eee;
}
.OrderCancellation .whiteBg .input input {
padding-bottom: 0.25 * 100rpx;
font-size: 0.6 * 100rpx;
height: auto;
color: #282828;
width: 100%;
text-align: center;
}
.OrderCancellation .whiteBg .bnt {
font-size: 0.32 * 100rpx;
color: #fff;
width: 5.8 * 100rpx;
height: 0.86 * 100rpx;
border-radius: 0.43 * 100rpx;
background-image: linear-gradient(to right, #eb3729 0%, #eb3729 100%);
background-image: -webkit-linear-gradient(to right, #eb3729 0%, #eb3729 100%);
background-image: -moz-linear-gradient(to right, #eb3729 0%, #eb3729 100%);
text-align: center;
line-height: 0.86 * 100rpx;
margin: 0.55 * 100rpx auto 0 auto;
}
.OrderCancellation .scan {
width: 3 * 100rpx;
height: 3 * 100rpx;
margin: 1.1 * 100rpx auto 0 auto;
}
.OrderCancellation .scan image {
width: 100%;
height: 100%;
display: block;
}
</style>
-167
View File
@@ -1,167 +0,0 @@
<template>
<view class="order-index" ref="container">
<image :src="webUrl+'/20230304202119869348.png'" mode="widthFix" class="image" />
<view class="header acea-row">
<view class="item" @click="goAdminOrderList(0)">
<view class="num">{{ census.orderCount.unpaidCount }}</view>
<view>待付款</view>
</view>
<view class="item" @click="goAdminOrderList(1)">
<view class="num">{{ census.orderCount.unshippedCount }}</view>
<view>待发货</view>
</view>
<view class="item" @click="goAdminOrderList(2)">
<view class="num">{{ census.orderCount.receivedCount }}</view>
<view>待收货</view>
</view>
<view class="item" @click="goAdminOrderList(3)">
<view class="num">{{ census.orderCount.evaluatedCount }}</view>
<view>待评价</view>
</view>
<view class="item" @click="goAdminOrderList(4)">
<view class="num">{{ census.orderCount.refundCount }}</view>
<view>退款</view>
</view>
</view>
<view class="wrapper">
<view class="title">
<text class="iconfont icon-shujutongji"></text>数据统计
</view>
<view class="list acea-row">
<view class="item" @click="goStatistics({type:'price',time:'today'})">
<view class="num">{{ census.orderTimeCount.todayPrice }}</view>
<view>今日成交额</view>
</view>
<view class="item" @click="goStatistics({type:'price',time:'yesterday'})">
<view class="num">{{ census.orderTimeCount.proPrice }}</view>
<view>昨日成交额</view>
</view>
<view class="item" @click="goStatistics({type:'price',time:'month'})">
<view class="num">{{ census.orderTimeCount.monthPrice }}</view>
<view>本月成交额</view>
</view>
<view class="item" @click="goStatistics({type:'order',time:'today'})">
<view class="num">{{ census.orderTimeCount.todayCount }}</view>
<view>今日订单数</view>
</view>
<view class="item" @click="goStatistics({type:'order',time:'yesterday'})">
<view class="num">{{ census.orderTimeCount.proCount }}</view>
<view>昨日订单数</view>
</view>
<view class="item" @click="goStatistics({type:'order',time:'month'})">
<view class="num">{{ census.orderTimeCount.monthCount }}</view>
<view>本月订单数</view>
</view>
</view>
</view>
<view class="public-wrapper">
<view class="title">
<text class="iconfont icon-xiangxishuju"></text>详细数据
</view>
<view class="nav acea-row row-between-wrapper">
<view class="data">日期</view>
<view class="browse">订单数</view>
<view class="turnover">成交额</view>
</view>
<view class="conter">
<view
class="item acea-row row-between-wrapper"
v-for="(item, orderListIndex) in list"
:key="orderListIndex"
>
<view class="data">{{ item.time }}</view>
<view class="browse">{{ item.count }}</view>
<view class="turnover">{{ item.price }}</view>
</view>
</view>
</view>
<Loading :loaded="loaded" :loading="loading"></Loading>
</view>
</template>
<script>
import { getStatisticsInfo, getStatisticsMonth } from "@/api/admin";
import Loading from "@/components/Loading";
export default {
name: "OrderIndex",
components: {
Loading
},
props: {},
data: function() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
census: {
orderCount: {},
orderTimeCount: {}
},
list: [],
where: {
page: 1,
limit: 15
},
loaded: false,
loading: false
};
},
mounted: function() {
this.getIndex();
this.getList();
},
onReachBottom() {
!this.loading && this.getList();
},
methods: {
goStatistics(query) {
this.$yrouter.push({
path: "/pages/orderAdmin/Statistics/index",
query
});
},
goAdminOrderList(types) {
this.$yrouter.push({
path: "/pages/orderAdmin/AdminOrderList/index",
query: { types }
});
},
getIndex: function() {
var that = this;
getStatisticsInfo().then(
res => {
that.census = res.data;
that.census.unpaidCount = that.census.orderCount.unpaidCount;
},
err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
}
);
},
getList: function() {
var that = this;
if (that.loading || that.loaded) return;
that.loading = true;
getStatisticsMonth(that.where).then(
res => {
that.loading = false;
that.loaded = res.data.length < that.where.limit;
that.list.push.apply(that.list, res.data);
that.where.page = that.where.page + 1;
},
err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
},
300
);
}
}
};
</script>
-446
View File
@@ -1,446 +0,0 @@
<template>
<view class="statistical-page" ref="container">
<view class="navs">
<view class="list">
<view class="item" :class="time == 'today' ? 'on' : ''" @click="setTime('today')">今天</view>
<view class="item" :class="time == 'yesterday' ? 'on' : ''" @click="setTime('yesterday')">昨天</view>
<view class="item" :class="time == 'seven' ? 'on' : ''" @click="setTime('seven')">最近7天</view>
<view class="item" :class="time == 'month' ? 'on' : ''" @click="setTime('month')">本月</view>
</view>
</view>
<view class="wrapper">
<view class="title">{{ title }}{{ this.where.type == 1 ? "营业额(元)" : "订单量(份)" }}</view>
<view class="money">{{ time_price }}</view>
</view>
<!-- <view class="chart">
<view class="company">{{ where.type === 1 ? "单位(元)" : "单位(份)" }}</view>
<ECharts :options="polar"></ECharts>
</view>-->
<view class="public-wrapper">
<view class="title">
<text class="iconfont icon-xiangxishuju"></text>详细数据
</view>
<view class="nav acea-row row-between-wrapper">
<view class="data">日期</view>
<view class="browse">订单量</view>
<view class="turnover">成交额</view>
</view>
<view class="conter">
<view
class="item acea-row row-between-wrapper"
v-for="(item, statisticalIndex) in list"
:key="statisticalIndex"
>
<view class="data">{{ item.time }}</view>
<view class="browse">{{ item.count }}</view>
<view class="turnover">{{ item.price }}</view>
</view>
</view>
</view>
<!-- <view class="calendar-wrapper" :class="current === true ? 'on' : ''">
<view class="calendar">
<Calendar
:clean="clean"
:lunar="lunar"
ref="calendar"
:range="isrange"
:multi="ismulti"
@select="select"
@next="next"
@prev="prev"
:value="value"
:weekSwitch="weekSwitch"
:monthRange="monthRange"
rangeMonthFormat="yyyy年MM月"
monFirst
responsive
:begin="[1992, 5, 20]"
:end="[2049, 5, 20]"
/>
</view>
</view>-->
<view class="mask" @touchmove.prevent v-show="current === true" @click="close"></view>
<Loading :loaded="loaded" :loading="loading"></Loading>
</view>
</template>
<script>
// import ECharts from "vue-echarts";
// import "echarts/lib/chart/line";
// import "echarts/lib/component/polar";
// import Calendar from "mpvue-calendar";
// import "mpvue-calendar/src/browser-style.css";
import { getStatisticsMonth, getStatisticsTime } from "@/api/admin";
import Loading from "@/components/Loading";
const year = new Date().getFullYear();
const month = new Date().getMonth() + 1;
const day = new Date().getDate();
export default {
name: "Statistics",
components: {
// ECharts,
// Calendar,
Loading
},
props: {},
data: function() {
return {
polar: {
tooltip: {
trigger: "axis"
},
legend: {
data: [""]
},
toolbox: {
show: false,
feature: {
mark: { show: true },
dataView: { show: true, readOnly: false },
magicType: { show: true, type: ["line"] },
restore: { show: true },
saveAsImage: { show: true }
}
},
calculable: true,
xAxis: [
{
type: "category",
boundaryGap: false,
data: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
splitLine: {
show: false
},
axisLine: {
lineStyle: {
color: "#999",
width: 1 //这里是为了突出显示加上的
}
}
}
],
yAxis: [
{
type: "value",
splitLine: {
show: true,
lineStyle: {
color: ["#f5f5f5"],
width: 1,
type: "solid"
}
},
axisLine: {
lineStyle: {
color: "#999",
width: 1 //这里是为了突出显示加上的
}
}
}
],
series: [
{
name: "邮件营销",
type: "line",
stack: "总量",
itemStyle: {
normal: {
color: "#2291f8", //折点颜色
lineStyle: {
color: "#2291f8" //折线颜色
}
}
},
data: [120, 132.5, 101, 134, 90, 150, 30]
}
],
grid: {
x: 30,
x2: 10,
y: 20,
y2: 110
},
animationDuration: 2000
},
value: [
[year, month, day - 1],
[year, month, day]
],
isrange: true,
weekSwitch: false,
ismulti: false,
monFirst: true,
clean: false, //简洁模式
lunar: false, //显示农历
renderValues: [],
monthRange: [],
current: false,
where: {
start: "",
stop: "",
type: "",
cate: 1
},
types: "", //类型|order=订单数|price=营业额
time: "", //时间|today=今天|yesterday=昨天|month=本月
title: "", //时间|today=今天|yesterday=昨天|month=本月
growth_rate: "", //增长率
increase_time: "", //增长率
increase_time_status: "", //增长率
time_price: "", //增长率
loaded: false,
loading: false,
filter: {
page: 1,
limit: 10
},
list: []
};
},
watch: {
"$yroute.params": function(newVal) {
var that = this;
if (newVal != undefined) {
that.setType(newVal.type);
that.setTime(newVal.time);
that.getIndex();
}
}
},
mounted: function() {
this.handelRenderValues();
this.setTime(this.$yroute.query.time);
this.setType(this.$yroute.query.type);
// this.getIndex();
this.getInfo();
},
onReachBottom() {
!this.loading && this.getInfo();
},
computed: {
monthRangeText() {
return this.monthRange.length ? "固定" : "指定范围";
}
},
methods: {
getIndex: function() {
var that = this;
getStatisticsTime(that.where).then(
res => {
var _info = res.data.chart,
day = [],
num = [];
_info.forEach(function(item) {
day.push(item.time);
num.push(item.num);
});
that.polar.xAxis[0].data = day;
that.polar.series[0].data = num;
that.growth_rate = res.data.growth_rate;
that.increase_time = res.data.increase_time;
that.increase_time_status = res.data.increase_time_status;
that.time_price = res.data.time;
},
error => {
uni.showToast({
title: error.msg,
icon: "none",
duration: 2000
});
}
);
},
setTime: function(time) {
this.time = time;
var year = new Date().getFullYear(),
month = new Date().getMonth() + 1,
day = new Date().getDate();
switch (time) {
case "today":
this.where.cate = 1;
this.title = "今日";
this.getIndex();
break;
case "yesterday":
this.where.cate = 2;
this.title = "昨日";
this.getIndex();
break;
case "month":
this.where.cate = 4;
this.title = "本月";
this.getIndex();
break;
case "seven":
this.where.cate = 3;
this.title = "七日";
this.getIndex();
break;
}
},
setType: function(type) {
switch (type) {
case "price":
this.where.type = 1;
break;
case "order":
this.where.type = 2;
break;
}
},
clickSomeThing(data) {
this.value = [
[2019, 4, 1],
[2019, 4, 8]
];
},
setMonthRange() {
this.monthRange = this.monthRange.length ? [] : ["2019-4", "2020-1"];
},
switchMode() {
this.weekSwitch = !this.weekSwitch;
setTimeout(() => {
// this.$refs.calendar.renderer(2019, 1); //渲染2018年8月份
}, 0);
},
handelRenderValues(data) {
if (this.ismulti) {
this.renderValues = this.value.map(v => v.join("-"));
} else if (this.isrange) {
const values = [];
data || this.value;
this.value.forEach((v, i) => {
values.push(v.join("-"));
if (!i) {
values.push("~");
}
});
this.renderValues = values;
} else {
this.renderValues = [this.value.join("-")];
}
},
multiMode() {
this.ismulti = true;
this.isrange = false;
this.value = [
[year, month, 16],
[year, month, 18]
];
this.handelRenderValues();
// this.$refs.calendar.renderer(year, month);
},
rangeMode() {
this.ismulti = false;
this.isrange = true;
this.value = [
[year, month, 16],
[year, month, 22]
];
this.handelRenderValues();
// this.$refs.calendar.renderer(year, month);
},
valueMode() {
this.ismulti = false;
this.isrange = false;
this.value = [year, month, 16];
this.handelRenderValues();
// this.$refs.calendar.renderer(year, month);
},
selectMonth(month, year) {},
prev(y, m, w) {},
next(year, month, week) {},
selectYear(year) {},
setToday() {
// this.$refs.calendar.setToday();
},
dateInfo() {
// const info = this.$refs.calendar.dateInfo(2018, 8, 23);
},
renderer() {
if (this.monthRange.length) {
this.monthRange = ["2018-8", "2018-8"];
}
// this.$refs.calendar.renderer(2018, 8); //渲染2018年8月份
},
select(val, val2) {
if (this.isrange) {
this.handelRenderValues([val, val2]);
} else if (this.ismulti) {
this.handelRenderValues(val);
} else {
this.handelRenderValues([val]);
}
if (
this.where.start != new Date(val) / 1000 ||
this.where.stop != new Date(val2) / 1000 + 24 * 60 * 60 - 1
) {
this.time = "date";
this.title = "";
this.where.start =
new Date(Date.parse(val[0] + "/" + val[1] + "/" + val[2])).getTime() /
1000;
this.where.stop =
new Date(
Date.parse(val2[0] + "/" + val2[1] + "/" + val2[2])
).getTime() /
1000 +
24 * 60 * 60 -
1;
this.getIndex();
}
},
dateTitle: function() {
this.current = true;
},
close: function() {
this.current = false;
},
getInfo: function() {
var that = this;
if (that.loading || that.loaded) return;
that.loading = true;
getStatisticsMonth(that.filter).then(
res => {
that.loading = false;
that.loaded = res.data.length < that.filter.limit;
// that.list.push.apply(that.list, res.data);
that.list = res.data;
that.filter.page = that.filter.page + 1;
},
err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
}
);
}
}
};
</script>
<style scoped lang="less">
.echarts {
width: 100%;
height: 5.5 * 100rpx;
}
.calendar-wrapper {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
z-index: 66;
transform: translate3d(0, 100%, 0);
transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
}
.calendar-wrapper.on {
transform: translate3d(0, 0, 0);
}
.statistical-page .wrapper .increase {
font-size: 0.26 * 100rpx;
}
.statistical-page .wrapper .increase .iconfont {
margin-left: 0;
}
</style>
+34 -5
View File
@@ -5,8 +5,9 @@
<input
v-model.trim="search"
type="text"
placeholder="搜索商品"
placeholder="请输入"
placeholder-style="color:#999"
@confirm="submit"
/>
<view class="btn flex-0 flex jc-center ai-center" @click="submit">
<text class="iconfont icon-sousuo2"></text>
@@ -15,7 +16,17 @@
</view>
</view>
<view v-if="historyKey.length" class="page-content">
<view class="title">历史搜索</view>
<view
class="title"
>
历史搜索
<u-icon
name="trash-fill"
color="#aaa"
size="20"
@click="deleteHistoryHandle"
/>
</view>
<view class="list acea-row limit-box">
<view
v-for="item of historyKey"
@@ -59,10 +70,10 @@ export default {
}
},
mounted: function () {
this.getData();
this.getData()
},
onShow() {
this.getHistory();
this.getHistory()
},
methods: {
submit() {
@@ -92,9 +103,25 @@ export default {
}
this.historyKey.unshift({id: this.$global.generateMixed(10), word })
uni.setStorageSync('historyKey', JSON.stringify(this.historyKey))
},
deleteHistoryHandle() {
const _this = this
uni.showModal({
title: '确认删除最近的搜索记录吗?',
content: '',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success: (result) => {
if (result.confirm) {
_this.historyKey = []
uni.setStorageSync('historyKey', JSON.stringify([]))
}
}
})
}
}
};
}
</script>
<style lang="less">
@@ -139,6 +166,8 @@ export default {
padding: 0 32rpx;
.title {
display: flex;
justify-content: space-between;
margin: 22rpx 0 24rpx;
color: #333;
font-size: 28rpx;
-21
View File
@@ -263,15 +263,6 @@
goGoodSearch() {
this.$yrouter.push("/pages/shop/GoodSearch/index");
},
goGoodsList(child) {
this.$yrouter.push({
path: "/pages/shop/GoodsList/index",
query: {
id: child.id,
title: child.cateName
}
});
},
activeCateId(n) {
let index = 0;
n = parseInt(n);
@@ -314,18 +305,6 @@
});
});
},
submitForm: function() {
var val = trim(this.search);
if (val) {
this.$yrouter.push({
path: "/pages/shop/GoodsList/index",
query: {
s: val
}
});
setTimeout(() => (this.search = ""), 500);
}
},
asideTap(index) {
this.navActive = index;
+144 -275
View File
@@ -23,41 +23,12 @@
<text style="color: #999999;font-size: 24rpx;text-decoration: line-through;">
{{ attr.productSelect.otPrice }}
</text>
<!-- <block v-if="Object.values(productValue).length>1">-->
<!-- <text class="num">{{ priceRangeStr(productValue) }}</text>-->
<!-- <text style="color: #999999;font-size: 24rpx;"></text>-->
<!-- <text-->
<!-- style="color: #999999;font-size: 24rpx;text-decoration: line-through;">-->
<!-- {{ minMaxOtPrice(productValue).min }}-->
<!-- </text>-->
<!-- <text style="color: #999999;font-size: 24rpx;">-</text>-->
<!-- <text style="color: #999999;font-size: 24rpx;"></text>-->
<!-- <text-->
<!-- style="color: #999999;font-size: 24rpx;text-decoration: line-through;">-->
<!-- {{ minMaxOtPrice(productValue).max }}-->
<!-- </text>-->
<!-- </block>-->
<!-- <block v-else>-->
<!-- <text class="num"-->
<!-- v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0">{{ force2Decimal(storeInfo.vipPrice) }}-->
<!-- </text>-->
<!-- <text v-else class="num">{{ force2Decimal(storeInfo.price) }}</text>-->
<!-- <text style="text-decoration: line-through;color: #999999;font-size: 24rpx;"-->
<!-- v-if="storeInfo.otPrice && storeInfo.otPrice>0">{{ force2Decimal(storeInfo.otPrice) }}-->
<!-- </text>-->
<!-- </block>-->
<text v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0" class="vip-price-tag">已享受会员价格</text>
</view>
<view style="flex-shrink:0;" class="acea-row row-middle" @click="listenerActionSheet">
<image :src="webUrl+'/20210806121714655368.png'" mode="" style="width: 36rpx;height: 36rpx;"></image>
</view>
</view>
<!-- 文玩 -->
<!-- <view class="wenwan-info flex jc-between ai-center" v-if="isWenwan===1">-->
<!-- <text>产地:{{ storeInfo.origin }}</text>-->
<!-- <text>单位:{{ storeInfo.unitName }}</text>-->
<!-- <text>规格:{{ storeInfo.storeInfo }}</text>-->
<!-- </view>-->
</view>
<!-- v4 特产 -->
@@ -76,31 +47,6 @@
{{ attr.productSelect.otPrice }}
</text>
</view>
<!-- <block v-if="Object.values(productValue).length>1">-->
<!-- <view class="money font-color-lightred acea-row row-middle">-->
<!-- <text class="num">{{ priceRangeStr(productValue) }}</text>-->
<!-- <text style="color: #999999;font-size: 24rpx;"></text>-->
<!-- <text-->
<!-- style="color: #999999;font-size: 24rpx;text-decoration: line-through;">-->
<!-- {{ minMaxOtPrice(productValue).min }}-->
<!-- </text>-->
<!-- <text style="color: #999999;font-size: 24rpx;">-</text>-->
<!-- <text style="color: #999999;font-size: 24rpx;"></text>-->
<!-- <text-->
<!-- style="color: #999999;font-size: 24rpx;text-decoration: line-through;">-->
<!-- {{ minMaxOtPrice(productValue).max }}-->
<!-- </text>-->
<!-- </view>-->
<!-- </block>-->
<!-- <block v-else>-->
<!-- <text class="price"-->
<!-- v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0">{{ force2Decimal(storeInfo.vipPrice) }}-->
<!-- </text>-->
<!-- <text v-else class="price">{{ force2Decimal(storeInfo.price) }}</text>-->
<!-- <text style="text-decoration: line-through;color: #A5A5A5;font-size: 22rpx;"-->
<!-- v-if="storeInfo.otPrice && storeInfo.otPrice>0">{{ force2Decimal(storeInfo.otPrice) }}-->
<!-- </text>-->
<!-- </block>-->
<text v-if="storeInfo.origin" class="vip-price-tag">{{ storeInfo.origin }}</text>
</view>
@@ -202,7 +148,7 @@
<!-- v9 优惠券开始 -->
<u-popup :show="show" :round="10" mode="bottom" closeOnClickOverlay @close="changeCoupons()">
<CouponsPopup :two-list="couponList" @close="changeCoupons"/>
<CouponsPopup :two-list="couponList" @change="changeCoupons"/>
</u-popup>
<!-- v9 优惠券结束 -->
@@ -230,7 +176,7 @@
<view class="after-title">规格</view>
<view class="title bold">{{ attrValue }}</view>
</view>
<view class="value">库存{{ storeInfo.stock }}
<view class="value">库存{{ attr.productSelect.stock }}
<uni-icons type="right" size="13" color="#707070"></uni-icons>
</view>
</view>
@@ -266,32 +212,6 @@
</view>
</view>
<!-- v6服务项目结束 -->
<!-- 门店信息开始 -->
<!-- <view class="shop-info" v-if="systemStore">-->
<!-- <view class="title flex jc-between ai-center">-->
<!-- <view class="flex ai-center">-->
<!-- <image class="icon-shop" :src="webUrl+'/20210806122617026592.png'"/>-->
<!-- <text class="tip">门店信息</text>-->
<!-- </view>-->
<!-- <text class="font-color-lightred" @click="goStore">进入店铺</text>-->
<!-- </view>-->
<!-- <view class="flex" @click="showChang(systemStore)">-->
<!-- <image class="cover flex-0" :src="systemStore.image"/>-->
<!-- <view class="flex flex-col jc-between" style="width: 100%;">-->
<!-- <view class="flex jc-between ai-center">-->
<!-- <text class="name">{{ systemStore.name }}</text>-->
<!-- <text class="distance" v-if="systemStore.distance != null">距离{{ systemStore.distance }}千米</text>-->
<!-- </view>-->
<!-- <view class="flex jc-between ai-center">-->
<!-- <view class="address one-t">{{ systemStore.address }}</view>-->
<!-- <image class="icon-pos flex-0" :src="webUrl+'/20220903142929759087.png'"/>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<view class="store-section goods-section" v-if="systemStore">
<view class="flex jc-between ai-center">
<view class="title bold flex ai-center">
@@ -325,18 +245,39 @@
<!-- 门店信息结束 -->
<!-- v6产品参数开始 -->
<view class="param-section goods-section"
v-if="Object.entries(storeInfo.exPropertiesData).length>0 && storeInfo.isTickets!==1">
<view
class="param-section goods-section"
v-if="Object.entries(storeInfo.exPropertiesData).length>0 && storeInfo.isTickets!==1"
>
<view class="bold">产品参数</view>
<view class="table">
<view class="row flex ai-center" v-for="(item,index) in storeInfo.exPropertiesData.slice(0,exSliceEnd)"
:key="index">
<view class="title tc">{{ item.key }}</view>
<view class="value tc bold">{{ item.value }}</view>
<view
v-for="(item,index) in storeInfo.exPropertiesData.slice(0, exSliceEnd)"
:key="index"
class="row flex ai-center"
>
<view class="title tc">
<view class="title-cont">
{{ item.key }}
</view>
</view>
<view class="value tc bold">
<view class="value-cont">
{{ item.value }}
</view>
</view>
</view>
<view class="row value tc" style="color:#666" @click="changeExEnd"
v-if="storeInfo.exPropertiesData.length>3">
<uni-icons :type="exSliceEnd===3?'bottom':'top'" size="13" color="#707070"></uni-icons>
<view
v-if="storeInfo.exPropertiesData.length > 3"
class="row btn tc"
style="color:#666"
@click="changeExEnd"
>
<uni-icons
:type="exSliceEnd === 3 ? 'bottom' : 'top'"
size="13"
color="#707070"
></uni-icons>
点击{{ exSliceEnd === 3 ? '展开查看' : '折叠' }}更多参数
</view>
</view>
@@ -357,48 +298,8 @@
</view>
<!-- 用户评价结束 -->
<!-- 商品信息开始 -->
<!-- <view class="product-info acea-row row-column" style="flex-wrap: nowrap;">
<view class="product-info-item acea-row row-between" style="border-bottom: none;">
<view class="product-item-title" style="font-size: 32rpx;color: #080F1A;font-weight: bold;">商品信息</view>
<view class="product-item-value" @click="toggleProductInfo">
<uni-icons :type="isProductInfoExpand?'arrowdown':'arrowup'"></uni-icons>
</view>
</view>
<block v-if="isProductInfoExpand">
<view class="product-info-item acea-row row-between">
<view class="product-item-title">销量</view>
<view class="product-item-value">{{storeInfo.sales}}{{storeInfo.unitName||''}}</view>
</view>
<view class="product-info-item acea-row row-between">
<view class="product-item-title">库存</view>
<view class="product-item-value">{{storeInfo.stock||0}}{{storeInfo.unitName||''}}</view>
</view>
<view v-if="systemStore" class="product-info-item acea-row row-between">
<view class="product-item-title">店铺</view>
<view class="product-item-value acea-row row-middle" style="flex-wrap: nowrap;">
<image :src="systemStore.image" mode="" style="width: 40rpx;height: 40rpx;border-radius: 50%;flex-shrink: 0;"></image>
{{systemStore.name||''}}
</view>
</view>
<view v-if="systemStore" class="product-info-item acea-row row-between">
<view class="product-item-title">地址</view>
<view class="product-item-value">{{systemStore.address||''}}</view>
</view>
<view class="product-info-item acea-row row-between">
<view class="product-item-title">距离</view>
<view class="product-item-value">{{systemStore.distance}}km</view>
</view>
</block>
</view> -->
<!-- 商品信息结束 -->
<!-- 商品详情开始 -->
<view class="product-intro" style="margin-top: 24rpx">
<!-- 原模块 -->
<!-- <view class="conter" v-html="storeInfo.description" ></view>-->
<rich-text :nodes="storeInfo.description" v-if="source!='pre' && source!='day'"/>
<!-- v4 预售详情 -->
<rich-text :nodes="preInfo.description" v-if="source==='pre'"/>
@@ -455,7 +356,7 @@
<view
class="btn-car"
:class="{
'btn-car-disabled': attr.productSelect.stock === 0
'btn-car-disabled': (attr.productSelect.stock === 0 && attr.cartAttr) || storeInfo.stock === 0
}"
@click="joinCart"
>
@@ -464,7 +365,7 @@
<view
class="btn-buy"
:class="{
'btn-buy-disabled': attr.productSelect.stock === 0
'btn-buy-disabled': (attr.productSelect.stock === 0 && attr.cartAttr) || storeInfo.stock === 0
}"
@click="tapBuy"
>
@@ -475,7 +376,7 @@
<ProductWindow
v-on:changeFun="changeFun"
:attr="attr"
:product-value="productValue"
:product-value-arr="productValueArr"
:cartNum="cart_num"
/>
<StorePoster v-on:setPosterImageStatus="setPosterImageStatus" :posterImageStatus="posterImageStatus"
@@ -558,7 +459,7 @@ export default {
productSelect: {}
},
isOpen: false, //是否打开属性组件
productValue: {},
productValueArr: [],
id: null,
partnerId: null,
activityId: 0, // v4 add
@@ -838,9 +739,7 @@ export default {
},
// v4 预售
getPreInfo() {
getPreSale(this.activityId).then(({
data
}) => {
getPreSale(this.activityId).then(({ data }) => {
var now = new Date().getTime();
var nowStr = formatDateTime(now, 'yyyy-MM-dd');
data.surplus = diffDay(nowStr, data.stopTime.substring(0, 10))
@@ -850,9 +749,7 @@ export default {
},
// v4 秒杀
getKillInfo() {
getYxStoreSeckill(this.activityId).then(({
data
}) => {
getYxStoreSeckill(this.activityId).then(({ data }) => {
let stopTime = data.storeInfo.stopTime;
let stopDate = new Date(stopTime.replace(/-/g, "/"));
data.stop = Math.floor(stopDate.getTime() / 1000);
@@ -862,9 +759,7 @@ export default {
},
// v4 每日特价
getDayInfo() {
getDailyGoods(this.activityId).then(({
data
}) => {
getDailyGoods(this.activityId).then(({ data }) => {
let stopTime = data.stopTime;
let stopDate = new Date(stopTime.replace(/-/g, "/"));
data.stop = Math.floor(stopDate.getTime() / 1000);
@@ -874,40 +769,15 @@ export default {
},
// 关联商品规格
handleAttr(data) {
this.$set(this.attr, "productAttr", data.productAttr);
this.$set(this, "productValue", data.productValue);
this.DefaultSelect();
},
priceRangeStr: function (prices) {
var ret = '';
var maxPrice = 0;
var minPrice = Object.values(prices)[0].price;
Object.values(prices).forEach((item) => {
minPrice = Math.min(minPrice, item.price);
maxPrice = Math.max(maxPrice, item.price);
})
if (maxPrice >= 0 && minPrice >= 0) {
if (maxPrice > minPrice) {
ret = minPrice + '-' + maxPrice;
} else if (maxPrice == minPrice) {
ret = minPrice;
}
}
return ret;
},
minMaxOtPrice: function (prices) {
var maxPrice = Object.values(prices)[0].otPrice;
var minPrice = Object.values(prices)[0].otPrice;
Object.values(prices).forEach((item) => {
minPrice = Math.min(minPrice, item.otPrice);
maxPrice = Math.max(maxPrice, item.otPrice);
})
return {
min: minPrice,
max: maxPrice
this.$set(this.attr, "productAttr", data.productAttr)
this.productValueArr = []
for (const key in data.productValue) {
this.productValueArr.push({
attrItemkey: key,
...data.productValue[key]
})
}
this.DefaultSelect()
},
fetchCompanyDatea: function () {
var that = this;
@@ -921,17 +791,9 @@ export default {
force2Decimal(v) {
return this.$force2Decimal(v);
},
toggleProductInfo() {
this.isProductInfoExpand = !this.isProductInfoExpand;
},
goShoppingCart() {
this.$yrouter.switchTab("/pages/cart");
},
goCustomerList() {
this.$yrouter.push({
path: "/pages/user/CustomerList/index"
});
},
goStoreList() {
this.$yrouter.push({
path: "/pages/shop/StoreList/index"
@@ -977,105 +839,108 @@ export default {
},
//产品详情接口;
productCon: function () {
let that = this;
let from = this.location;
if (this.$deviceType == "app") {
from.from = "app";
const from = this.location
if (this.$deviceType == 'app') {
from.from = 'app'
}
if (that.source === 'kill') {
from.seckillId = that.activityId
if (this.source === 'kill') {
from.seckillId = this.activityId
}
uni.showLoading({
title: "加载中",
title: '加载中',
mask: true
});
getProductDetail(that.id, from)
.then(res => {
// 会造成两个style属性,并且生效的是后一个
// res.data.storeInfo.description = res.data.storeInfo.description.replace(
// /\<img/gi,
// '<img style="display:block;max-width:100%;height:auto;"'
// );
that.$set(that, "storeInfo", res.data.storeInfo);
that.isWenwan = res.data.isWenwan;
})
getProductDetail(this.id, from).then(res => {
const { data } = res
this.$set(this, 'storeInfo', data.storeInfo)
this.isWenwan = data.isWenwan
// 给 attr 赋值,将请求回来的规格赋值给 attr
if (this.source === '' || this.source === 'famous') {
this.$set(this.attr, 'productAttr', data.productAttr)
this.productValueArr = []
for (const key in data.productValue) {
this.productValueArr.push({
attrItemkey: key,
...data.productValue[key]
})
}
}
this.attr.defaultSku = data.defaultSku
this.attr.defaultSkuIndex = data.defaultSkuIndex
// 给 attr 赋值,将请求回来的规格赋值给 attr
if (this.source === "" || this.source === 'famous') {
that.$set(that.attr, "productAttr", res.data.productAttr);
that.$set(that, "productValue", res.data.productValue);
}
that.attr.defaultSku = res.data.defaultSku
that.attr.defaultSkuIndex = res.data.defaultSkuIndex
// data.couponList['unusable']?.map(item => item.status = 2)
this.$set(this, 'couponList', data.couponList)
this.$set(this, 'replyCount', data.replyCount)
this.$set(this, 'replyChance', data.replyChance)
this.reply = data.reply ? [data.reply] : []
this.$set(this, 'reply', this.reply)
this.$set(this, 'priceName', data.priceName)
this.$set(this, 'tempName', data.tempName)
this.$set(this, 'merBestProducts', data.merBestProducts)
this.posterData.image = this.storeInfo.image
if (this.storeInfo.storeName.length > 30) {
this.posterData.title = this.storeInfo.storeName.substring(0, 30) + '...'
} else {
this.posterData.title = this.storeInfo.storeName
}
this.posterData.price = this.storeInfo.price
this.posterData.code = this.storeInfo.codeBase
this.systemStore = data.systemStore
const good_list = data.goodList || []
const goodArray = []
const count = Math.ceil(good_list.length / 6)
for (let i = 0; i < count; i++) {
const list = good_list.slice(i * 6, 6)
if (list.length) {
goodArray.push({
list: list
})
}
}
this.mapKay = data.mapKay
this.$set(this, 'goodList', goodArray)
this.DefaultSelect()
this.getCartCount()
res.data.couponList['unusable']?.map(item => item.status = 2)
that.$set(that, 'couponList', res.data.couponList)
that.$set(that, "replyCount", res.data.replyCount);
that.$set(that, "replyChance", res.data.replyChance);
that.reply = res.data.reply ? [res.data.reply] : [];
that.$set(that, "reply", that.reply);
that.$set(that, "priceName", res.data.priceName);
that.$set(that, "tempName", res.data.tempName);
that.$set(that, "merBestProducts", res.data.merBestProducts);
that.posterData.image = that.storeInfo.image;
if (that.storeInfo.storeName.length > 30) {
that.posterData.title =
that.storeInfo.storeName.substring(0, 30) + "...";
} else {
that.posterData.title = that.storeInfo.storeName;
}
that.posterData.price = that.storeInfo.price;
that.posterData.code = that.storeInfo.codeBase;
that.systemStore = res.data.systemStore;
let good_list = res.data.goodList || [];
let goodArray = [];
let count = Math.ceil(good_list.length / 6);
for (let i = 0; i < count; i++) {
var list = good_list.slice(i * 6, 6);
if (list.length)
goodArray.push({
list: list
});
}
that.mapKay = res.data.mapKay;
that.$set(that, "goodList", goodArray);
that.DefaultSelect();
that.getCartCount();
//动态配置share
that.$set(that, "share", {
title: that.storeInfo.storeName,
path: '/pages/shop/GoodsCon/index?id=' + that.id,
imageUrl: that.storeInfo.image,
desc: '',
content: ''
});
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
})
.finally(() => {
uni.hideLoading();
});
// 动态配置share
this.$set(this, 'share', {
title: this.storeInfo.storeName,
path: '/pages/shop/GoodsCon/index?id=' + this.id,
imageUrl: this.storeInfo.image,
desc: '',
content: ''
})
}).catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: 'none',
duration: 2000
})
}).finally(() => {
uni.hideLoading()
})
},
getAttrItemData(attr) {
let result = {}
this.productValueArr.map(item => {
if (item.attrItemkey === attr) {
result = item
}
})
return result
},
//默认选中属性;
DefaultSelect: function () {
let productAttr = this.attr.productAttr;
let value = [];
const productAttr = this.attr.productAttr
for (let i = 0; i < productAttr.length; i++) {
this.$set(productAttr[i], "index", this.attr.defaultSkuIndex[i]);
value.push(productAttr[i].attrValueArr[1]);
}
//sort();排序函数:数字-英文-汉字;
// let productSelect = this.productValue[value.sort().join(",")];
const skuKey = this.attr.defaultSku?.join(',')
let productSelect = this.productValue[skuKey]
if (!skuKey) {
return
}
const productSelect = this.getAttrItemData(skuKey)
if (productSelect && productAttr.length) {
this.$set(
this.attr.productSelect,
@@ -1129,7 +994,7 @@ export default {
ChangeCartNum: function (changeValue) {
//changeValue:是否 加|减
//获取当前变动属性
let productSelect = this.productValue[this.attrValue];
const productSelect = this.getAttrItemData(this.attrValue);
//如果没有属性,赋值给商品默认库存
if (productSelect === undefined && !this.attr.productAttr.length) {
productSelect = this.attr.productSelect;
@@ -1180,7 +1045,7 @@ export default {
//选择属性;
ChangeAttr: function (res) {
// 修改了规格
let productSelect = this.productValue[res.value];
let productSelect = this.getAttrItemData(res.value)
if (productSelect) {
this.attr.productAttr[res.indexw].index = res.indexn;
this.$set(this.attr.productSelect, "image", productSelect.image);
@@ -1204,20 +1069,24 @@ export default {
},
// 点击加入购物车按钮
joinCart: function () {
if (this.attr.productSelect.stock === 0) return;
if ((this.attr.productSelect.stock === 0 && this.attr.cartAttr) || this.storeInfo.stock === 0) {
return
}
//0=加入购物车
this.goCat(0);
},
//立即购买;
tapBuy: function () {
if (this.attr.productSelect.stock === 0) return;
if ((this.attr.productSelect.stock === 0 && this.attr.cartAttr) || this.storeInfo.stock === 0) {
return
}
// 1=直接购买
this.goCat(1);
},
// 加入购物车;
goCat: function (news) {
let that = this,
productSelect = that.productValue[this.attrValue];
productSelect = this.getAttrItemData(this.attrValue)
//打开属性
if (that.attrValue) {
//默认选中了属性,但是没有打开过属性弹窗还是自动打开让用户查看默认选中的属性
+135 -146
View File
@@ -1,6 +1,9 @@
<template>
<view class="evaluate-con">
<view class="goodsStyle acea-row row-between" v-if="orderCon.productInfo">
<view
v-if="orderCon.productInfo"
class="goodsStyle acea-row row-between"
>
<view class="pictrue">
<image :src="orderCon.productInfo.image" class="image"/>
</view>
@@ -14,77 +17,86 @@
</view>
<view class="score">
<view
class="item acea-row row-middle"
v-for="(item, scoreListIndexw) in scoreList"
:key="scoreListIndexw"
v-for="(item, scoreListIndexw) in scoreList"
:key="scoreListIndexw"
class="item acea-row row-middle"
>
<view>{{ item.name }}</view>
<view class="starsList">
<text
@click="stars(starsIndexn, scoreListIndexw)"
v-for="(itemn, starsIndexn) in item.stars"
:key="starsIndexn"
class="iconfont"
:class="item.index >= starsIndexn ? 'icon-shitixing font-color-red': 'icon-kongxinxing'"
></text>
v-for="(itemn, starsIndexn) in item.stars"
:key="starsIndexn"
:class="item.index >= starsIndexn ? 'icon-shitixing font-color-red' : 'icon-kongxinxing'"
class="iconfont"
@click="stars(starsIndexn, scoreListIndexw)"
/>
</view>
<text class="evaluate">{{ item.index === -1 ? "" : item.index + 1 + "分" }}</text>
</view>
<view class="textarea">
<textarea placeholder="商品满足你的期待么?说说你的想法,分享给想买的他们吧~" v-model="expect"></textarea>
<u-upload
:fileList="uploadPictures"
@afterRead="afterRead"
@delete="deletePic"
name="uploadPictures"
multiple
:maxCount="9"
></u-upload>
<!-- <view class="list acea-row row-middle">-->
<!-- <view-->
<!-- class="pictrue"-->
<!-- v-for="(item, uploadPicturesIndex) in uploadPictures"-->
<!-- :key="uploadPicturesIndex"-->
<!-- >-->
<!-- <image :src="item"/>-->
<!-- <text-->
<!-- class="iconfont icon-guanbi1 font-color-red"-->
<!-- @click="uploadPictures.splice(uploadPicturesIndex, 1)"-->
<!-- ></text>-->
<!-- </view>-->
<!-- <view class="pictrue uploadBnt acea-row row-center-wrapper row-column" @tap="chooseImage">-->
<!-- <text class="iconfont icon-icon25201"></text>-->
<!-- <view>上传图片</view>-->
<!-- </view>-->
<!-- </view>-->
<textarea
v-model="expect"
placeholder="商品满足你的期待么?说说你的想法,分享给想买的他们吧~"
/>
<view class="upload-title">
添加视频/图片
<text class="txt">
({{ videoArr.length + picArr.length }}/9)
</text>
</view>
<view class="upload-wrapper">
<view v-show="picArr.length < 9" class="video-upload">
<tm-upload
:upload_img_wh="uploadImgWH"
:upload_max="1"
:upload_count="1"
:url="uploadUrl"
:header="uploadHeader"
type='video'
@change="uploadedVideoChange"
/>
</view>
<view class="pic-upload">
<tm-upload
:upload_img_wh="uploadImgWH"
:upload_max="9 - videoArr.length"
:upload_count="9 - videoArr.length"
:url="uploadUrl"
:header="uploadHeader"
:showBlankPlaceholder="picArr.length !== 9"
type='image'
@change="uploadedPicChange"
/>
</view>
</view>
</view>
<view class="evaluateBnt bg-color-red" @click="submit">立即评价</view>
</view>
</view>
</template>
<style scoped lang="less">
.evaluate-con .score .textarea .list .pictrue.uploadBnt {
border: 1px solid #ddd;
}
</style>
<script>
import {postOrderComment, postOrderProduct} from "@/api/store";
import {trim, uploadImage} from "@/utils";
import {required} from "@/utils/validate";
import {validatorDefaultCatch} from "@/utils/dialog";
const NAME = "GoodsEvaluate";
import { postOrderComment, postOrderProduct } from '@/api/store'
import { trim } from '@/utils'
import { required } from '@/utils/validate'
import { validatorDefaultCatch } from '@/utils/dialog'
import tmUpload from '@/components/tm-upload/tm-upload.vue'
import {
VUE_APP_API_URL
} from '@/config'
export default {
name: NAME,
name: 'GoodsEvaluate',
components: {
// VueCoreImageUpload
tmUpload
},
props: {},
data: function () {
return {
uploadUrl: VUE_APP_API_URL + '/api/upload',
uploadImgWH: (750 - 3 * 16 - 2 * 32 - 16) / 3.0,
uploadHeader: {
Authorization: "Bearer " + this.$store.getters.token
},
orderCon: {
cartProduct: {
productInfo: {}
@@ -92,136 +104,113 @@ export default {
},
scoreList: [
{
name: "商品质量",
stars: ["", "", "", "", ""],
name: '商品质量',
stars: ['', '', '', '', ''],
index: -1
},
{
name: "服务态度",
stars: ["", "", "", "", ""],
name: '服务态度',
stars: ['', '', '', '', ''],
index: -1
}
],
uploadPictures: [],
expect: "",
unique: ""
};
},
mounted: function () {
this.unique = this.$yroute.query.id;
this.getOrderProduct();
},
watch: {
$yroute(n) {
if (n.name === NAME && this.unique !== n.params.id) {
this.unique = n.params.id;
this.$set(this.scoreList[0], "index", -1);
this.$set(this.scoreList[1], "index", -1);
this.expect = "";
this.uploadPictures = [];
this.getOrderProduct();
}
expect: '',
unique: '',
picArr: [],
videoArr: []
}
},
mounted() {
this.unique = this.$yroute.query.id
this.getOrderProduct()
},
methods: {
getOrderProduct: function () {
let that = this,
unique = that.unique;
postOrderProduct(unique).then(res => {
that.orderCon = res.data;
});
getOrderProduct() {
postOrderProduct(this.unique).then(res => {
this.orderCon = res.data
})
},
stars: function (indexn, indexw) {
this.scoreList[indexw].index = indexn;
this.scoreList[indexw].index = indexn
},
// chooseImage() {
// chooseImage(img => {
// this.uploadPictures.push(img);
// });
// },
// 删除图片
deletePic(event) {
this[`${event.name}`].splice(event.index, 1)
uploadedVideoChange(uploadList) {
this.videoArr = uploadList
},
afterRead(event) {
let that = this;
if (event.file.length > 0) {
event.file.map(item => {
uploadImage(item.url, img => {
that.uploadPictures.push({url: img})
})
})
}
uploadedPicChange(uploadList) {
this.picArr = uploadList
},
async submit() {
const expect = trim(this.expect),
product_score =
this.scoreList[0].index + 1 === 0 ? "" : this.scoreList[0].index + 1,
service_score =
this.scoreList[1].index + 1 === 0 ? "" : this.scoreList[1].index + 1;
const expect = trim(this.expect)
const product_score = this.scoreList[0].index + 1 === 0 ? "" : this.scoreList[0].index + 1
const service_score = this.scoreList[1].index + 1 === 0 ? "" : this.scoreList[1].index + 1
try {
await this.$validator({
product_score: [
required("请选择商品质量分数", {
type: "number"
required('请选择商品质量分数', {
type: 'number'
})
],
service_score: [
required("请选择服务态度分数", {
type: "number"
required('请选择服务态度分数', {
type: 'number'
})
]
}).validate({
product_score,
service_score
});
})
} catch (e) {
return validatorDefaultCatch(e);
return validatorDefaultCatch(e)
}
let temp = this.uploadPictures.map(item => item.url)
let pics = temp.join(",")
postOrderComment({
productScore: product_score,
serviceScore: service_score,
unique: this.unique,
pics,
comment: expect
pics: this.picArr.join(','),
comment: expect,
video: this.videoArr.join(',')
}).then(() => {
uni.showToast({
title: '评价成功',
icon: 'success',
duration: 2000
})
this.$yrouter.back()
}).catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: 'none',
duration: 2000
})
})
.then(() => {
uni.showToast({
title: "评价成功",
icon: "success",
duration: 2000
});
// ? 回跳到上一页
this.$yrouter.back();
// ? 默认跳转到详情页
// this.$yrouter.push({
// path: "/pages/order/OrderDetails/index",
// query: {
// id: this.orderCon.orderId
// }
// });
// ? 可选重定向到详情页,这时左上角会有一个返回首页的图标
// this.$yrouter.reLaunch({
// path: "/pages/home/index",
// });
})
.catch(err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
}
}
};
</script>
<style scoped lang="less">
.upload-title {
padding: 0 0 20rpx 16rpx;
.txt {
color: #999;
font-size: 22rpx;
}
}
.upload-wrapper {
position: relative;
padding: 0 0 0 16rpx;
.video-upload {
position: absolute;
top: 0;
left: 16rpx;
z-index: 5;
}
.pic-upload {
position: relative;
z-index: 2;
}
}
.evaluate-con .score .textarea .list .pictrue.uploadBnt {
border: 1px solid #ddd;
}
</style>
+441 -276
View File
@@ -1,309 +1,322 @@
<template>
<view class="productList" ref="container">
<view class="productList">
<form @submit.prevent="submitForm">
<view class="search bg-color-red acea-row row-between-wrapper">
<view class="search search-wrap acea-row row-between-wrapper">
<view class="input acea-row row-between-wrapper">
<text class="iconfont icon-sousuo"></text>
<input placeholder="搜索商品信息" v-model="where.keyword" confirm-type="search" @confirm="submitForm"/>
<view class="search-type-wrap" @click="toggleSearchType(true)">
{{ searchType === 'good' ? '商品' : '店铺' }}
<text class="d3"></text>
</view>
<input
v-model="query.keyword"
placeholder="请输入"
confirm-type="search"
class="inp"
@confirm="submitForm"
/>
<text class="iconfont icon-sousuo" @click="submitForm"></text>
</view>
<view
class="iconfont"
:class="Switch === true ? 'icon-pailie' : 'icon-tupianpailie'"
@click="switchTap"
></view>
</view>
</form>
<view class="nav acea-row row-middle">
<view
<view v-if="showSearchTypeLayer" class="search-type-layer">
<view class="layer" @click="toggleSearchType(false)" />
<view class="content">
<view
v-for="(item, index) in searchTypeList"
:key="index"
:class="item.value === searchType ? 'on' : ''"
class="item"
:class="title ? 'font-color-red' : ''"
@click="set_where(0)"
>{{ title ? title : "默认" }}
@click="searchTypeItemClick(item)"
>
{{ item.text }}
</view>
</view>
<view class="item" @click="set_where(1)">
价格
<image src="@/static/images/horn.png" v-if="price === 0"/>
<image src="@/static/images/up.png" v-if="price === 1"/>
<image src="@/static/images/down.png" v-if="price === 2"/>
</view>
<view class="item" @click="set_where(2)">
销量
<image src="@/static/images/horn.png" v-if="stock === 0"/>
<image src="@/static/images/up.png" v-if="stock === 1"/>
<image src="@/static/images/down.png" v-if="stock === 2"/>
</view>
<!-- down -->
<view class="item" :class="nows ? 'font-color-red' : ''" @click="set_where(3)">新品</view>
</view>
<view
class="list acea-row row-between-wrapper"
:class="Switch === true ? '' : 'on'"
ref="container"
v-if="searchType === 'good'"
class="nav acea-row row-middle"
>
<view
@click="goGoodsCon(item)"
<view class="item">
<text class="tag">
综合
</text>
</view>
<view class="item" @click="setQuery('priceOrder')">
价格
<image v-if="!query.priceOrder" src="@/static/images/horn.png" />
<image v-if="query.priceOrder === 'asc'" src="@/static/images/up.png" />
<image v-if="query.priceOrder === 'desc'" src="@/static/images/down.png" />
</view>
<view class="item" @click="setQuery('salesOrder')">
销量
<image v-if="!query.salesOrder" src="@/static/images/horn.png" />
<image v-if="query.salesOrder === 'asc'" src="@/static/images/up.png" />
<image v-if="query.salesOrder === 'desc'" src="@/static/images/down.png" />
</view>
</view>
<view v-if="searchType === 'good'">
<view class="list acea-row row-between-wrapper">
<view
v-for="(item, listIndex) in list"
:key="listIndex"
class="item"
:class="Switch === true ? '' : 'on'"
v-for="(item, productListIndex) in productList"
:key="productListIndex"
:title="item.storeName"
>
<view class="pictrue" :class="Switch === true ? '' : 'on'">
<image :src="item.image" :class="Switch === true ? '' : 'on'"/>
</view>
<view class="text" :class="Switch === true ? '' : 'on'">
<view class="name more-t">{{ item.storeName }}</view>
<view class="vip acea-row row-between-wrapper" :class="Switch === true ? '' : 'on'">
<view class="flex ai-end">
<view class="money" :class="Switch === true ? '' : 'on'">
<text class="num" v-if="item.vipPrice && item.vipPrice>0">{{ force2Decimal(item.vipPrice) }}</text>
<text class="num" v-else>{{ force2Decimal(item.price) }}</text>
@click="goGoodsCon(item.id)"
>
<view class="pictrue">
<image :src="item.image"/>
</view>
<view class="text">
<view class="name more-t">{{ item.storeName }}</view>
<view class="vip acea-row row-between-wrapper">
<view class="flex ai-end">
<view class="money">
<text class="num" v-if="item.vipPrice && item.vipPrice > 0">{{ force2Decimal(item.vipPrice) }}</text>
<text class="num" v-else>{{ force2Decimal(item.price) }}</text>
</view>
<view class="vip-money">{{ force2Decimal(item.otPrice) }}</view>
</view>
<view class="vip-money">{{ force2Decimal(item.otPrice) }}</view>
<view class="sale">已售{{ item.sales }}</view>
</view>
<view class="sale">已售{{ item.sales }}</view>
</view>
</view>
</view>
<goo-skeleton
v-if="loading"
:show-avatar="false"
/>
<!-- <u-loadmore
v-if="loadend && list.length > 0"
:line="true"
status="nomore"
nomore-text="到底了"
/> -->
</view>
<view v-else>
<view
:class="list.length > 0 ? '' : 'no-hotel'"
class="hotel-wrap"
>
<view class="list">
<view
v-for="(item, index) in list"
:key="index"
class="hotel-item"
>
<view class="hotel-item-main" @click="hotelItemClick(item)">
<image :src="item.logo" class="logo" />
<view class="info">
<view class="name one-t">
{{ item.name }}
</view>
<view class="type">
<view v-if="item.typeName" class="type-tag">
{{ item.typeName }}
</view>
<view v-else>&nbsp;</view>
</view>
<view class="desc">
<view class="tip one-t">
{{ item.tips || ' ' }}
</view>
<view class="btn">进店</view>
</view>
</view>
</view>
<view v-if="item.products" class="good-list">
<view
v-for="(good) in item.products"
:key="good.productId"
class="good-item"
@click="goGoodsCon(good.productId)"
>
<image :src="good.productImage" class="img" />
<view class="price">
<text class="txt"></text>
{{ force2Decimal(good.productPrice) }}
</view>
</view>
</view>
</view>
</view>
<goo-skeleton
v-if="loading"
/>
<!-- <u-loadmore
v-if="loadend && list.length > 0"
:line="true"
status="nomore"
nomore-text="到底了"
/> -->
</view>
</view>
<view
v-if="list.length === 0 && query.page > 1"
:class="'no-data-wrap-' + searchType"
class="no-data-wrap"
>
<no-good-data :type="searchType"/>
<recommend
v-if="searchType === 'good' && loadend && list.length === 0"
/>
</view>
<no-good-data v-if="productList.length === 0 && where.page > 1" />
<Recommend v-if="productList.length === 0 && where.page > 1"></Recommend>
</view>
</template>
<script>
import Recommend from "@/components/Recommend";
import {getProducts} from "@/api/store";
import {mapGetters} from 'vuex';
import NP from "number-precision";
import { getProducts, getHotels } from '@/api/store'
import { mapGetters } from 'vuex'
import NP from 'number-precision'
import NoGoodData from '@/components/good/NoData'
import Recommend from '@/components/Recommend'
export default {
name: "GoodsList",
name: 'GoodsList',
components: {
Recommend,
NoGoodData
NoGoodData,
Recommend
},
props: {},
computed: mapGetters(["userInfo"]),
data: function () {
// const { s = "", id = 0, title = "" } = this.$yroute.query;
const s = "",
id = 0,
title = "";
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
hostProduct: [],
productList: [],
Switch: true,
where: {
list: [],
query: {
page: 1,
limit: 8,
keyword: s,
sid: id, //二级分类id
news: 0,
priceOrder: "",
salesOrder: ""
limit: 10,
keyword: '',
priceOrder: '',
salesOrder: ''
},
title: title && id ? title : "",
loadTitle: "",
loading: false,
loadend: false,
price: 0,
stock: 0,
nows: false
};
},
watch: {
title() {
this.updateTitle();
},
$yroute(to) {
// if (to.name !== "GoodsList") return;
// const { s = "", id = 0, title = "" } = to.query;
// if (s !== this.where.keyword || id !== this.where.sid) {
// this.where.keyword = s;
// this.loadend = false;
// this.loading = false;
// this.where.page = 1;
// this.where.sid = id;
// this.title = title && id ? title : "";
// this.nows = false;
// this.$set(this, "productList", []);
// this.price = 0;
// this.stock = 0;
// this.get_product_list();
// }
searchTypeList: Object.freeze([
{ text: '商品', value: 'good' },
{ text: '店铺', value: 'hotel' }
]),
searchType: 'good',
showSearchTypeLayer: false
}
},
onLoad: function (e) {
const {s = "", id = 0, title = ""} = this.$yroute.query;
if (s !== this.where.keyword || id !== this.where.sid) {
this.where.keyword = s;
this.loadend = false;
this.loading = false;
this.where.page = 1;
this.where.sid = id;
this.title = title && id ? title : "";
this.nows = false;
this.$set(this, "productList", []);
this.price = 0;
this.stock = 0;
// this.get_product_list();
}
this.updateTitle();
this.get_product_list();
},
mounted: function () {
// const { s = "", id = 0, title = "" } = this.$yroute.query;
// this.updateTitle();
// this.get_product_list();
computed: mapGetters(['userInfo']),
onLoad(e) {
const { s = '' } = this.$yroute.query
this.query.keyword = s
this.getList()
},
onReachBottom() {
!this.loading && this.get_product_list();
},
onHide() {
// this.hostProduct = [];
// this.productList = [];
// this.Switch = true;
// this.where = {
// page: 1,
// limit: 8,
// keyword: s,
// sid: id, //二级分类id
// news: 0,
// priceOrder: "",
// salesOrder: ""
// };
// this.loadTitle = "";
// this.loading = false;
// this.loadend = false;
// this.price = 0;
// this.stock = 0;
// this.nows = fals;
!this.loading && this.getList()
},
methods: {
toggleSearchType(value) {
this.showSearchTypeLayer = value
},
searchTypeItemClick(item) {
if (item.value === this.searchType) {
return
}
this.searchType = item.value
this.toggleSearchType(false)
this.submitForm()
},
force2Decimal(price) {
return this.$force2Decimal(price);
},
goGoodsCon(item) {
goGoodsCon(id) {
this.$yrouter.push({
path: "/pages/shop/GoodsCon/index",
query: {id: item.id}
});
path: '/pages/shop/GoodsCon/index',
query: { id }
})
},
updateTitle() {
// document.title = this.title || this.$yroute.meta.title;
hotelItemClick(item) {
this.$yrouter.push({
path: '/pagesInn/inn/innHome',
query: {
id: item.id
}
})
},
get_product_list() {
var that = this;
this.setWhere();
// if (to.name !== "GoodsList") return;
// const { s = "", id = 0, title = "" } = this.$yroute.query;
// if (s !== this.where.keyword || id !== this.where.sid) {
// this.where.keyword = s;
// this.loadend = false;
// this.loading = false;
// this.where.page = 1;
// this.where.sid = id;
// this.title = title && id ? title : "";
// this.nows = false;
// this.$set(this, "productList", []);
// this.price = 0;
// this.stock = 0;
// // this.get_product_list();
// }
let q = that.where;
getProducts(q).then(res => {
that.loading = false;
//that.productList.push.apply(that.productList, res.data);
that.productList.push.apply(that.productList, res.data.map((item) => {
//如果已经登录获取用户信息
if (that.$store.getters.token && that.userInfo) {
var p = NP.times(item.price, NP.divide(parseFloat(that.userInfo.discount), 100))
item.vipPrice = p;
}
return item;
}));
that.loadend = res.data.length < that.where.limit; //判断所有数据是否加载完成;
that.where.page = that.where.page + 1;
});
},
submitForm: function () {
this.$set(this, "productList", []);
this.where.page = 1;
this.loadend = false;
this.loading = false;
this.get_product_list();
},
//点击事件处理
set_where: function (index) {
let that = this;
switch (index) {
case 0:
// return that.$yrouter.push({path: "/pages/shop/GoodsClass/index"});
that.nows = false;
that.price = 0;
that.stock = 0;
break;
case 1:
if (that.price === 0) that.price = 1;
else if (that.price === 1) that.price = 2;
else if (that.price === 2) that.price = 0;
that.stock = 0;
break;
case 2:
if (that.stock === 0) that.stock = 1;
else if (that.stock === 1) that.stock = 2;
else if (that.stock === 2) that.stock = 0;
that.price = 0;
break;
case 3:
that.nows = !that.nows;
break;
default:
break;
getList() {
if (this.loading || this.loadend) {
return
}
that.$set(that, "productList", []);
that.where.page = 1;
that.loadend = false;
that.get_product_list();
},
//设置where条件
setWhere: function () {
let that = this;
if (that.price === 0) {
that.where.priceOrder = "";
} else if (that.price === 1) {
that.where.priceOrder = "asc";
} else if (that.price === 2) {
that.where.priceOrder = "desc";
let reqFn = null
if (this.searchType === 'good') {
reqFn = getProducts
} else {
reqFn = getHotels
}
if (that.stock === 0) {
that.where.salesOrder = "";
} else if (that.stock === 1) {
that.where.salesOrder = "asc";
} else if (that.stock === 2) {
that.where.salesOrder = "desc";
}
that.where.news = that.nows ? "1" : "0";
this.loading = true
reqFn(this.query).then(res => {
const { success, data } = res
if (success) {
this.loading = false
this.list.push.apply(this.list, data.map((item) => {
if (this.searchType === 'good') {
// 如果已经登录获取用户信息
if (this.$store.getters.token && this.userInfo) {
const p = NP.times(item.price, NP.divide(parseFloat(this.userInfo.discount), 100))
item.vipPrice = p
}
}
return item
}))
// 判断所有数据是否加载完成
this.loadend = data.length < this.query.limit
this.query.page++
}
}).catch(() => {
this.loading = false
})
},
switchTap: function () {
let that = this;
that.Switch = !that.Switch;
submitForm() {
this.$set(this, 'list', [])
this.query.page = 1
this.loadend = false
this.loading = false
this.getList()
},
setQuery(key) {
const value = this.query[key]
if (!value) {
this.query[key] = 'asc'
} else if (value === 'asc') {
this.query[key] = 'desc'
} else {
this.query[key] = ''
}
if (key === 'priceOrder') {
this.query.salesOrder = ''
}
if (key === 'salesOrder') {
this.query.priceOrder = ''
}
this.submitForm()
}
}
};
</script>
<style scoped lang="less">
.productList {
min-height: 100vh;
background-color: #f7f7f7;
.list {
margin: 0;
padding: 172rpx 20rpx 0 20rpx;
}
.no-hotel {
padding: 0;
}
.no-data-wrap {
position: relative;
min-height: calc(100vh - 172rpx);
background-color: #fff;
}
.no-data-wrap-hotel {
min-height: calc(100vh - 86rpx);
}
}
.noCommodity {
display: flex;
justify-content: center;
@@ -343,33 +356,185 @@ export default {
}
}
}
.list.on {
padding: 0 32rpx;
background: none;
.item {
box-sizing: border-box;
margin-top: 24rpx;
padding: 24rpx 22rpx;
border-bottom: none;
.pictrue {
width: 136rpx !important;
height: 136rpx !important;
.search-type-layer {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 9999;
.layer {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
background-color: rgba(0, 0, 0, 0.5);
}
.content {
position: absolute;
top: 80rpx;
left: 23rpx;
z-index: 5;
width: 70px;
padding: 10rpx 20rpx;
border-radius: 4px;
background-color: #fff;
.item + .item {
border-top: 1px solid #eee;
}
.text {
display: flex;
flex-direction: column;
justify-content: space-between;
.money {
margin-top: 0;
.item {
text-align: center;
line-height: 40px;
font-size: 16px;
color: #333;
&.on {
color: #E92727;
}
.vip-money {
margin-left: 8rpx;
}
}
}
.search-wrap {
background-color: #fff;
.input {
height: 36px;
border-radius: 18px;
margin: 0;
background-color: #f6f6f6;
.search-type-wrap {
display: flex;
align-items: center;
padding: 0 20rpx 0 0;
border-right: 1px solid #ddd;
color: #999;
font-size: 26rpx;
.d3 {
width: 0;
height: 0;
margin: 0 0 -6px 4px;
border-width: 5px;
border-style: solid;
border-color: #999 transparent transparent transparent;
}
}
.inp {
flex: 1;
padding: 0 0 0 20rpx;
}
.iconfont {
color: #E92727;
}
}
}
.nav {
.item {
width: 33.3333%;
.tag {
display: inline-block;
width: 72px;
height: 28px;
border-radius: 15px;
border: 1px solid #E92727;
color: #E92727;
text-align: center;
line-height: 28px;
}
}
}
.hotel-wrap {
padding: 0 0 23rpx 0;
.list {
padding-top: 86rpx;
background-color: #f7f7f7;
}
}
.hotel-item {
padding: 15rpx;
margin: 23rpx 0 0 0;
border-radius: 4px;
background-color: #fff;
box-shadow: 0px 3px 6px rgba(0,0,0,0.16);
.hotel-item-main {
display: flex;
justify-content: center;
}
.logo {
display: block;
width: 136rpx;
height: 136rpx;
border-radius: 6px;
}
.info {
width: calc(100% - 160rpx);
padding: 0 0 0 20rpx;
.name {
font-size: 16px;
color: #333;
font-weight: bold;
}
.type {
display: flex;
margin: 10rpx 0 0 0;
.type-tag {
padding: 2px 6px;
border-radius: 3px;
font-size: 12px;
color: #946300;
background: linear-gradient(to bottom, #FDF8B9, #E3A72C);
}
}
.desc {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 14px;
.tip {
flex: 1;
width: calc(100% - 120rpx);
color: #999;
}
.btn {
padding: 0 15px;
height: 28px;
border-radius: 14px;
color: #fff;
line-height: 28px;
background-color: #C51919;
}
}
}
.good-list {
display: flex;
justify-content: flex-start;
flex-wrap: nowrap;
padding: 23rpx 0 0 0;
overflow-x: auto;
.good-item + .good-item {
margin: 0 0 0 15rpx;
}
.good-item {
position: relative;
.img {
display: block;
width: 210rpx;
height: 210rpx;
border-radius: 6px;
}
.price {
position: absolute;
bottom: 20rpx;
left: 50%;
padding: 8rpx 20rpx;
border-radius: 23rpx;
line-height: 30rpx;
font-size: 28rpx;
color: #333;
background-color: #fff;
transform: translateX(-50%);
.txt {
font-size: 22rpx;
}
}
}
}
+366
View File
@@ -0,0 +1,366 @@
<template>
<view class="point-page">
<view v-if="isLoad">
<view class="rule-btn" @click="showHidePopup(true)">
积分规则
</view>
<view class="tab-wrap">
<view
:class="query.pm === 1 ? 'curr' : ''"
class="tab-item"
@click="tabItemClick(1)"
>
<view class="txt">当前总积分</view>
<view class="number">
<image
v-if="query.pm === 1"
:src="webUrl + '/page/my/coin.png'"
class="icon"
/>
{{ point.currentPoints }}
</view>
</view>
<view
:class="query.pm === 0 ? 'curr' : ''"
class="tab-item"
@click="tabItemClick(0)"
>
<view class="txt">已使用积分</view>
<view class="number">
<image
v-if="query.pm === 0"
:src="webUrl + '/page/my/coin.png'"
class="icon"
/>
{{ point.totalUsedPoints }}
</view>
</view>
</view>
<view class="list-wrap">
<view
v-for="(item, index) in list"
:key="index"
class="item"
>
<view v-if="item.orderId" class="order">
<view class="title">
<view class="img">
<image :src="item.image" class="img" />
</view>
<view class="name more-t">
<view class="more-t">
{{ item.title }}
</view>
<view
:class="item.pm ? 'red' : 'green'"
class="number"
>
{{ item.pm ? '+' : '-' }}{{ item.number }}
<text class="txt">积分</text>
</view>
</view>
</view>
<view class="bottom" @click="goOrderDetails(item)">
<view class="txt">
点击查看详情 >>
</view>
<text class="iconfont icon-jiantou"></text>
</view>
</view>
<view v-else class="lottery">
<image :src="webUrl + '/points-lottery.png'" class="img" />
<view class="one-t title">
{{ item.title }}
</view>
<view
:class="item.pm ? 'red' : 'green'"
class="number"
>
{{ item.pm ? '+' : '-' }}{{ item.number }}
<text class="txt">积分</text>
</view>
</view>
</view>
<goo-skeleton
v-if="isLoading"
:show-avatar="false"
/>
<view v-else>
<view v-if="list.length === 0" class="no-data">
暂无数据
</view>
<u-loadmore
v-if="query.page >= totalPage && list.length > 0"
:line="true"
status="nomore"
nomore-text="到底了"
/>
</view>
</view>
</view>
<goo-skeleton
v-else
:show-avatar="false"
/>
<u-popup
:show="show"
mode="center"
round="10"
closeable
@close="showHidePopup(false)"
>
<view class="popup-body">
<view class="title bold">积分规则</view>
<view class="content">
<view class="content-html">
<rich-text :nodes="point.pointsRule" />
</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import {
getUserPointInfo,
getUserPointBill
} from '@/api/user'
export default {
name: 'UserPoints',
props: {},
data: function() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
query: {
pm: 1, // 0-支出,1-收入
page: 1,
limit: 10
},
isLoading: false,
list: [],
totalPage: 1,
isLoad: false,
point: {
currentPoints: 0, // 当前总积分
totalUsedPoints: 0, // 累计使用积分
pointsRule: ''
},
show: false
}
},
created() {
this.getInfo()
},
onReachBottom() {
if (this.isLoading || this.query.page >= this.totalPage) {
return
}
this.query.page++
this.getList()
},
methods: {
tabItemClick(type) {
if (this.query.pm === type) {
return
}
this.query.pm = type
this.query.page = 1
this.list = []
this.getList()
},
getInfo() {
getUserPointInfo().then(res => {
const { success, data } = res
if (success) {
this.isLoad = true
this.point = data
this.getList()
}
})
},
getList() {
this.isLoading = true
getUserPointBill(this.query).then(res => {
const { success, data } = res
if (success) {
this.totalPage = data.pages || 1
if (data.records.length > 0) {
data.records.map(item => {
this.list.push(item)
})
}
}
}).finally(() => {
this.isLoading = false
})
},
goOrderDetails(order) {
this.$yrouter.push({
path: '/pages/order/OrderDetails/index',
query: {
id: order.orderId
}
})
},
showHidePopup(value) {
this.show = value
}
}
}
</script>
<style lang="less" scoped>
.point-page {
padding: 30rpx;
.rule-btn {
position: fixed;
right: 0;
top: 255rpx;
z-index: 9;
height: 24rpx;
padding: 20rpx 30rpx 20rpx 40rpx;
border-top-left-radius: 35rpx;
border-bottom-left-radius: 35rpx;
color: #fff;
font-size: 14px;
line-height: 24rpx;
background-color: #C51919;
}
.tab-wrap {
display: flex;
align-items: center;
.tab-item {
flex: 1;
justify-content: center;
padding: 20rpx;
border-radius: 15rpx;
background-color: #fff;
.txt {
width: 100px;
height: 36px;
padding: 0 20rpx;
margin: 0 auto;
border-radius: 4px;
border: 1px solid #C51919;
line-height: 36px;
text-align: center;
color: #C51919;
font-size: 16px;
}
.number {
display: flex;
justify-content: center;
align-items: center;
margin: 20rpx 0 0 0;
font-size: 20px;
color: #333;
font-weight: bold;
line-height: 26px;
.icon {
width: 40rpx;
height: 40rpx;
margin: 0 20rpx 0 0;
}
}
&.curr {
padding: 35rpx 20rpx;
background-color: #C51919;
.txt {
border-color: #fff;
color: #fff;
}
.number {
font-size: 26px;
color: #fff;
}
}
}
}
.list-wrap {
padding: 60rpx 0 0 0;
.item {
margin: 30rpx 0 0 0;
border-radius: 8px;
background-color: #fff;
.order {
.title {
display: flex;
padding: 20rpx;
.img {
display: block;
width: 120rpx;
height: 120rpx;
margin: 0 20rpx 0 0;
background-color: #f6f6f6;
}
.name {
width: calc(100% - 140rpx);
color: #333;
}
}
.bottom {
display: flex;
padding: 20rpx;
border-top: 1rpx solid #f6f6f6;
font-size: 12px;
color: #666;
.txt {
flex: 1;
color: #FD5749;
}
.iconfont {
font-size: 14px;
}
}
}
.lottery {
display: flex;
align-items: center;
padding: 20rpx;
.img {
display: block;
width: 62rpx;
height: 62rpx;
margin: 0 20rpx 0 0;
}
.title {
flex: 1;
}
}
.number {
text-align: right;
font-size: 18px;
font-weight: bold;
.txt {
font-size: 12px;
}
&.red {
color: #FD5749;
}
&.green {
color: #3DC260;
}
}
}
}
.no-data {
line-height: 200rpx;
text-align: center;
font-size: 16px;
color: #999;
}
.popup-body {
.title {
line-height: 80rpx;
text-align: center;
}
.content {
padding: 0 30rpx 30rpx 30rpx;
.content-html {
max-height: 70vh;
overflow-y: auto;
}
}
}
}
</style>
+1 -1
View File
@@ -57,7 +57,7 @@
余额
</view>
</view>
<view class="item">
<view class="item" @click="linkTo('/pages/user/Points/index')">
<view class="number">
{{ userInfo.integral || 0 }}
</view>
@@ -111,3 +111,10 @@ export default {
}
};
</script>
<style scoped lang="less">
.promoterHeader {
.headerCon {
box-sizing: border-box;
}
}
</style>
+1 -1
View File
@@ -216,7 +216,7 @@
<script>
import CitySelect from "@/components/CitySelect";
import tmUpload from '@/pagesInn/components/tm-upload/tm-upload.vue';
import tmUpload from '@/components/tm-upload/tm-upload.vue';
import {getCity} from "@/api/user";
import {chooseImage, isWeixin} from "@/utils";
import {getHomeData} from "@/api/public";
+1 -3
View File
@@ -55,12 +55,10 @@ import {
getHotelGoodList
} from "@/api/inn.js";
import imgBox from '@/components/imageTypeSet/imagebox.vue'
import GooSkeleton from '@/components/GooSkeleton/index.vue'
export default {
components: {
imgBox,
GooSkeleton
imgBox
},
data() {
return {
+18 -17
View File
@@ -117,7 +117,7 @@
<view class="map-info-hd">
<image :src="webUrl + '/page/hotel/icon-location.png'" class="icon" />
</view>
<view class="map-info-bd">
<view class="map-info-bd more-t">
{{ inn.address }}
</view>
<view class="map-info-ft flex">
@@ -217,10 +217,10 @@
class="info-item-header"
@click="infoClick(item)"
>
<view class="name one-t">
<view class="name">
{{ item.name }}
</view>
<view class="intro more-t">
<view class="intro">
{{ item.intro }}
</view>
</view>
@@ -428,12 +428,10 @@ import {getUrlParam} from "@/utils/common.js"
import imgBox from '@/components/imageTypeSet/imagebox.vue'
import cookie from "@/utils/store/cookie"
import {addStore, removeStore} from "@/api/favorite"
import GooSkeleton from '@/components/GooSkeleton/index.vue'
export default {
components: {
imgBox,
GooSkeleton
imgBox
},
data() {
return {
@@ -506,10 +504,9 @@ export default {
if (!this.isLoad) {
return
}
if (this.inn.hasProduct > 0) {
this.fetchGoods()
if (uni.getStorageSync('hotelInfoPublish') === '1') {
this.fetchInnInfoList()
}
this.fetchInnInfoList()
this.fetchInnDetail()
},
methods: {
@@ -657,6 +654,7 @@ export default {
_this.isLoadInfoListSuccess = false
_this.loading = true
_this.infoArray = []
uni.removeStorageSync('hotelInfoPublish')
getHotelNewsList({
page: 1,
limit: 9999,
@@ -688,19 +686,21 @@ export default {
reqFn(_this.id).then((res) => {
const { success, data } = res
if (success) {
_this.isLoad = true
_this.inn = data
_this.isLike = data.zanVo !== null
_this.isFavorite = data.hasFavorite
_this.favoriteCount = data.favoriteCount
_this.inn.latitude = _this.inn.latitude ? parseFloat(_this.inn.latitude) : 24.993587
_this.inn.longitude = _this.inn.longitude ? parseFloat(_this.inn.longitude) : 102.779656
// 该店铺无商品则不显示“精选商品”
if (data.hasProduct <= 0) {
_this.activeIndex = 1
_this.tabList[0].isShow = false
} else {
_this.fetchGoods()
// fix bug#1107
if (!_this.isLoad) {
// 该店铺无商品则不显示“精选商品”
if (data.hasProduct <= 0) {
_this.activeIndex = 1
_this.tabList[0].isShow = false
} else {
_this.fetchGoods()
}
}
// coverType: 1-图片,2-视频
if (data.coverType === 2) {
@@ -739,6 +739,7 @@ export default {
})
*/
}
_this.isLoad = true
}
}).finally(() => {
uni.stopPullDownRefresh()
@@ -1030,7 +1031,7 @@ export default {
z-index: 1;
.bg-color {
position: absolute;
top: 0;
top: -5px;
left: 0;
right: 0;
z-index: 1;
+3 -1
View File
@@ -65,7 +65,7 @@
</template>
<script>
import tmUpload from '@/pagesInn/components/tm-upload/tm-upload.vue'
import tmUpload from '@/components/tm-upload/tm-upload.vue'
import {
VUE_APP_API_URL
} from '@/config'
@@ -162,6 +162,8 @@
this.$dialog.toast({
mes: '发布成功!'
})
// 写入缓存,返回至商户主页时监听用于刷新资讯列表
uni.setStorageSync('hotelInfoPublish', '1')
setTimeout(() => {
this.$yrouter.back()
}, 3000)
+31 -5
View File
@@ -34,6 +34,30 @@
</view>
<text class="iconfont icon-jiantou"></text>
</view>
<view class="item is_required">
<view class="cell acea-row row-between row-middle">
<view class="cell-title">封面类型</view>
<view>
<u-radio-group
v-model="innApplyInfo.coverType"
placement="row"
>
<u-radio
:name="1"
:customStyle="{marginRight: '16px'}"
active-color="red"
label="图片"
/>
<u-radio
:name="2"
active-color="red"
label="视频"
/>
</u-radio-group>
</view>
</view>
<text class="iconfont icon-jiantou"></text>
</view>
<view v-if="innApplyInfo.coverType === 1" class="item is_required" @click="chooseCoverImg()">
<view class="cell acea-row row-between row-middle">
<view class="cell-title">封面照片</view>
@@ -112,7 +136,7 @@
</view>
</view>
</view> -->
<view class="item">
<view v-if="picsArray.length > 0" class="item">
<view class="img-upload">
<tm-upload
:dataList="picsArray"
@@ -131,7 +155,7 @@
<script>
import CitySelect from '@/components/CitySelect'
import tmUpload from '@/pagesInn/components/tm-upload/tm-upload.vue'
import tmUpload from '@/components/tm-upload/tm-upload.vue'
import {
chooseImage,
chooseVideoToUpload
@@ -193,12 +217,13 @@ export default {
this.innApplyInfo.coverVideo = ''
}
// 图片填充
this.picsArray = hotel.pics.map(function (item) {
this.picsArray = hotel.pics.map(item => {
return {
path: item,
upload_percent: 100
}
})
this.uploadedFilesArray = hotel.pics || []
}
},
methods: {
@@ -249,6 +274,7 @@ export default {
chooseLogoVideo() {
chooseVideoToUpload(path => {
this.$set(this.innApplyInfo, 'coverVideo', path)
this.$forceUpdate()
})
},
chooseCoverImg() {
@@ -329,8 +355,8 @@ export default {
height: 64rpx;
}
.video-item {
width: 64rpx;
height: 64rpx;
width: 120rpx;
height: 120rpx;
}
.inp-textarea {
width: 100%;
+1 -1
View File
@@ -80,7 +80,7 @@ export default {
this.page++
this.fetchList()
},
async takeItem(item) {
async takeItem(item, index) {
// 领取商品
if (item['prizeType'] === 1 && item['status'] === 1) {
uni.navigateTo({
+29 -17
View File
@@ -169,7 +169,7 @@
<text class="required">*</text>
</template>
<template #value>
<u-input v-model="form.contact" border="none" placeholder="请填写联系方式"/>
<u-input v-model="form.contact" border="none" placeholder="请填写姓名"/>
</template>
</u-cell>
</u-form-item>
@@ -191,22 +191,25 @@
<text class="required">*</text>
</template>
<template #value>
<u-input v-model="form.captcha" border="none" placeholder="请填写验证码">
<template slot="suffix">
<view class="captcha-wrap">
<view class="captcha-wrap-input">
<u-input v-model="form.captcha" border="none" placeholder="请填写验证码" />
</view>
<view class="captcha-wrap-ft">
<u-code
ref="uCode"
@change="codeChange"
seconds="30"
changeText="X秒重新获取"
></u-code>
ref="uCode"
seconds="30"
changeText="X秒重新获取"
@change="codeChange"
/>
<u-button
@tap="getCode"
:text="tips"
type="success"
size="normal"
></u-button>
</template>
</u-input>
:text="tips"
type="success"
size="normal"
@tap="getCode"
/>
</view>
</view>
</template>
</u-cell>
</u-form-item>
@@ -265,7 +268,8 @@
</view>
</u-form-item>
<u-form-item prop="desc">
<view style="height: 100rpx;width: 100%;"></view>
<!-- <u-form-item prop="desc">
<view class="content-section">
<u-cell title="店铺简介" :border="false">
<template #label>
@@ -275,7 +279,7 @@
</template>
</u-cell>
</view>
</u-form-item>
</u-form-item> -->
</u-cell-group>
<view class="btn-submit btn-remove" v-if="reviewStatus===0 && isDraft!==1" @click="changeRemove(true)">撤销申请</view>
@@ -541,6 +545,7 @@ export default {
chooseLogoVideo() {
chooseVideoToUpload(path => {
this.form.coverVideo = path
this.$forceUpdate()
})
},
@@ -735,4 +740,11 @@ export default {
width: 80px;
height: 80px;
}
.captcha-wrap {
display: flex;
align-items: center;
.captcha-wrap-input {
flex: 1;
}
}
</style>
+89 -9
View File
@@ -189,8 +189,32 @@
</template>
</u-cell>
</u-form-item>
<u-form-item prop="cover">
<u-form-item prop="coverType">
<u-cell title="封面类型" :border="false">
<template #icon>
<text class="required">*</text>
</template>
<template #value>
<u-radio-group
v-model="form.coverType"
placement="row"
>
<u-radio
:name="1"
:customStyle="{marginRight: '16px'}"
active-color="red"
label="图片"
/>
<u-radio
:name="2"
active-color="red"
label="视频"
/>
</u-radio-group>
</template>
</u-cell>
</u-form-item>
<u-form-item v-if="form.coverType === 1" prop="cover">
<u-cell title="店铺封面图" :border="false">
<template #icon>
<text class="required">*</text>
@@ -205,6 +229,31 @@
</template>
</u-cell>
</u-form-item>
<u-form-item v-if="form.coverType === 2" prop="coverVideo">
<u-cell title="店铺视频封面" :border="false">
<template #icon>
<text class="required">*</text>
</template>
</u-cell>
<u-cell :border="false">
<template #title>
<view class="box-upload" @click="chooseLogoVideo()">
<view
v-if="!form.coverVideo"
class="btn-upload"
>上传视频</view>
<video
v-else
:src="form.coverVideo"
:poster="form.coverVideo + '?vframe/jpg/offset/1'"
:controls="false"
play-btn-position="center"
class="video-item"
/>
</view>
</template>
</u-cell>
</u-form-item>
<u-form-item prop="pics">
<u-cell title="店铺图片" :border="false">
@@ -258,7 +307,7 @@
<text class="required">*</text>
</template>
<template #value>
<u-input v-model="form.contact" border="none" placeholder="请填写联系方式"/>
<u-input v-model="form.contact" border="none" placeholder="请填写联系人姓名"/>
</template>
</u-cell>
</u-form-item>
@@ -328,7 +377,7 @@
</view>
</u-form-item>
<u-form-item prop="desc">
<!-- <u-form-item prop="desc">
<view class="content-section">
<u-cell title="店铺简介" :border="false">
<template #label>
@@ -338,7 +387,9 @@
</template>
</u-cell>
</view>
</u-form-item>
</u-form-item> -->
<view style="height: 100rpx;width: 100%;"></view>
</u-cell-group>
<view class="btn-submit btn-remove" v-if="reviewStatus===0 && isDraft!==1" @click="changeRemove(true)">撤销申请
@@ -352,7 +403,9 @@
<u-popup :show="show" mode="center" round="10" closeable @close="show=false">
<view class="popup-body">
<view class="tc bold">入驻申请须知</view>
<view class="content" v-html="notice"></view>
<view class="content">
<rich-text :nodes="notice" />
</view>
<view class="agree-box">
<checkbox-group @change="changeAgree">
<label>
@@ -371,7 +424,12 @@
import CitySelect from "@/components/CitySelect";
import {getShopData, getShopInfo, removeApply, saveSupplier, saveWenwanSupplier} from "@/api/join";
import {getCity, registerVerify} from "@/api/user";
import {chooseImage, moreImage, uploadImage} from "@/utils";
import {
chooseImage,
moreImage,
uploadImage,
chooseVideoToUpload
} from "@/utils"
export default {
name: "pkgJoinSupplier",
@@ -401,6 +459,8 @@ export default {
form: {
name: "",
cover: "",
coverVideo: '',
coverType: 1, // coverType: 1-图片,2-视频
logo: "",
type: 0,
typeText: "",
@@ -479,6 +539,12 @@ export default {
message: '请上传店铺封面图',
trigger: ['blur', 'change']
},
'coverVideo': {
type: 'string',
required: true,
message: '请上传店铺视频方面',
trigger: ['blur', 'change']
},
'logo': {
type: 'string',
required: true,
@@ -646,6 +712,10 @@ export default {
this.form.typeText = this.columnsType[0][this.indexType].name;
this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6);
this.form.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}`;
if (data.hotelInfo.coverType === 2) {
this.form.coverVideo = data.hotelInfo.cover
this.form.cover = ''
}
}
if (data.supplierInfo) {
@@ -679,6 +749,12 @@ export default {
}
});
},
chooseLogoVideo() {
chooseVideoToUpload(path => {
this.form.coverVideo = path
this.$forceUpdate()
})
},
chooseShopImg() {
let that = this;
@@ -837,9 +913,13 @@ export default {
this.quaPics.map(item => {
this.formSupplier.qualification += (item.url + ",");
})
const postData = Object.assign({}, this.form)
if (postData.coverType === 2) {
postData.cover = postData.coverVideo
}
if (this.infoTitle === "特产") {
saveSupplier(this.form, this.formSupplier, this.partnerId).then(res => {
saveSupplier(postData, this.formSupplier, this.partnerId).then(res => {
if (res.status === 200) {
uni.showToast({
title: "您的入驻申请已提交成功,请耐心等待审核",
@@ -860,7 +940,7 @@ export default {
})
})
} else {
saveWenwanSupplier(this.form, this.formSupplier, this.partnerId).then(res => {
saveWenwanSupplier(postData, this.formSupplier, this.partnerId).then(res => {
if (res.status === 200) {
uni.showToast({
title: "您的入驻申请已提交成功,请耐心等待审核",
+3 -1
View File
@@ -134,7 +134,9 @@
<u-popup :show="show" mode="center" round="10" closeable @close="show=false">
<view class="popup-body">
<view class="tc bold">入驻申请须知</view>
<view class="content" v-html="notice"></view>
<view class="content">
<rich-text :nodes="notice" />
</view>
<view class="agree-box">
<checkbox-group @change="changeAgree">
<label>
-4
View File
@@ -46,12 +46,8 @@
<script>
// 节日专题
import { getFestival } from '@/api/product'
import GooSkeleton from '@/components/GooSkeleton/index.vue'
export default {
name: 'Festival',
components: {
GooSkeleton
},
data() {
return {
isLoad: false,
+1 -1
View File
@@ -2,7 +2,7 @@
<view class="pkg-product-list">
<view class="first-half">
<view class="search-box flex jc-between ai-center">
<input type="text" v-model="keyword" placeholder="搜索商品" placeholder-style="color:#949494" @confirm="search">
<input type="text" v-model="keyword" placeholder="搜索内容" placeholder-style="color:#949494" @confirm="search">
<image class="icon" :src="webUrl+'/20220903142935869059.png'" mode="scaleToFill" @click="search"></image>
</view>
+9 -1
View File
@@ -31,6 +31,14 @@ export default {
<template>
<view class="pkg-product-homestay">
<hx-navbar
:fixed="true"
:background-color="[[13,197,197],[13,197,197]]"
statusBarFontColor="#ffffff"
barPlaceholder="hidden"
transparent="auto"
color='#ffffff'
/>
<image class="top-img" mode="widthFix" :src="topImage" v-if="topImage"/>
<view class="section" v-for="(content,cIndex) in contents" :key="cIndex">
@@ -77,7 +85,7 @@ export default {
position: absolute;
top: 350rpx;
left: 0;
width: 100vw;
right: 0;
}
.span24 {
+1
View File
@@ -193,6 +193,7 @@ export default {
}
.img-top {
display: block;
width: 100vw;
}
+25 -20
View File
@@ -126,11 +126,13 @@
<view class="sale flex ai-center">已抢{{ item.sales }}</view>
<view class="btn">立即抢购</view>
</view> -->
<view class="number flex">
<view class="bg">
已抢{{ item.sales }}
<view class="number-wrap">
<view class="number flex">
<view class="bg">
已抢{{ item.sales }}
</view>
<text class="txt"></text>
</view>
<text class="txt"></text>
</view>
<view class="price-wrap flex">
<view class="price-txt">
@@ -612,23 +614,26 @@ export default {
}
}
.line-price {
.number {
width: 82px;
height: 24px;
border-radius: 12px;
line-height: 24px;
color: #fff;
font-size: 12px;
font-weight: bold;
background: rgba(250,181,176,0.39);
box-shadow: 1px 1px 1px rgba(0,0,0,0.16);
.bg {
z-index: 1;
height: 100%;
padding: 0 4px 0 12px;
margin: 0 2px 0 0;
.number-wrap {
display: flex;
.number {
height: 24px;
padding: 0 20rpx 0 0;
border-radius: 12px;
background-color: #E92727;
line-height: 24px;
color: #fff;
font-size: 12px;
font-weight: bold;
background: rgba(250,181,176,0.39);
box-shadow: 1px 1px 1px rgba(0,0,0,0.16);
.bg {
z-index: 1;
height: 100%;
padding: 0 4px 0 12px;
margin: 0 2px 0 0;
border-radius: 12px;
background-color: #E92727;
}
}
}
.price-wrap {
+2
View File
@@ -186,6 +186,8 @@ export default {
changeTabs(index) {
if (this.isManage) return
// fix bug#1111
this.isAll = false
this.tabsIndex = index
this.page = 1
this.fetchData()
+47 -47
View File
@@ -21,18 +21,21 @@
<view class="item acea-row row-middle">
<view class="dollar bold"></view>
<view class="input">
<input
:placeholder="'最低提现金额' + minPrice"
placeholder-style="font-size:28rpx"
v-model="amout"
:maxlength='maxlength'
@blur="balanceInputBlur"
@input="balanceInputChange"
type="digit"
autofocus
<u--input
v-model="amout"
:placeholder="'最低提现金额' + minPrice"
:maxlength="-1"
:customStyle="{
'border': 0
}"
placeholder-style="font-size:28rpx"
type="digit"
autofocus
@blur="balanceInputBlur"
@input="balanceInputChange"
/>
</view>
<button class="withdraw-all-btn" @click="withdrawalAll">全部提现</button>
<view class="withdraw-all-btn" @click="withdrawalAll">全部提现</view>
</view>
<view class="vline"></view>
<view class="acea-row row-between row-middle" style="margin-top: 22rpx;">
@@ -52,7 +55,8 @@
<uni-popup ref="popup" type="bottom">
<blPaymentPasswordInput hideTopBorder ref="secrity" @input="onInput" @confirm="onConfirm">
<block slot='header' style='width: 100%;'>
<view style="font-size: 36rpx;color: #8B8F99;margin-top: 10rpx;">请输入支付密码</view>
<view style="font-size: 36rpx;color: #8B8F99;line-height: 80rpx;">请输入支付密码</view>
<view style="font-size: 28rpx;color: #999;margin-top: 20rpx;">手续费{{ totalFee }}</view>
</block>
<block slot='middle'>
<view class="" style="background-color: #fff;"></view>
@@ -66,7 +70,7 @@
<script>
import {mapGetters} from "vuex";
import {getUserInfo, getMenuUser, bindingPhone, getBank, bankCardList, postCashInfo} from "@/api/user";
import { getBank, bankCardList, postCashInfo } from "@/api/user";
import NP from "number-precision";
import uniPopup from '@/components/uni-popup/uni-popup.vue';
import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue';
@@ -80,7 +84,6 @@ export default {
amout: "",
minPrice: 0,
banks: [],
maxlength: -1,
commissionCount: 0, //可提现金额
fee: 0, //手续费
gdAmount: 0, //固定手续费
@@ -102,7 +105,7 @@ export default {
if( 提现金额 < gdLimit ) sxf = gdAmount
if( 提现金额 >= gdLimit ) sxf = 提现金额*fl
*/
return this.calculateSxf(this.amout);
return this.calculateSxf(this.amout)
}
},
onLoad: function (e) {
@@ -140,8 +143,9 @@ export default {
console.log("variable");
}
console.log("sxf:" + sxf);
return this.$force2Decimal(sxf);
// fix bug#1202
// 四舍五入,再保留两位小数
return (Math.round(sxf * 100) / 100).toFixed(2);
},
goCashRecord() {
this.$yrouter.push('/pkg_user/views/withdrawalLog');
@@ -193,19 +197,24 @@ export default {
return value
},
balanceInputChange: function (e) {
var value = e.target.value;
this.amout = value
var v = this.clearNoNum(value)
balanceInputChange(value) {
let v = this.clearNoNum(value)
if (v > this.commissionCount) {
v = this.commissionCount
}
setTimeout(() => {
this.amout = v
}, 0)
},
balanceInputBlur: function (e) {
var value = e.target.value;
balanceInputBlur(value) {
if (String(value).length == 0) {
this.amout = 0
return
}
if (value > this.commissionCount) {
this.amout = this.commissionCount
} else {
this.amout = value
}
},
openPwdInput() {
@@ -287,7 +296,6 @@ export default {
});
},
confrimBtnClick: function () {
let that = this;
if (!this.selectedBank) {
this.$dialog.error("请选择提现银行卡");
return;
@@ -338,32 +346,20 @@ export default {
},
withdrawalAll: function () {
if (this.commissionCount) {
this.amout = this.commissionCount + "";
this.amout = this.commissionCount + ''
}
},
getBank: function () {
let that = this;
getBank().then(
res => {
that.banks = res.data.extractBank;
that.minPrice = res.data.minPrice;
that.commissionCount = this.$force2Decimal(res.data.commissionCount);
that.gdAmount = parseFloat(res.data.gdAmount);
that.gdLimit = parseFloat(res.data.gdLimit);
that.feeRate = parseFloat(res.data.fl);
//可提现金额去除手续费
if (that.commissionCount > 0) {
var sxf = that.calculateSxf(that.commissionCount);
console.log('手续费:' + sxf);
that.commissionCount = this.$force2Decimal(Math.max(0, (that.commissionCount - sxf)));
;
}
},
function (err) {
}
);
res => {
this.banks = res.data.extractBank
this.minPrice = res.data.minPrice
this.commissionCount = this.$force2Decimal(res.data.commissionCount)
this.gdAmount = parseFloat(res.data.gdAmount)
this.gdLimit = parseFloat(res.data.gdLimit)
this.feeRate = parseFloat(res.data.fl)
}
)
}
}
@@ -427,11 +423,15 @@ export default {
height: 56rpx;
padding: 0;
border-radius: 4rpx;
background: #28AAF4;
border: 0;
color: #FFFFFF;
font-size: 24rpx;
font-weight: bold;
flex-shrink: 0;
line-height: 56rpx;
text-align: center;
box-shadow: none;
background: #28AAF4;
}
.vline {
+1 -1
View File
@@ -19,7 +19,7 @@
({{ item['status'] === -1 ? '提现失败' : item['status'] === 1 ? '已提现' : '提现中' }})
</text>
</view>
<view style="margin-top: 10rpx;color:#666666;font-size: 28rpx">2023-08-21 16:10:10</view>
<view style="margin-top: 10rpx;color:#666666;font-size: 28rpx">{{ item.createTime }}</view>
</view>
</view>
@@ -275,6 +275,9 @@
},
// 发出change事件
emitChange(value) {
const {
type
} = this
// 如果开启了异步变更值,则不修改内部的值,需要用户手动在外部通过v-model变更
if (!this.asyncChange) {
this.$nextTick(() => {
@@ -284,6 +287,7 @@
})
}
this.$emit('change', {
type,
value,
name: this.name,
});
+14 -13
View File
@@ -16,9 +16,19 @@
</view>
<view class="conter">
<mescroll-body ref="mescrollRef" top="16rpx" bottom="0" class='cotent-scroll' :up="upOption" :down="downOption"
@up="upCallback" @down="downCallback" @init="mescrollInit" @emptyclick="emptyClick">
<mescroll-body
ref="mescrollRef"
:up="upOption"
:down="downOption"
:show-no-more="goodsList.length < 10"
top="16rpx"
bottom="0"
class='cotent-scroll'
@up="upCallback"
@down="downCallback"
@init="mescrollInit"
@emptyclick="emptyClick"
>
<view class="text acea-row row-center row-middle">
<view class="h-line"></view>
<view class="cate-name">
@@ -129,7 +139,7 @@ export default {
tabName: "", // 跳转初始分类名
lock: false,
upOption: {
noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
noMoreSize: 1, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
auto: false,
empty: {
tip: '暂无商品' // 提示
@@ -183,15 +193,6 @@ export default {
//触发加载请求
this.mescroll && this.mescroll.triggerDownScroll()
},
goGoodsList(child) {
this.$yrouter.push({
path: "/pages/shop/GoodsList/index",
query: {
id: child.id,
title: child.cateName
}
});
},
activeCateId(n) {
let index = 0;
n = parseInt(n);