shuxiaoquan 11 months ago
commit 9f29108806
  1. 2
      api/goods/index.js
  2. 142
      components/goods-sku-popup/index.vue
  3. 4
      pages/cart/index.vue
  4. 69
      pages/goods/components/SkuPopup.vue
  5. 50
      pages/goods/components/setPrice.vue
  6. 45
      pages/goods/detail.vue
  7. 4
      pages/goods/list.vue
  8. 4
      pages/index/index.vue
  9. 6
      pages/invoice/edit.vue
  10. 2
      pages/news1/feedback.vue
  11. 4
      pages/order/index.vue
  12. 210
      pages/sureOrder/index.vue

@ -92,5 +92,5 @@ export const editGoodsSeckillPrice = param => {
}
// 是否有货
export const getGoodsStock = param => {
return request.get('goods/getGoodsStock', param)
return request.post('goods/getGoodsStock', param)
}

@ -1,6 +1,6 @@
<template>
<view class="goods-sku-popup" catchtouchmove="true" :class="valueCom && complete ? 'show' : 'none'" @touchmove.stop.prevent="moveHandle"
@click.stop="stop">
<view class="goods-sku-popup" catchtouchmove="true" :class="valueCom && complete ? 'show' : 'none'"
@touchmove.stop.prevent="moveHandle" @click.stop="stop">
<!-- 页面内容开始 -->
<view class="mask" @click="close('mask')"></view>
<view class="layer attr-content" :class="{'safe-area-inset-bottom':safeAreaInsetBottom }"
@ -9,8 +9,10 @@
<scroll-view class="specification-wrapper-content" scroll-y="true">
<view class="specification-header">
<view class="specification-left">
<image class="product-img" :src="selectShop.image ? selectShop.image : goodsInfo[goodsThumbName]"
:style="{ backgroundColor: goodsThumbBackgroundColor }" mode="aspectFill" @click="previewImage"></image>
<image class="product-img"
:src="selectShop.image ? selectShop.image : goodsInfo[goodsThumbName]"
:style="{ backgroundColor: goodsThumbBackgroundColor }" mode="aspectFill"
@click="previewImage"></image>
</view>
<view class="specification-right">
<view class="price-content" :style="{ color: themeColorFn('priceColor') }">
@ -25,11 +27,13 @@
</view>
</view>
<view class="specification-content">
<view v-show="isManyCom" class="specification-item" v-for="(item, index1) in goodsInfo[specListName]" :key="index1">
<view v-show="isManyCom" class="specification-item"
v-for="(item, index1) in goodsInfo[specListName]" :key="index1">
<view class="item-title">{{ item.name }}</view>
<view class="item-wrapper">
<view class="item-content" v-for="(item_value, index2) in item.list" :key="index2"
:class="[item_value.ishow ? '' : 'noactived', subIndex[index1] == index2 ? 'actived' : '']" :style="[
:class="[item_value.ishow ? '' : 'noactived', subIndex[index1] == index2 ? 'actived' : '']"
:style="[
item_value.ishow ? '' : themeColorFn('disableStyle'),
item_value.ishow ? themeColorFn('btnStyle') : '',
subIndex[index1] == index2 ? themeColorFn('activedStyle') : ''
@ -41,8 +45,9 @@
<view class="number-box-view" v-if="!userInfo.user_type || userInfo.user_type != 40">
<view style="flex: 1;">数量</view>
<view style="flex: 4;text-align: right;">
<number-box v-model="selectNum" :min="minBuyNum || 1" :max="maxBuyNumCom" :step="stepBuyNum || 1"
:step-strictly="stepStrictly" :positive-integer="true" @change="numChange" />
<number-box v-model="selectNum" :min="minBuyNum || 1" :max="maxBuyNumCom"
:step="stepBuyNum || 1" :step-strictly="stepStrictly" :positive-integer="true"
@change="numChange" />
</view>
</view>
</view>
@ -97,8 +102,12 @@
var goodsCache = {}; //
export default {
name: 'GoodsSkuPopup',
components: { NumberBox },
emits: ['update:modelValue', 'input', 'update-goods', 'open', 'close', 'add-cart', 'buy-now', 'cart', 'buy', 'num-change'],
components: {
NumberBox
},
emits: ['update:modelValue', 'input', 'update-goods', 'open', 'close', 'add-cart', 'buy-now', 'cart', 'buy',
'num-change'
],
props: {
// true false
value: {
@ -328,6 +337,7 @@
},
data() {
return {
skuItem: '',
userInfo: {},
complete: false, //
goodsInfo: {}, //
@ -460,12 +470,16 @@
// 使vk
findGoodsInfo(obj = {}) {
let that = this;
let { useCache } = obj;
let {
useCache
} = obj;
if (typeof vk == 'undefined') {
that.toast('custom-action必须是function', 'none');
return false;
}
let { actionTips } = that;
let {
actionTips
} = that;
let actionTitle = '';
let actionAoading = false;
if (actionTips !== 'custom') {
@ -509,8 +523,11 @@
// goodsInfo.sku_list.map((item, index) => {
// item.sku_name_arr = ["20ml/"];
// });
let { skuListName } = that;
if (JSON.stringify(that.goodsInfo) === '{}' || that.goodsInfo[that.goodsIdName] !== goodsInfo[that.goodsIdName]) {
let {
skuListName
} = that;
if (JSON.stringify(that.goodsInfo) === '{}' || that.goodsInfo[that.goodsIdName] !== goodsInfo[that
.goodsIdName]) {
that.goodsInfo = goodsInfo;
that.initKey = true;
} else {
@ -526,7 +543,8 @@
that.init(!autoClickSku)
}
// sku
let select_sku_info = that.getListItem(that.goodsInfo[skuListName], that.skuIdName, that.selectShop[that.skuIdName]);
let select_sku_info = that.getListItem(that.goodsInfo[skuListName], that.skuIdName, that.selectShop[that
.skuIdName]);
Object.assign(that.selectShop, select_sku_info);
that.defaultSelectSku();
that.complete = true;
@ -564,7 +582,9 @@
}, 500);
});
} catch (err) {
let { message = '' } = err;
let {
message = ''
} = err;
if (message.indexOf('.catch is not a function') > -1) {
that.toast('custom-action必须返回一个Promise', 'none');
setTimeout(function() {
@ -597,7 +617,9 @@
return false;
}
} else {
if (findGoodsInfoRun) that.findGoodsInfo({ useCache });
if (findGoodsInfoRun) that.findGoodsInfo({
useCache
});
}
},
// -
@ -632,7 +654,12 @@
that.$set(that.selectArr, index1, '');
that.$set(that.subIndex, index1, -1);
}
this.$emit('selectedOld',{title:item,value:value,})
this.skuItem = item;
this.skuIValue = value
this.$emit('selectedOld', {
title: this.skuItem,
value: this.skuIValue,
})
that.checkInpath(index1);
//
that.checkSelectShop();
@ -696,7 +723,9 @@
checkItem() {
let that = this;
// console.time('');
let { stockName } = that;
let {
stockName
} = that;
let skuListName = that.skuListName;
// 0sku
let originalSkuList = that.goodsInfo[skuListName];
@ -721,8 +750,11 @@
arr.map(item2 => {
//
//console.log(1,that.shopItemInfo,that.getArrayToSting([...item2, item]),item2,item,items);
if (!that.shopItemInfo.hasOwnProperty(that.getArrayToSting([...item2, item]))) {
that.shopItemInfo[that.getArrayToSting([...item2, item])] = items;
if (!that.shopItemInfo.hasOwnProperty(that.getArrayToSting([...
item2, item
]))) {
that.shopItemInfo[that.getArrayToSting([...item2, item])] =
items;
}
return [...item2, item];
})
@ -760,7 +792,12 @@
return false;
}
that.clickTime = clickTime;
let { selectShop, selectNum, stockText, stockName } = that;
let {
selectShop,
selectNum,
stockText,
stockName
} = that;
if (!selectShop || !selectShop[that.skuIdName]) {
that.toast('请先选择对应规格', 'none');
return false;
@ -784,6 +821,10 @@
selectShop.buy_num = that.selectNum;
that.$emit('add-cart', selectShop);
that.$emit('cart', selectShop);
that.$emit('selectedOld', {
title: that.skuItem,
value: that.skuIValue,
})
}
});
},
@ -796,6 +837,10 @@
console.log(selectShop)
that.$emit('buy-now', selectShop);
that.$emit('buy', selectShop);
that.$emit('selectedOld', {
title: that.skuItem,
value: that.skuIValue,
})
}
});
},
@ -839,7 +884,9 @@
// skusku,sku
autoClickSku() {
let that = this;
let { stockName } = that;
let {
stockName
} = that;
let skuList = that.goodsInfo[that.skuListName];
let specListArr = that.goodsInfo[that.specListName];
if (specListArr.length == 1) {
@ -856,13 +903,18 @@
//
themeColorFn(name) {
let that = this;
let { theme, themeColor } = that;
let {
theme,
themeColor
} = that;
let color = that[name] ? that[name] : themeColor[theme][name];
return color;
},
defaultSelectSku() {
let that = this;
let { defaultSelect } = that;
let {
defaultSelect
} = that;
if (defaultSelect && defaultSelect.sku && defaultSelect.sku.length > 0) {
that.selectSku(defaultSelect);
}
@ -876,7 +928,10 @@
*/
selectSku(obj = {}) {
let that = this;
let { sku: skuArr, num: selectNum } = obj;
let {
sku: skuArr,
num: selectNum
} = obj;
let specListArr = that.goodsInfo[that.specListName];
if (skuArr && specListArr.length === skuArr.length) {
//
@ -919,7 +974,9 @@
},
pushGoodsCache(goodsInfo) {
let that = this;
let { goodsIdName } = that;
let {
goodsIdName
} = that;
goodsCache[goodsInfo[goodsIdName]] = goodsInfo;
},
//
@ -927,7 +984,11 @@
//
previewImage() {
let that = this;
let { selectShop, goodsInfo, goodsThumbName } = that;
let {
selectShop,
goodsInfo,
goodsThumbName
} = that;
let src = selectShop.image ? selectShop.image : goodsInfo[goodsThumbName];
if (src) {
uni.previewImage({
@ -938,7 +999,9 @@
getMaxStock() {
let maxStock = 0;
let that = this;
let { selectShop = {}, goodsInfo = {}, skuListName, stockName } = that;
let {
selectShop = {}, goodsInfo = {}, skuListName, stockName
} = that;
if (selectShop[stockName]) {
maxStock = selectShop[stockName];
} else {
@ -983,7 +1046,11 @@
//
isManyCom() {
let that = this;
let { goodsInfo, defaultSingleSkuName, specListName } = that;
let {
goodsInfo,
defaultSingleSkuName,
specListName
} = that;
let isMany = true;
if (
goodsInfo[specListName] &&
@ -999,7 +1066,9 @@
priceCom() {
let str = '';
let that = this;
let { selectShop = {}, goodsInfo = {}, skuListName, skuIdName } = that;
let {
selectShop = {}, goodsInfo = {}, skuListName, skuIdName
} = that;
if (selectShop[skuIdName]) {
str = that.priceFilter(selectShop.price);
} else {
@ -1024,7 +1093,9 @@
stockCom() {
let str = '';
let that = this;
let { selectShop = {}, goodsInfo = {}, skuListName, stockName } = that;
let {
selectShop = {}, goodsInfo = {}, skuListName, stockName
} = that;
if (selectShop[stockName]) {
str = selectShop[stockName];
} else {
@ -1057,8 +1128,11 @@
immediate: true,
handler: function(newVal, oldValue) {
let that = this;
let { goodsIdName } = that;
if (typeof newVal === 'object' && newVal && newVal[goodsIdName] && !goodsCache[newVal[goodsIdName]]) {
let {
goodsIdName
} = that;
if (typeof newVal === 'object' && newVal && newVal[goodsIdName] && !goodsCache[newVal[
goodsIdName]]) {
that.pushGoodsCache(newVal);
}
}

@ -90,7 +90,7 @@
<text v-if="item.line_price_min > 0"
class="line-price col-9 f-24">{{ item.line_price_min>0?Number(item.line_price_min):0.00 }}</text>
</view>
<image :src="$picUrl+'/static/detail/redShen.png'" v-if="is_check==1" mode=""></image>
<image :src="$picUrl+'/static/detail/redShen.png'" v-if="item.is_check==1" mode=""></image>
</view>
<view class="goodsInfo1">
<view class="oneTip">
@ -139,7 +139,7 @@
<text v-if="item.line_price_min > 0"
class="line-price col-9 f-24">{{ item.line_price_min>0?Number(item.line_price_min):0.00 }}</text>
</view>
<image :src="$picUrl+'/static/detail/redShen.png'" v-if="is_check==1" mode=""></image>
<image :src="$picUrl+'/static/detail/redShen.png'" v-if="item.is_check==1" mode=""></image>
</view>
<view class="goodsInfo1">
<view class="oneTip">

@ -16,6 +16,7 @@
} from '@/utils/color'
import * as CartApi from '@/api/cart'
import GoodsSkuPopup from '@/components/goods-sku-popup'
import * as GoodsApi from '@/api/goods'
export default {
components: {
@ -37,8 +38,16 @@
goods: {
type: Object,
default: {}
},
addressResult: {
type: Object,
default: {
province: '江苏省',
city: '南京市',
district: '玄武区'
}
},
},
data() {
return {
//
@ -47,6 +56,7 @@
maxBuyNum: null,
selectSku: '',
shopNum: 1,
stockValue: '有货',
}
},
computed: {
@ -184,9 +194,17 @@
},
selectedOld(e) {
this.selectSku = e
this.$emit('getSku', {
selectSku: this.selectSku,
shopNum: this.shopNum
})
},
numChange(e) {
this.shopNum = e
this.$emit('getSku', {
selectSku: this.selectSku,
shopNum: this.shopNum
})
},
// sku -----------------------------------------------------------
openSkuPopup() {
@ -194,17 +212,48 @@
},
closeSkuPopup() {
this.$emit('getSku', {
selectSku: this.selectSku,
shopNum: this.shopNum
})
// console.log(" - sku")
},
async getGoodsStockInfor(selectShop, type) {
let that = this;
let params = {
list: [{
goods_id: that.goods.goods_id,
num: that.selectNum
}],
province: that.addressResult ? that.addressResult.province : '江苏省',
city: that.addressResult ? that.addressResult.city : '南京市',
district: that.addressResult ? that.addressResult.district : '玄武区'
}
let {
status,
message,
data
} = await GoodsApi.getGoodsStock(params);
if (status == 200) {
that.stockValue = data[0].state
if (that.stockValue == '无货') {
uni.showToast({
icon: "none",
title: "该商品暂时无货"
})
} else {
if (type == 1) {
that.addCartInfor(selectShop)
} else {
that.buyNowInfor(selectShop)
}
}
}
},
//
addCart(selectShop) {
this.selectInfor = selectShop
const app = this
app.getGoodsStockInfor(selectShop, 1)
},
addCartInfor(selectShop) {
const app = this
app.selectInfor = selectShop
const {
goods_id,
goods_sku_id,
@ -224,9 +273,13 @@
app.$emit('addCart', cartTotal)
})
},
//
buyNow(selectShop) {
const app = this
app.getGoodsStockInfor(selectShop, 2)
},
buyNowInfor(selectShop) {
const app = this
this.selectInfor = selectShop
if (uni.getStorageSync("userInfo").user_type == 40) {
//
@ -244,7 +297,7 @@
})
//
this.onChangeValue(false)
}
},
}
}

@ -11,20 +11,20 @@
placeholder="秒杀价格可低于成本价" />
</view>
<view class="priceTime">
<view class="text">秒杀区间</view>
<view class="priceDate">
<view class="text">开始时间</view>
<view class="selectTime" :style="'color: ' + (startTime?fontColor:'')" @click="timeShow=true">
{{startTime?startTime:'起始时间'}}
</view>
<text>-</text>
<view class="selectTime" :style="'color: ' + (endTime?fontColor:'')" @click="timeShow=true">
{{endTime?endTime:'终止时间'}}
</view>
</view>
<view class="priceCon" v-if="secondQuota">
<text>秒杀时长</text>
<input type="number" style="width: 130rpx;margin-right: 15rpx;" class="input" v-model="sec_hour"
placeholder="请输入"> /
</view>
<view class="priceCon" style="justify-content: space-between;">
<view class="priceCon">
<text>秒杀限购</text>
<u-switch v-model="secondQuota" size='35' @change="change" activeColor='#55BD6A' inactiveColor='#F1F1F1'>
<u-switch v-model="secondQuota" size='35' @change="change" activeColor='#55BD6A'
inactiveColor='#F1F1F1'>
</u-switch>
</view>
<view class="priceCon" v-if="secondQuota">
@ -44,8 +44,8 @@
</view>
</u-popup>
</view>
<u-calendar v-model="timeShow" mode="multiple" minDate='0' @change="getTime" :pickerOptions="pickerOptions" range-color='#FF6257' range-bg-color='#FFBDBA'
active-bg-color='#FF6257'></u-calendar>
<u-calendar v-model="timeShow" mode="date" minDate='0' @change="getTime" :pickerOptions="pickerOptions"
range-color='#FF6257' range-bg-color='#FFBDBA' active-bg-color='#FF6257'></u-calendar>
</template>
<script>
@ -55,28 +55,22 @@
afterSale: false,
timeShow: false,
startTime: '',
endTime: '',
sec_hour: '',
secondPrice: '',
secondQuota: 1,
quotaNum: '',
fontColor: '#262626',
pickerOptions:{
disabledDate(time){
return true
}
}
}
},
methods: {
reset() {
this.startTime = null;
this.endTime = null
this.sec_hour = null
this.secondPrice = null;
this.quotaNum = null
},
getTime(e) {
this.startTime = e.startDate;
this.endTime = e.endDate;
this.startTime = e.result;
},
submit() {
if (!this.secondPrice) {
@ -85,15 +79,15 @@
if (!this.startTime) {
return this.$toast('请选择开始时间')
}
if (!this.endTime) {
return this.$toast('请选择结束时间')
if (!this.sec_hour) {
return this.$toast('请输入秒杀时长')
}
if (!this.quotaNum && this.secondQuota) {
return this.$toast('请输入限购次数')
}
this.$emit('getprice', {
startTime: this.startTime,
endTime: this.endTime,
sec_hour: this.sec_hour,
secondPrice: this.secondPrice,
quotaNum: this.secondQuota ? this.quotaNum : '',
secondQuota: this.secondQuota ? 1 : 2
@ -108,6 +102,7 @@
background-color: #FF6257 !important;
border-color: #FF6257 !important;
}
.afterSales {
padding: 32upx;
@ -154,6 +149,10 @@
}
.priceTime {
display: flex;
align-items: center;
font-size: 28rpx;
color: #262626;
margin-bottom: 20rpx;
.text {
@ -168,12 +167,8 @@
text-transform: none;
}
.priceDate {
display: flex;
align-items: center;
.selectTime {
width: 238rpx;
width: 300rpx;
height: 70rpx;
background: #F3F3F3;
border-radius: 44rpx;
@ -191,7 +186,6 @@
margin: 0 15rpx;
}
}
}
// ::v-deep .u-input {
// height: 70upx;

@ -46,7 +46,7 @@
<text class="span"
v-if="userInfo.user_type==40">{{goods.cost_price_min?Number(goods.cost_price_min):0}}</text>
<text class="span"
v-else>{{(goods.line_price_min>0&&goods.goods_price_min>0)?(Number(goods.line_price_min)-Number(goods.goods_price_min)):0}}</text>
v-else>{{(goods.line_price_min>0&&goods.goods_price_min>0)?Number((Number(goods.line_price_min)-Number(goods.goods_price_min)).toFixed(2)):0}}</text>
</view>
</view>
</view>
@ -76,7 +76,7 @@
</view>
</view>
</view>
<view class="goodsOpera">
<!-- <view class="goodsOpera">
<view v-if="goods.goods_no" class="goodsNum" @click="copyNum(goods.goods_no)">
<text>{{goods.goods_no}}</text>
<image :src="$picUrl+'/static/detail/copy.png'"></image>
@ -87,7 +87,7 @@
class="tips">
</image>
</view>
</view>
</view> -->
<view class="rank" @click="goRanking()" v-if="goods && goods.category">
<text><text style="font-size: 32rpx;font-weight: bold;">排行榜</text>
{{goods.category.name}}热搜榜第{{goods.paihang}}</text>
@ -105,11 +105,11 @@
<u-icon name="arrow-right" color="#B7B7B7" size="22"></u-icon>
</picker>
</view>
<view v-if="goods.unicode" class="operaImg" @click="copyNum(goods.unicode)">
<view v-if="goods.goods_no" class="operaImg" @click="copyNum(goods.goods_no)">
<view class="left_1">
{{goods.goods_source}}
</view>
<text>{{goods.unicode}}</text>
<text>{{goods.goods_no}}</text>
<image :src="$picUrl+'/static/detail/copy.png'"
style="width: 27rpx;height: 27rpx;margin-left: 8rpx;"></image>
</view>
@ -117,17 +117,17 @@
</view>
</view>
<view class="orderInfo">
<view class="chosed" v-if="goods.spec_type == 20" @click="choseSku(3)">
<view class="chosed" v-if="goods.spec_type == 20" @click="stockValue=='有货'?choseSku(3):''">
<view class="title">已选</view>
<view class="info" style="justify-content: flex-start;" v-if="goods.skuList.length>0">
<text
style="margin-right: 10rpx;">{{selectSku.title.name}}-{{selectSku.value.name}}</text>{{selectShop}}
</view>
<u-icon name="arrow-right" color="#B7B7B7"></u-icon>
<u-icon name="arrow-right" color="#B7B7B7" v-if="stockValue=='有货'"></u-icon>
</view>
<view class="chosed" v-else @click="choseSku(3)">
<view class="chosed" v-else @click="stockValue=='有货'?choseSku(3):''">
<view class="title">已选</view>
<view class="info">{{selectShop}}</view>
<view class="info">{{selectNum}}</view>
<u-icon name="arrow-right" color="#B7B7B7"></u-icon>
</view>
<view class="chosed" v-if="goods.skuList && goods.skuList.length > 0 && goods.skuList[0].stock_num > 0">
@ -284,10 +284,10 @@
<template v-if="isSeckill">
<template v-if="isBuy">
<template v-if="seckillText=='距离'">
<view class="addCar" @click="choseSku(2)">
<view class="addCar" :style="{'background': stockValue=='有货'?'#FF9E2B':'#cecece' }" @click="stockValue=='有货'?choseSku(2):''">
加入购物车
</view>
<view class="buyNow" @click="choseSku(3)">
<view class="buyNow" :style="{'background': stockValue=='有货'?'linear-gradient(102deg, #FE5E06 0%, #F3221A 100%)':'#cecece' }" @click="stockValue=='有货'?choseSku(3):''" >
立即购买
</view>
</template>
@ -304,10 +304,10 @@
</template>
</template>
<template v-else>
<view class="addCar" @click="choseSku(2)">
<view class="addCar" :style="{'background': stockValue=='有货'?'#FF9E2B':'#cecece' }" @click="stockValue=='有货'?choseSku(2):''">
加入购物车
</view>
<view class="buyNow" @click="choseSku(3)">
<view class="buyNow" :style="{'background': stockValue=='有货'?'linear-gradient(102deg, #FE5E06 0%, #F3221A 100%)':'#cecece' }" @click="stockValue=='有货'?choseSku(3):''">
立即购买
</view>
</template>
@ -409,7 +409,7 @@
<image :src="$picUrl+'/static/toTop.png?=1'"></image>
</view>
<view v-if="isTodo">
<SkuPopup v-model="showSkuPopup" :skuMode="skuMode" :goods="goods" @getSku='onGetSku'
<SkuPopup v-model="showSkuPopup" :skuMode="skuMode" :goods="goods" :addressResult='addressResult' @getSku='onGetSku'
@addCart="onAddCart" />
</view>
<setPrice ref="setRange" @getprice="getprice" />
@ -484,11 +484,11 @@
name: '运损换新'
}],
selectSku: '',
selectShop: 1,
selectNum: 1,
multiIndex: [0, 0, 0],
multiArray: [],
multiData: [],
stockValue: '南京市',
stockValue: '有货',
addressResult: {
province: '江苏省',
city: '南京市',
@ -499,7 +499,7 @@
onLoad(options) {
const that = this;
let result = uni.getStorageSync("addressResult")
this.addressResult = result.address_component || ''
this.addressResult = result?result.address_component:this.addressResult
this.isPre = options.isPre ? options.isPre : null
// query
// this.onRecordQuery(options)
@ -552,7 +552,7 @@
methods: {
async getGoodsStockInfor() {
let params = {
goods_id: this.goodsId,
list:[{goods_id:this.goodsId,num:this.selectNum}],
province: this.addressResult ? this.addressResult.province : '江苏省',
city: this.addressResult ? this.addressResult.city : '南京市',
district: this.addressResult ? this.addressResult.district : '玄武区'
@ -563,7 +563,7 @@
data
} = await GoodsApi.getGoodsStock(params);
if (status == 200) {
this.stockValue = data.stock
this.stockValue = data[0].state
}
},
async getProvinceAll() {
@ -618,7 +618,7 @@
sku_id: that.goods.skuList[0].id,
seckill_price: e.secondPrice,
sec_start_time: e.startTime,
sec_end_time: e.endTime,
sec_hour: e.sec_hour,
is_limit: e.secondQuota,
limit_times: e.quotaNum
}
@ -836,8 +836,9 @@
})
},
onGetSku(e) {
console.log(e)
this.selectSku = e.selectSku
this.selectShop = e.shopNum
this.selectNum = e.shopNum
},
//
onAddCart(total) {
@ -1297,7 +1298,7 @@
}
.rightBox {
width: 195rpx;
min-width: 195rpx;
height: 64rpx;
background: #FFFFFF;
border-radius: 20rpx 20rpx 20rpx 20rpx;

@ -127,7 +127,7 @@
<text v-if="item.line_price_min > 0"
class="line-price col-9 f-24">{{ item.line_price_min>0?Number(item.line_price_min):0.00 }}</text>
</view>
<image :src="$picUrl+'/static/detail/redShen.png'" v-if="is_check==1" mode="">
<image :src="$picUrl+'/static/detail/redShen.png'" v-if="item.is_check==1" mode="">
</image>
</view>
<view class="goodsInfo">
@ -181,7 +181,7 @@
<text v-if="item.line_price_min > 0"
class="line-price col-9 f-24">{{ item.line_price_min>0?Number(item.line_price_min):'' }}</text>
</view>
<image :src="$picUrl+'/static/detail/redShen.png'" v-if="is_check==1" mode="">
<image :src="$picUrl+'/static/detail/redShen.png'" v-if="item.is_check==1" mode="">
</image>
</view>
<view class="goodsInfo">

@ -259,7 +259,7 @@
<text v-if="item.line_price_min > 0"
class="line-price col-9 f-24">{{ item.line_price_min>0?Number(item.line_price_min):0.00 }}</text>
</view>
<image :src="$picUrl+'/static/detail/redShen.png'" v-if="is_check==1" mode=""></image>
<image :src="$picUrl+'/static/detail/redShen.png'" v-if="item.is_check==1" mode=""></image>
</view>
<view class="goodsInfo1">
<view class="oneTip">
@ -308,7 +308,7 @@
<text v-if="item.line_price_min > 0"
class="line-price col-9 f-24">{{ item.line_price_min>0?Number(item.line_price_min):0.00 }}</text>
</view>
<image :src="$picUrl+'/static/detail/redShen.png'" v-if="is_check==1" mode=""></image>
<image :src="$picUrl+'/static/detail/redShen.png'" v-if="item.is_check==1" mode=""></image>
</view>
<view class="goodsInfo1">
<view class="oneTip">

@ -34,7 +34,7 @@
<view class="l">发票抬头</view>
<view class="r">
<input type="text" v-model="array1[index1]" placeholder="请输入单位名称" />
<view class="tt" @click="bindPickerChange1" style="color: rgb(58, 134, 255;">更改抬头</view>
<view class="tt" @click="bindPickerChange1" style="color: rgb(58, 134, 255;">选择发票抬头</view>
</view>
</view>
<view class="item" v-if="tabIndex == 2">
@ -192,7 +192,7 @@
icon: 'none',
duration: 2000
})
if (result.data.list.length.length > 0) {
if (result.data.length > 0) {
uni.navigateTo({
url: "/pages/invoice/detail?id=" + result.data.list[0].id
})
@ -244,7 +244,7 @@
},
bindPickerChange1() {
uni.navigateTo({
url: "/pages/invoice/index?orderId=" + this.orderId +'&order='+(app.orderDetail?JSON.stringify(app.orderDetail):'')
url: "/pages/invoice/index?orderId=" + this.orderId +'&order='+(this.orderDetail?JSON.stringify(this.orderDetail):'')
})
}
}

@ -28,7 +28,7 @@
</u-radio-group>
</u-form-item>
<u-form-item label="反馈类型" label-width="170">
<u-form-item label="反馈店铺" label-width="170">
<u-radio-group v-model="form.shop">
<u-radio active-color="#FF4434" v-for="(item, index) in checkboxList2" :key="index"
:name="item.val">

@ -94,9 +94,7 @@
<!-- <view class="n"
v-if="item.pay_status == PayStatusEnum.SUCCESS.value && item.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value"
@click="onAdress(order.goods_id)">修改地址</view> -->
<!-- <view class="n n-1"
v-if="item.order_status == OrderStatusEnum.COMPLETED.value && item.is_comment == 0"
@click="handleTargetComment(item.order_id)">评价</view> -->
<!-- <view class="n n-1" @click="onInvoicing(item.order_id,item)">评价</view> -->
</view>
</view>
</view>

@ -4,10 +4,12 @@
<u-navbar title="确认订单" :border-bottom="false" title-color="#333" :background="background"></u-navbar>
</view>
<view class="buyType">
<view class="toDoor" :class="buyType=='sm'?'':'toDoor-dis'" @click="handleSwichDelivery(DeliveryTypeEnum.EXPRESS.value,'sm')">
<view class="toDoor" :class="buyType=='sm'?'':'toDoor-dis'"
@click="handleSwichDelivery(DeliveryTypeEnum.EXPRESS.value,'sm')">
送货上门
</view>
<view class="toDoor" :class="buyType=='zq'?'':'toDoor-dis'" @click="handleSwichDelivery(DeliveryTypeEnum.EXTRACT.value,'zq')">
<view class="toDoor" :class="buyType=='zq'?'':'toDoor-dis'"
@click="handleSwichDelivery(DeliveryTypeEnum.EXTRACT.value,'zq')">
到店自取
</view>
<view class="toDoor-on" :style="{'left': buyType=='sm'?'0':'350rpx'}">{{buyType=='zq'?'到店自取':'送货上门'}}</view>
@ -40,7 +42,9 @@
</view>
</view>
<view class="b">
{{ order.extractShop.region.province }} {{ order.extractShop.region.city }}{{ order.extractShop.region.region }} {{ order.extractShop.address }}
{{ order.extractShop.region.province }}
{{ order.extractShop.region.city }}{{ order.extractShop.region.region }}
{{ order.extractShop.address }}
</view>
<view class="lookMap">
<image :src="$picUrl+'/static/user/address.png'" mode="" class="addressIcon"></image>
@ -53,7 +57,9 @@
<image :src="$picUrl+'/static/order/left.png'" mode="" class="rightIcon"></image>
</view>
</view>
<view class="tip" v-else @click="onSelectExtractPoint()">请选择门店<image :src="$picUrl+'/static/order/left.png'" mode=""></image></view>
<view class="tip" v-else @click="onSelectExtractPoint()">请选择门店<image
:src="$picUrl+'/static/order/left.png'" mode=""></image>
</view>
<view class="pickUp">
<view class="pickPeople">
<view class="title">
@ -118,6 +124,7 @@
<image :src="$picUrl+'/static/order/left.png'" mode="" class="leftIcon"></image>
</view>
<view class="goods" v-for="(item, index) in order.goodsList" :key="index">
<view class="goodsBox" :style="{'opacity': item.stockValue=='有货'?1:0.6 }">
<view class="goodsImg">
<image :src="item.goods_image" mode=""></image>
</view>
@ -140,6 +147,11 @@
x{{ item.total_num }}
</view>
</view>
<view style="color: red;font-size: 24rpx;margin-left: 182rpx;" v-if="item.stockValue=='无货'">
该商品暂时无货
</view>
</view>
</view>
<view class="timer">
<view class="youTime" style="width: 60rpx;">
@ -198,7 +210,8 @@
</view>
<view class="right">
<text class="totalNum">{{order.orderTotalNum}}合计</text>
<text class="allPrice">{{ order.orderPayPrice?Number(order.orderPayPrice):order.orderPayPrice }}</text>
<text
class="allPrice">{{ order.orderPayPrice?Number(order.orderPayPrice):order.orderPayPrice }}</text>
</view>
</view>
</view>
@ -239,7 +252,10 @@
<text class="type"></text>
<text class="price">{{order.orderPayPrice?Number(order.orderPayPrice):order.orderPayPrice}}</text>
</view>
<view class="btn" @click="onSubmitOrder()">
<view class="btn" @click="onSubmitOrder()" v-if="stockValue==true">
提交订单
</view>
<view class="btn" style="background: #cecece;" v-else>
提交订单
</view>
</view>
@ -251,7 +267,8 @@
<view class="coupon-list">
<scroll-view :scroll-y="true" style="height: 565rpx;">
<view class="coupon-item" v-for="(item, index) in order.couponList" :key="index">
<view class="item-wrapper" :class="[item.is_apply ? 'color-' + CouponColors[index % CouponColors.length] : 'color-gray']"
<view class="item-wrapper"
:class="[item.is_apply ? 'color-' + CouponColors[index % CouponColors.length] : 'color-gray']"
@click="handleSelectCoupon(index)">
<view class="coupon-type">{{ CouponTypeEnum[item.coupon_type].name }}</view>
<view class="tip dis-flex flex-dir-column flex-x-center">
@ -259,7 +276,8 @@
<text class="f-30"></text>
<text class="money">{{ item.reduce_price }}</text>
</view>
<text class="money" v-if="item.coupon_type == CouponTypeEnum.DISCOUNT.value">{{ item.discount }}</text>
<text class="money"
v-if="item.coupon_type == CouponTypeEnum.DISCOUNT.value">{{ item.discount }}</text>
<text class="pay-line">{{ item.min_price }}元可用</text>
</view>
<view class="split-line"></view>
@ -267,7 +285,8 @@
<view class="title">{{ item.name }}</view>
<view class="bottom dis-flex flex-y-center">
<view class="time flex-box">
<block v-if="item.start_time === item.end_time">{{ item.start_time }} 当天有效</block>
<block v-if="item.start_time === item.end_time">{{ item.start_time }} 当天有效
</block>
<block v-else>{{ item.start_time }}~{{ item.end_time }}</block>
</view>
</view>
@ -295,8 +314,14 @@
import * as SharpCheckoutApi from '@/api/sharp/checkout'
import * as BargainCheckoutApi from '@/api/bargain/checkout'
import * as GrouponCheckoutApi from '@/api/groupon/checkout'
import { CouponTypeEnum } from '@/common/enum/coupon'
import { OrderTypeEnum, DeliveryTypeEnum } from '@/common/enum/order'
import * as GoodsApi from '@/api/goods'
import {
CouponTypeEnum
} from '@/common/enum/coupon'
import {
OrderTypeEnum,
DeliveryTypeEnum
} from '@/common/enum/order'
const CouponColors = ['red', 'blue', 'violet', 'yellow']
@ -421,7 +446,13 @@
//
setting: {},
timer: "",
distance_unit: ""
distance_unit: "",
stockValue: true,
addressResult: {
province: '江苏省',
city: '南京市',
district: '玄武区'
}
}
},
@ -459,6 +490,55 @@
},
methods: {
async getGoodsStockInfor(order) {
let that = this
let step = 0
let list = [];
order.goodsList.forEach(item => {
list.push({
goods_id: item.goods_id,
num: item.total_num
})
});
if (that.curDelivery == DeliveryTypeEnum.EXTRACT.value) {
that.addressResult.province = order.extractShop ? order.extractShop.region.province : '江苏省'
that.addressResult.city = order.extractShop ? order.extractShop.region.city : '南京市'
that.addressResult.district = order.extractShop ? order.extractShop.region.region : '玄武区'
} else {
that.addressResult.province = order.address ? order.address.region.province : '江苏省'
that.addressResult.city = order.address ? order.address.region.city : '南京市'
that.addressResult.district = order.address ? order.address.region.region : '玄武区'
}
let params = {
list: list,
province: this.addressResult.province,
city: this.addressResult.city,
district: this.addressResult.district
}
let {
status,
message,
data
} = await GoodsApi.getGoodsStock(params);
if (status == 200) {
order.goodsList.forEach(item_1 => {
item_1.stockValue = '有货'
data.forEach(item_2 => {
if (item_1.goods_id == item_2.goods_id) {
item_1.stockValue = item_2.state
}
if (item_2.state == '无货') {
step++
}
});
});
if(step>0){
this.showToast('部分商品无货')
}
that.order = order
this.stockValue = step > 0 ? false : true
}
},
toStore() {
uni.navigateTo({
url: "/pages/news/consult/about"
@ -482,7 +562,11 @@
//
getOrderData() {
const app = this
const { options: { mode } } = app
const {
options: {
mode
}
} = app
//
const params = app.getRequestParam()
// api
@ -493,7 +577,11 @@
},
//
initData({ order, setting, personal }) {
initData({
order,
setting,
personal
}) {
const app = this
app.order = order
app.personal = personal
@ -513,12 +601,15 @@
if (app.phone === '') {
app.phone = order.lastExtract.phone
}
this.getGoodsStockInfor(app.order)
},
// api
getRequestParam() {
const app = this
const { options } = app
const {
options
} = app
//
const modeParam = getModeParam(options.mode, options)
// ()
@ -528,7 +619,10 @@
couponId: app.selectCouponId || 0,
isUsePoints: app.isUsePoints ? 1 : 0,
}
return { ...orderParam, ...modeParam }
return {
...orderParam,
...modeParam
}
},
//
@ -553,7 +647,9 @@
//
handleSelectCoupon(index) {
const app = this
const { couponList } = app.order
const {
couponList
} = app.order
//
const couponItem = couponList[index]
//
@ -581,17 +677,23 @@
//
onSelectAddress() {
this.$navTo('pages/address/index', { from: 'checkout' })
this.$navTo('pages/address/index', {
from: 'checkout'
})
},
//
onSelectExtractPoint() {
this.$navTo('pages/shop/extract', { selectedId: this.selectedShopId })
this.$navTo('pages/shop/extract', {
selectedId: this.selectedShopId
})
},
//
onTargetGoods(goodsId) {
this.$navTo('pages/goods/detail', { goodsId })
this.$navTo('pages/goods/detail', {
goodsId
})
},
//
@ -613,7 +715,9 @@
// :
const orderId = result.data.orderId
setTimeout(() => {
this.$navTo('pages/checkout/cashier/index', { orderId }, 'redirectTo')
this.$navTo('pages/checkout/cashier/index', {
orderId
}, 'redirectTo')
}, 100)
})
.catch(res => app.showToast(res.errMsg, 3000))
@ -629,7 +733,9 @@
//
getFormData() {
const app = this
const { options } = app
const {
options
} = app
//
const form = {
delivery: app.curDelivery,
@ -650,7 +756,10 @@
}
//
const modeParam = getModeParam(options.mode, options)
return { ...form, ...modeParam }
return {
...form,
...modeParam
}
},
//
@ -686,7 +795,10 @@
// toast
showToast(title, duration = 2000) {
this.$refs.uToast.show({ title, duration })
this.$refs.uToast.show({
title,
duration
})
}
}
@ -700,6 +812,7 @@
padding-bottom: 140rpx;
background: url('https://www.royaum.com.cn/static/news/login-bg.png') center top no-repeat;
background-size: 100% auto;
/* 优惠券选择 */
.popup__coupon {
background: #fff;
@ -879,6 +992,7 @@
margin: 30rpx auto 0;
position: relative;
height: 88rpx;
.toDoor {
width: 50%;
height: 74rpx;
@ -891,6 +1005,7 @@
float: left;
margin-top: 14rpx;
float: left;
&-on {
width: 350rpx;
height: 88rpx;
@ -906,6 +1021,7 @@
z-index: 2;
border-radius: 10rpx 10rpx 0 0;
}
&-dis {
border-radius: 10rpx 10rpx 0 0;
}
@ -922,6 +1038,7 @@
box-sizing: border-box;
}
.timer {
display: flex;
width: 700rpx;
@ -933,11 +1050,13 @@
align-items: center;
justify-content: space-between;
padding: 0 32rpx 0 28rpx;
.youTime {
font-size: 25rpx;
font-weight: 400;
color: #000000;
}
input {
flex: 1;
padding: 0 20rpx;
@ -946,10 +1065,12 @@
color: #000000;
text-align: right;
}
.leftImg {
font-size: 24rpx;
font-weight: 400;
color: #9E9E9E;
image {
width: 12rpx;
height: 18rpx;
@ -957,36 +1078,44 @@
}
}
}
.leftText {
font-size: 24rpx;
font-weight: 400;
color: #F21A1C;
line-height: 28rpx;
}
.shopAddress {
max-height: 260rpx;
padding-bottom: 20rpx;
overflow: hidden;
.tip {
font-size: 24rpx;
color: #F32E2E;
display: flex;
align-items: center;
justify-content: space-between;
image {
width: 12rpx;
height: 18rpx;
}
}
.pickUp {
display: flex;
justify-content: space-around;
margin-top: 16rpx;
.pickPeople {
flex: 1;
&:first-child {
margin-right: 20rpx;
}
.title {
font-size: 24rpx;
font-weight: 400;
@ -997,6 +1126,7 @@
margin-top: 10rpx;
display: flex;
align-items: center;
input {
width: 200rpx;
line-height: 60rpx;
@ -1004,6 +1134,7 @@
color: #2C2C2C;
display: block;
}
.edit {
width: 30rpx;
height: 30rpx;
@ -1012,10 +1143,12 @@
}
}
}
.a {
display: flex;
align-items: center;
justify-content: space-between;
.youTime {
font-size: 28rpx;
font-weight: 600;
@ -1026,6 +1159,7 @@
font-size: 24rpx;
font-weight: 400;
color: #F42B17;
image {
width: 12rpx;
height: 18rpx;
@ -1033,16 +1167,19 @@
}
}
}
.b {
font-size: 24rpx;
color: #838383;
line-height: 50rpx;
}
.lookMap {
display: flex;
align-items: center;
margin-top: 8rpx;
margin-bottom: 10rpx;
.addressIcon {
width: 23rpx;
height: 26rpx;
@ -1073,6 +1210,7 @@
}
}
}
.address {
width: 100%;
display: flex;
@ -1081,26 +1219,32 @@
justify-content: space-between;
padding: 0 22rpx 0 32rpx;
box-sizing: border-box;
.addAddress {
font-size: 28rpx;
font-weight: 500;
// color: #F32E2E;
color: #212121;
.info {
flex: 1;
.name {
font-size: 28rpx;
color: #212121;
text {
margin-left: 20rpx;
color: #666;
}
}
.detail {
margin-top: 10rpx;
font-size: 26rpx;
}
}
.tip {
font-size: 30rpx;
font-weight: 500;
@ -1111,6 +1255,7 @@
.leftImg {
width: 12rpx;
height: 18rpx;
image {
width: 100%;
height: 100%;
@ -1118,10 +1263,12 @@
}
}
}
.ziqu {
overflow: hidden;
padding: 0 22rpx 0 32rpx;
}
.preTime {
width: 700rpx;
height: 140rpx;
@ -1132,6 +1279,7 @@
justify-content: space-between;
padding: 34rpx 0 0 30rpx;
box-sizing: border-box;
.left {
.bagImg {
font-size: 24rpx;
@ -1139,6 +1287,7 @@
color: #000000;
display: flex;
align-items: center;
.bag {
width: 35rpx;
height: 35rpx;
@ -1188,13 +1337,18 @@
}
.goods {
margin-top: 28rpx;
.goodsBox {
display: flex;
align-items: center;
margin-top: 28rpx;
justify-content: space-between;
}
.goodsImg {
width: 162rpx;
height: 148rpx;
image {
width: 100%;
height: 100%;
@ -1204,6 +1358,7 @@
.goodsInfo {
margin-left: 20rpx;
max-width: 400rpx;
.goodsName {
min-height: 40rpx;
font-size: 28rpx;
@ -1220,17 +1375,20 @@
font-weight: 600;
color: #F21A1C;
line-height: 50rpx;
text {
font-size: 36rpx;
}
}
}
.goods-props {
font-size: 24rpx;
color: #999;
display: flex;
align-items: center;
}
.goodsNum {
font-size: 28rpx;
font-weight: 500;
@ -1269,6 +1427,7 @@
font-size: 28rpx;
color: #F42B17;
}
image {
width: 12rpx;
height: 18rpx;
@ -1373,6 +1532,7 @@
justify-content: space-between;
align-items: center;
z-index: 22;
.meetPrice {
margin-left: 26rpx;
font-size: 24rpx;

Loading…
Cancel
Save