Commit 60d21be9 by 前端

Merge branch 'scrm-v3.16.0' into 'master'

合并

See merge request !3
2 parents 7bd32fc2 4cd6e6e8
...@@ -15,7 +15,7 @@ const systemInfo = wx.getSystemInfoSync() ...@@ -15,7 +15,7 @@ const systemInfo = wx.getSystemInfoSync()
// console.log(systemInfo); // console.log(systemInfo);
// console.log(accountInfo.miniProgram.envVersion) // console.log(accountInfo.miniProgram.envVersion)
//手动控制体验版环境的请求 true就依据下面index false就默认为2 //手动控制体验版环境的请求 true就依据下面index false就默认为2
const manual = false const manual = true
const release = false const release = false
...@@ -114,7 +114,7 @@ const defaultMerchantId = { ...@@ -114,7 +114,7 @@ const defaultMerchantId = {
}[target[index]] }[target[index]]
const CONFIG_ENV_MAP={ const CONFIG_ENV_MAP={
'1':'develope', '1':'develop',
'2':'test', '2':'test',
'3':'production', '3':'production',
'4':'beta' '4':'beta'
......
...@@ -56,6 +56,13 @@ module.exports = { ...@@ -56,6 +56,13 @@ module.exports = {
...data, ...data,
}); });
}, },
// 首页--附近优惠 新接口
getLasteCommodity(data) {
return api.post({
method: `scrm.api.equity.main.page.carefully.chosen.page`,
...data,
});
},
// 首页--门店套餐 // 首页--门店套餐
storePackage(data) { storePackage(data) {
return api.post({ return api.post({
......
...@@ -99,7 +99,7 @@ module.exports = { ...@@ -99,7 +99,7 @@ module.exports = {
/** 获取商品关联优惠券列表 */ /** 获取商品关联优惠券列表 */
getGoodscouponList(data) { getGoodscouponList(data) {
return api.fetch('scrm.api.shopmall.weapp.goods.user.coupons.get', data) return api.fetch('scrm.api.coupon.seahorse.knife.goods.list', data)
}, },
/** 领取商品详情优惠券 */ /** 领取商品详情优惠券 */
......
...@@ -32,5 +32,12 @@ App({ ...@@ -32,5 +32,12 @@ App({
onHide() {}, onHide() {},
globalData: { globalData: {
ROUTE_QUERY: {}, ROUTE_QUERY: {},
goodsPageParam: {
appearance: 1,
pageSize: 0,
pageCount: 3
},
goodsLoaded: false,
goodsCommodityList: []
}, },
}); });
...@@ -18,24 +18,20 @@ ...@@ -18,24 +18,20 @@
<view class="title_text">{{item.couponName}}</view> <view class="title_text">{{item.couponName}}</view>
<view class="h4_text" wx:if="{{item.useBarriers == 1}}">无限制</view> <view class="h4_text" wx:if="{{item.useBarriers == 1}}">无限制</view>
<view class="h4_text" wx:if="{{item.useBarriers == 2}}">满减</view> <view class="h4_text" wx:if="{{item.useBarriers == 2}}">满减</view>
<!-- 未领取,effectiveType == 1,就显示effectiveDays有效,effectiveType == 2 显示时间段,effectiveType == 3 无限制 -->
<view class="h4_text drive" wx:if="{{item.couponStatus == 0&&item.effectiveType == 1}}">领取后{{item.effectiveDays}}天内有效</view>
<view class="h4_text drive" wx:if="{{item.couponStatus == 0&&item.effectiveType == 2}}">{{item.effectiveStartTime}}-{{item.effectiveEndTime}}</view>
<view class="h4_text drive" wx:if="{{item.couponStatus == 0&&item.effectiveType == 3}}">无期限</view>
<!-- 已领取,effectiveType == 1 或者2,都显示时间段,effectiveType == 3 无限制 --> <!-- 已领取,effectiveType == 1 或者2,都显示时间段,effectiveType == 3 无限制 -->
<view class="h4_text drive" wx:if="{{item.effectiveType == 1||item.effectiveType == 2 }}">{{item.receiveStartTime}}-{{item.receiveEndTime}}</view>
<view class="h4_text drive" wx:if="{{item.effectiveType == 3}}">无期限</view>
<view class="h4_text drive" wx:if="{{item.couponStatus == 1&&item.effectiveType == 1||item.couponStatus == 1&&item.effectiveType == 2 }}">{{item.effectiveStartTime}}-{{item.effectiveEndTime}}</view>
<view class="h4_text drive" wx:if="{{item.couponStatus == 1&&item.effectiveType == 3}}">无期限</view>
</view> </view>
<block wx:if="{{order == 0}}"> <block wx:if="{{order == 0}}">
<view class="box_btn box_btn_color box_btn_color_grey" bindtap="toDetail" wx:if="{{item.couponStatus == 0&&item.residueAmount >0}}" data-item="{{item}}" bindtap="getCoupon">领取</view> <!-- <view class="box_btn box_btn_color box_btn_color_grey" bindtap="toDetail" wx:if="{{item.couponStatus == 0&&item.residueAmount >0}}" data-item="{{item}}" bindtap="getCoupon">领取</view>
<view class="box_btn_color_been_gray " bind:tap="toDetail" wx:elif="{{item.couponStatus != 1&&item.residueAmount ==0}}">已抢光</view> <view class="box_btn_color_been_gray " bind:tap="toDetail" wx:elif="{{item.couponStatus != 1&&item.residueAmount ==0}}">已抢光</view>
<view class="box_btn_color_been" bind:tap="toDetail" wx:elif="{{item.couponStatus == 1}}">已领取</view> <view class="box_btn_color_been" bind:tap="toDetail" wx:elif="{{item.couponStatus == 1}}">已领取</view> -->
<view class="already" wx:if="{{item.couponStatus == 1}}"> <block wx:if="{{item.couponStatus == 1}}">
<view class="already">
<glsx-image webp src="coupons/been.png" /> <glsx-image webp src="coupons/been.png" />
</view> </view>
</block> </block>
</block>
<block wx:else> <block wx:else>
<view class="circle-selected" data-item="{{item}}" data-index="{{index}}" wx:if="{{item.isChecked}}" bindtap="selectCoupon"> <view class="circle-selected" data-item="{{item}}" data-index="{{index}}" wx:if="{{item.isChecked}}" bindtap="selectCoupon">
<glsx-image webp src="coupons/select.png" /> <glsx-image webp src="coupons/select.png" />
...@@ -66,9 +62,6 @@ ...@@ -66,9 +62,6 @@
</view> </view>
</block> --> </block> -->
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
position: relative; position: relative;
margin-top: 24rpx; margin: 24rpx auto;
} }
.gray { .gray {
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
position: relative; position: relative;
margin-top: 24rpx; margin-top: 24rpx auto 0;
} }
.left_icon_box { .left_icon_box {
......
...@@ -184,7 +184,8 @@ Page({ ...@@ -184,7 +184,8 @@ Page({
goodsName: goodsInfo.goodsName, goodsName: goodsInfo.goodsName,
retailPrice: goodsInfo.retailPrice, retailPrice: goodsInfo.retailPrice,
stock: goodsInfo.goodsStock, stock: goodsInfo.goodsStock,
id: goodsInfo.id id: goodsInfo.id,
unit: goodsInfo.unit
} }
if (activeSku) { if (activeSku) {
let list = isActivity ? goodsInfo.specificationExtraList : goodsInfo.specificationDetailList let list = isActivity ? goodsInfo.specificationExtraList : goodsInfo.specificationDetailList
...@@ -394,21 +395,21 @@ Page({ ...@@ -394,21 +395,21 @@ Page({
}) })
}, },
async getGoodscouponList(id) { async getGoodscouponList(id) {
const res = await wx.p.router.intercept(false) const res = await wx.p.router.intercept(false),
{
merchantId
} = wx.p.storage.get('merchant_info')
if (res) return if (res) return
id = id ? id : this.data.id id = id ? id : this.data.id
wx.p.api.shopmallApi wx.p.api.shopmallApi.getGoodscouponList({
.getGoodscouponList({ goodsId: id,
id merchantId
}) }).then(({
.then(({
code, code,
data, data,
message message
}) => { }) => {
let list = let list = data && data.map(item => {
data &&
data.map(item => {
if (item.effectiveEndTime || item.effectiveStartTime) { if (item.effectiveEndTime || item.effectiveStartTime) {
item.effectiveEndTime = new Date(item.effectiveEndTime).format('yyyy.MM.dd') item.effectiveEndTime = new Date(item.effectiveEndTime).format('yyyy.MM.dd')
item.effectiveStartTime = new Date(item.effectiveStartTime).format('yyyy.MM.dd') item.effectiveStartTime = new Date(item.effectiveStartTime).format('yyyy.MM.dd')
......
...@@ -91,7 +91,12 @@ ...@@ -91,7 +91,12 @@
{{goodsInfo.skuPrice}} {{goodsInfo.skuPrice}}
<text class="unit up">起</text> <text class="unit up">起</text>
</block> </block>
<block wx:else>{{goodsInfo.retailPrice}}</block> <block wx:else>
{{goodsInfo.retailPrice}}
<block wx:if="{{goodsInfo.unit}}">
<text class="unit">{{goodsInfo.unit}}</text>
</block>
</block>
</view> </view>
<view class="old">¥{{goodsInfo.originalPrice}}</view> <view class="old">¥{{goodsInfo.originalPrice}}</view>
</view> </view>
......
...@@ -27,6 +27,7 @@ Page({ ...@@ -27,6 +27,7 @@ Page({
goodsList, goodsList,
goodsInfo goodsInfo
} = options } = options
if (goodsList.unit && goodsList.unit == '万') goodsList.retailPrice = goodsList.retailPrice * 10000
this.setData({ this.setData({
merchantName: goodsList.merchantName, merchantName: goodsList.merchantName,
goodsInfo: goodsInfo, goodsInfo: goodsInfo,
......
{ {
"navigationBarTitleText": "确认订单" "navigationBarTitleText": "确认订单",
"usingComponents": {
"stepper": "../shoppingCart/components/Stepper/Stepper"
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -12,7 +12,7 @@ Page({ ...@@ -12,7 +12,7 @@ Page({
region: [], region: [],
address: '', address: '',
isDefault: 0, isDefault: 0,
platformObj:{} platformObj: {}
} }
}, },
onLoad: function (options) { onLoad: function (options) {
...@@ -41,7 +41,11 @@ Page({ ...@@ -41,7 +41,11 @@ Page({
}, },
useLocation() { useLocation() {
let { let {
currentAddress: { formatted_addresses, address_component, ad_info } currentAddress: {
formatted_addresses,
address_component,
ad_info
}
} = this.data } = this.data
this.setData({ this.setData({
'userObj.address': formatted_addresses.recommend, 'userObj.address': formatted_addresses.recommend,
...@@ -51,15 +55,20 @@ Page({ ...@@ -51,15 +55,20 @@ Page({
}, },
/**获取当前位置 */ /**获取当前位置 */
getLocation() { getLocation() {
let { currentAddress } = this.data let {
currentAddress
} = this.data
if (currentAddress) return if (currentAddress) return
this.setData({ this.setData({
unauthorized: false unauthorized: false
}) })
wx.getLocation({ wx.getLocation({
type: 'gcj02' type: 'gcj02'
}) }).then(({
.then(({ latitude, longitude }) => { latitude,
longitude
}) => {
console.log(this)
this.setData({ this.setData({
current: true current: true
}) })
...@@ -90,20 +99,29 @@ Page({ ...@@ -90,20 +99,29 @@ Page({
this.getLocation() this.getLocation()
}, },
input(e) { input(e) {
let { target } = e.currentTarget.dataset let {
let { value } = e.detail target
} = e.currentTarget.dataset
let {
value
} = e.detail
this.setData({ this.setData({
[`userObj.${target}`]: value [`userObj.${target}`]: value
}) })
}, },
blur(e) { blur(e) {
let { value } = e.detail let {
value
} = e.detail
this.setData({ this.setData({
'userObj.address': value 'userObj.address': value
}) })
}, },
save() { save() {
let { userObj, isChooseAddress } = this.data let {
userObj,
isChooseAddress
} = this.data
try { try {
Object.keys(userObj).map(key => { Object.keys(userObj).map(key => {
if (key == 'receiveName' && !userObj[key]) throw '请输入姓名' if (key == 'receiveName' && !userObj[key]) throw '请输入姓名'
...@@ -155,8 +173,13 @@ Page({ ...@@ -155,8 +173,13 @@ Page({
}, },
/**选择地区 */ /**选择地区 */
chooseArea(e) { chooseArea(e) {
let { value, code } = e.detail let {
let { userObj } = this.data value,
code
} = e.detail
let {
userObj
} = this.data
userObj.region = [value[0], value[1], value[2]] userObj.region = [value[0], value[1], value[2]]
userObj.provinceId = code[0] userObj.provinceId = code[0]
userObj.cityId = code[1] userObj.cityId = code[1]
...@@ -170,43 +193,43 @@ Page({ ...@@ -170,43 +193,43 @@ Page({
'userObj.isDefault': this.data.userObj.isDefault == 0 ? 1 : 0 'userObj.isDefault': this.data.userObj.isDefault == 0 ? 1 : 0
}) })
}, },
showSelect(){ showSelect() {
this.setData({ this.setData({
showAreaSelect:true showAreaSelect: true
}) })
}, },
cancelProvince(){ cancelProvince() {
this.setData({ this.setData({
showAreaSelect:false showAreaSelect: false
}) })
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { }, onReady: function () {},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { }, onShow: function () {},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { }, onHide: function () {},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { }, onUnload: function () {},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { }, onPullDownRefresh: function () {},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { } onReachBottom: function () {}
}) })
\ No newline at end of file \ No newline at end of file
...@@ -18,6 +18,7 @@ Page({ ...@@ -18,6 +18,7 @@ Page({
wx.p.storage.rm('sessionId') wx.p.storage.rm('sessionId')
wx.p.storage.rm('isVIP') wx.p.storage.rm('isVIP')
wx.p.router.back(prevPage => { wx.p.router.back(prevPage => {
wx.hideLoading()
prevPage.setData({ prevPage.setData({
userInfo: null, userInfo: null,
isMember: false, isMember: false,
......
const app = getApp()
import mapApi from '../../../utils/mapapi/mapapi' import mapApi from '../../../utils/mapapi/mapapi'
Page({ Page({
options: { options: {
...@@ -99,21 +100,13 @@ Page({ ...@@ -99,21 +100,13 @@ Page({
onPullDownRefresh() { onPullDownRefresh() {
this.getShopPackage() this.getShopPackage()
this.toCheckMember() this.toCheckMember()
this.setData({ app.globalData.goodsCommodityList = []
'pageParam.pageSize': 0, app.globalData.goodsPageParam.pageSize = 0
loadingMore: false app.globalData.goodsLoaded = false
}, let { currentAddress } = this.data
() => { if(!currentAddress) return
let { const { lat, lng } = currentAddress.location
currentAddress this.toGetCommodity(lat, lng, false, 1)
} = this.data
const {
lat,
lng
} = currentAddress.location
this.toGetCommodity(lat, lng)
}
)
}, },
onReachBottom() { onReachBottom() {
if (this.data.unauthorized) { if (this.data.unauthorized) {
...@@ -123,25 +116,14 @@ Page({ ...@@ -123,25 +116,14 @@ Page({
return return
} }
let { let {
pageParam
} = this.data
pageParam.pageSize++
this.setData({
pageParam,
loadingMore: true
},
() => {
let {
currentAddress currentAddress
} = this.data } = this.data
if(!currentAddress) return
const { const {
lat, lat,
lng lng
} = currentAddress.location } = currentAddress.location
this.toGetCommodity(lat, lng) this.toGetCommodity(lat, lng)
}
)
}, },
// 新版 // 新版
openMorePack(e) { openMorePack(e) {
...@@ -188,46 +170,33 @@ Page({ ...@@ -188,46 +170,33 @@ Page({
}, },
// 获取附近优惠数据 // 获取附近优惠数据
toGetCommodity(lat, lng, page) { toGetCommodity(lat, lng, firstLoad) {
let {
pageParam,
loadingMore,
commodityList,
loadOver
} = this.data
let para = { let para = {
lat, lat,
lng, lng,
...pageParam ...app.globalData.goodsPageParam
}
if (loadOver) {
return
} }
if (page) { if (app.globalData.goodsLoaded || (firstLoad && app.globalData.goodsPageParam?.length)) {
para.pageSize = 0
}
wx.p.api.equityApi.lasteCommodity(para).then(res => {
if (!res) {
this.setData({ this.setData({
loadOver: true commodityList: app.globalData.goodsCommodityList,
}) })
return return
} }
para.pageOffset = para.pageSize
wx.p.api.equityApi.getLasteCommodity(para).then(res => {
if (!res?.data?.length) {
app.globalData.goodsLoaded = true
return
}
app.globalData.goodsPageParam.pageSize = res.pageOffset
let tempArr = [] let tempArr = []
if (res) { res.data.forEach(item => {
res.forEach(item => {
if (item.couponsGoodsList) {
tempArr.push(item) tempArr.push(item)
}
}) })
} app.globalData.goodsCommodityList = app.globalData.goodsCommodityList.concat(tempArr)
if (loadingMore) { app.globalData.goodsLoaded = false
commodityList = commodityList.concat(tempArr)
}
this.setData({ this.setData({
commodityList: loadingMore ? commodityList : tempArr, commodityList: app.globalData.goodsCommodityList,
loadingMore: false,
loadOver: false
}) })
}) })
}, },
......
...@@ -122,7 +122,7 @@ Component({ ...@@ -122,7 +122,7 @@ Component({
animation: true animation: true
}, setTimeout(() => { }, setTimeout(() => {
this.setBanner() this.setBanner()
}, .8e3)) }, .3e3))
else this.setBanner() else this.setBanner()
}, },
async setBanner() { async setBanner() {
......
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
} }
.true { .true {
animation: close-live-box 1s forwards; animation: close-live-box .5s forwards;
overflow: hidden; overflow: hidden;
} }
......
...@@ -22,19 +22,19 @@ Component({ ...@@ -22,19 +22,19 @@ Component({
n.goodsStatistics.saleAmount = n.activityInfo.saleAmount n.goodsStatistics.saleAmount = n.activityInfo.saleAmount
if (n.activityInfo.specificationExtraList && n.activityInfo.specificationExtraList.length) { if (n.activityInfo.specificationExtraList && n.activityInfo.specificationExtraList.length) {
n.retailPrice = n.activityInfo.specificationExtraList[0].retailPrice n.retailPrice = n.activityInfo.specificationExtraList[0].retailPrice
n.up = true v.up = true
} }
} else { } else {
if (n.originalPrice) n.originalPrice = centsToyuan(n.originalPrice) if (n.originalPrice) n.originalPrice = centsToyuan(n.originalPrice)
if (n.specificationDetailList && n.specificationDetailList.length) { if (n.specificationDetailList && n.specificationDetailList.length) {
n.retailPrice = n.specificationDetailList[0].retailPrice n.retailPrice = n.specificationDetailList[0].retailPrice
n.up = true v.up = true
} }
} }
n.retailPrice = Number(centsToyuan(n.retailPrice)).toFixed(2) n.retailPrice = Number(centsToyuan(n.retailPrice)).toFixed(2)
if (n.retailPrice > 9999) { if (n.retailPrice > 9999) {
n.retailPrice = Number(n.retailPrice / 10000).toFixed(2) n.retailPrice = Number(n.retailPrice / 10000).toFixed(2)
n.unit = '万' v.unit = '万'
} }
} }
}) })
......
/* components/Goods/Goods.wxss */ /* components/Goods/Goods.wxss */
.text-hide{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.Goods{ .Goods{
display: flex; display: flex;
flex-direction: row; flex-direction: row;
...@@ -73,7 +78,10 @@ ...@@ -73,7 +78,10 @@
margin-top: 12rpx; margin-top: 12rpx;
vertical-align: middle; vertical-align: middle;
} }
.item-box-time .text{
display: flex;
align-items: center;
}
.item-box-price{ .item-box-price{
margin-top: 12rpx; margin-top: 12rpx;
display: flex; display: flex;
......
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
"tabSize": 2 "tabSize": 2
}, },
"condition": {}, "condition": {},
"libVersion": "2.24.4",
"packOptions": { "packOptions": {
"ignore": [ "ignore": [
{ {
...@@ -59,6 +58,5 @@ ...@@ -59,6 +58,5 @@
], ],
"include": [] "include": []
}, },
"appid": "wx2a9f38eb8e39b823", "appid": "wx2a9f38eb8e39b823"
"projectname": "hmd-0817"
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!