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()
// console.log(systemInfo);
// console.log(accountInfo.miniProgram.envVersion)
//手动控制体验版环境的请求 true就依据下面index false就默认为2
const manual = false
const manual = true
const release = false
......@@ -114,7 +114,7 @@ const defaultMerchantId = {
}[target[index]]
const CONFIG_ENV_MAP={
'1':'develope',
'1':'develop',
'2':'test',
'3':'production',
'4':'beta'
......
......@@ -56,6 +56,13 @@ module.exports = {
...data,
});
},
// 首页--附近优惠 新接口
getLasteCommodity(data) {
return api.post({
method: `scrm.api.equity.main.page.carefully.chosen.page`,
...data,
});
},
// 首页--门店套餐
storePackage(data) {
return api.post({
......
......@@ -99,7 +99,7 @@ module.exports = {
/** 获取商品关联优惠券列表 */
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({
onHide() {},
globalData: {
ROUTE_QUERY: {},
goodsPageParam: {
appearance: 1,
pageSize: 0,
pageCount: 3
},
goodsLoaded: false,
goodsCommodityList: []
},
});
......@@ -18,23 +18,19 @@
<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 == 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 无限制 -->
<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 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>
<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" bind:tap="toDetail" wx:elif="{{item.couponStatus == 1}}">已领取</view>
<view class="already" wx:if="{{item.couponStatus == 1}}">
<glsx-image webp src="coupons/been.png" />
</view>
<view class="box_btn_color_been" bind:tap="toDetail" wx:elif="{{item.couponStatus == 1}}">已领取</view> -->
<block wx:if="{{item.couponStatus == 1}}">
<view class="already">
<glsx-image webp src="coupons/been.png" />
</view>
</block>
</block>
<block wx:else>
<view class="circle-selected" data-item="{{item}}" data-index="{{index}}" wx:if="{{item.isChecked}}" bindtap="selectCoupon">
......@@ -66,9 +62,6 @@
</view>
</block> -->
</scroll-view>
</view>
</view>
......
......@@ -11,7 +11,7 @@
display: flex;
align-items: center;
position: relative;
margin-top: 24rpx;
margin: 24rpx auto;
}
.gray {
......@@ -24,7 +24,7 @@
display: flex;
align-items: center;
position: relative;
margin-top: 24rpx;
margin-top: 24rpx auto 0;
}
.left_icon_box {
......
......@@ -184,7 +184,8 @@ Page({
goodsName: goodsInfo.goodsName,
retailPrice: goodsInfo.retailPrice,
stock: goodsInfo.goodsStock,
id: goodsInfo.id
id: goodsInfo.id,
unit: goodsInfo.unit
}
if (activeSku) {
let list = isActivity ? goodsInfo.specificationExtraList : goodsInfo.specificationDetailList
......@@ -394,31 +395,31 @@ Page({
})
},
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
id = id ? id : this.data.id
wx.p.api.shopmallApi
.getGoodscouponList({
id
wx.p.api.shopmallApi.getGoodscouponList({
goodsId: id,
merchantId
}).then(({
code,
data,
message
}) => {
let list = data && data.map(item => {
if (item.effectiveEndTime || item.effectiveStartTime) {
item.effectiveEndTime = new Date(item.effectiveEndTime).format('yyyy.MM.dd')
item.effectiveStartTime = new Date(item.effectiveStartTime).format('yyyy.MM.dd')
}
return item
})
.then(({
code,
data,
message
}) => {
let list =
data &&
data.map(item => {
if (item.effectiveEndTime || item.effectiveStartTime) {
item.effectiveEndTime = new Date(item.effectiveEndTime).format('yyyy.MM.dd')
item.effectiveStartTime = new Date(item.effectiveStartTime).format('yyyy.MM.dd')
}
return item
})
this.setData({
couponData: list
})
this.setData({
couponData: list
})
})
},
setMediaInfo(goodsDescList) {
wx.p.wxApi.getSystemInfo(({
......
......@@ -91,7 +91,12 @@
{{goodsInfo.skuPrice}}
<text class="unit up">起</text>
</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 class="old">¥{{goodsInfo.originalPrice}}</view>
</view>
......
......@@ -27,6 +27,7 @@ Page({
goodsList,
goodsInfo
} = options
if (goodsList.unit && goodsList.unit == '万') goodsList.retailPrice = goodsList.retailPrice * 10000
this.setData({
merchantName: goodsList.merchantName,
goodsInfo: goodsInfo,
......
{
"navigationBarTitleText": "确认订单"
"navigationBarTitleText": "确认订单",
"usingComponents": {
"stepper": "../shoppingCart/components/Stepper/Stepper"
}
}
\ No newline at end of file
......@@ -12,7 +12,7 @@ Page({
region: [],
address: '',
isDefault: 0,
platformObj:{}
platformObj: {}
}
},
onLoad: function (options) {
......@@ -41,7 +41,11 @@ Page({
},
useLocation() {
let {
currentAddress: { formatted_addresses, address_component, ad_info }
currentAddress: {
formatted_addresses,
address_component,
ad_info
}
} = this.data
this.setData({
'userObj.address': formatted_addresses.recommend,
......@@ -51,15 +55,20 @@ Page({
},
/**获取当前位置 */
getLocation() {
let { currentAddress } = this.data
let {
currentAddress
} = this.data
if (currentAddress) return
this.setData({
unauthorized: false
})
wx.getLocation({
type: 'gcj02'
})
.then(({ latitude, longitude }) => {
type: 'gcj02'
}).then(({
latitude,
longitude
}) => {
console.log(this)
this.setData({
current: true
})
......@@ -90,20 +99,29 @@ Page({
this.getLocation()
},
input(e) {
let { target } = e.currentTarget.dataset
let { value } = e.detail
let {
target
} = e.currentTarget.dataset
let {
value
} = e.detail
this.setData({
[`userObj.${target}`]: value
})
},
blur(e) {
let { value } = e.detail
let {
value
} = e.detail
this.setData({
'userObj.address': value
})
},
save() {
let { userObj, isChooseAddress } = this.data
let {
userObj,
isChooseAddress
} = this.data
try {
Object.keys(userObj).map(key => {
if (key == 'receiveName' && !userObj[key]) throw '请输入姓名'
......@@ -155,8 +173,13 @@ Page({
},
/**选择地区 */
chooseArea(e) {
let { value, code } = e.detail
let { userObj } = this.data
let {
value,
code
} = e.detail
let {
userObj
} = this.data
userObj.region = [value[0], value[1], value[2]]
userObj.provinceId = code[0]
userObj.cityId = code[1]
......@@ -170,43 +193,43 @@ Page({
'userObj.isDefault': this.data.userObj.isDefault == 0 ? 1 : 0
})
},
showSelect(){
showSelect() {
this.setData({
showAreaSelect:true
showAreaSelect: true
})
},
cancelProvince(){
cancelProvince() {
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
......@@ -18,6 +18,7 @@ Page({
wx.p.storage.rm('sessionId')
wx.p.storage.rm('isVIP')
wx.p.router.back(prevPage => {
wx.hideLoading()
prevPage.setData({
userInfo: null,
isMember: false,
......
const app = getApp()
import mapApi from '../../../utils/mapapi/mapapi'
Page({
options: {
......@@ -99,21 +100,13 @@ Page({
onPullDownRefresh() {
this.getShopPackage()
this.toCheckMember()
this.setData({
'pageParam.pageSize': 0,
loadingMore: false
},
() => {
let {
currentAddress
} = this.data
const {
lat,
lng
} = currentAddress.location
this.toGetCommodity(lat, lng)
}
)
app.globalData.goodsCommodityList = []
app.globalData.goodsPageParam.pageSize = 0
app.globalData.goodsLoaded = false
let { currentAddress } = this.data
if(!currentAddress) return
const { lat, lng } = currentAddress.location
this.toGetCommodity(lat, lng, false, 1)
},
onReachBottom() {
if (this.data.unauthorized) {
......@@ -123,25 +116,14 @@ Page({
return
}
let {
pageParam
currentAddress
} = this.data
pageParam.pageSize++
this.setData({
pageParam,
loadingMore: true
},
() => {
let {
currentAddress
} = this.data
const {
lat,
lng
} = currentAddress.location
this.toGetCommodity(lat, lng)
}
)
if(!currentAddress) return
const {
lat,
lng
} = currentAddress.location
this.toGetCommodity(lat, lng)
},
// 新版
openMorePack(e) {
......@@ -188,47 +170,34 @@ Page({
},
// 获取附近优惠数据
toGetCommodity(lat, lng, page) {
let {
pageParam,
loadingMore,
commodityList,
loadOver
} = this.data
toGetCommodity(lat, lng, firstLoad) {
let para = {
lat,
lng,
...pageParam
}
if (loadOver) {
return
}
if (page) {
para.pageSize = 0
...app.globalData.goodsPageParam
}
wx.p.api.equityApi.lasteCommodity(para).then(res => {
if (!res) {
if (app.globalData.goodsLoaded || (firstLoad && app.globalData.goodsPageParam?.length)) {
this.setData({
loadOver: true
commodityList: app.globalData.goodsCommodityList,
})
return
}
let tempArr = []
if (res) {
res.forEach(item => {
if (item.couponsGoodsList) {
}
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 = []
res.data.forEach(item => {
tempArr.push(item)
}
})
}
if (loadingMore) {
commodityList = commodityList.concat(tempArr)
}
this.setData({
commodityList: loadingMore ? commodityList : tempArr,
loadingMore: false,
loadOver: false
})
app.globalData.goodsCommodityList = app.globalData.goodsCommodityList.concat(tempArr)
app.globalData.goodsLoaded = false
this.setData({
commodityList: app.globalData.goodsCommodityList,
})
})
},
......
......@@ -122,7 +122,7 @@ Component({
animation: true
}, setTimeout(() => {
this.setBanner()
}, .8e3))
}, .3e3))
else this.setBanner()
},
async setBanner() {
......
......@@ -139,7 +139,7 @@
}
.true {
animation: close-live-box 1s forwards;
animation: close-live-box .5s forwards;
overflow: hidden;
}
......
......@@ -22,19 +22,19 @@ Component({
n.goodsStatistics.saleAmount = n.activityInfo.saleAmount
if (n.activityInfo.specificationExtraList && n.activityInfo.specificationExtraList.length) {
n.retailPrice = n.activityInfo.specificationExtraList[0].retailPrice
n.up = true
v.up = true
}
} else {
if (n.originalPrice) n.originalPrice = centsToyuan(n.originalPrice)
if (n.specificationDetailList && n.specificationDetailList.length) {
n.retailPrice = n.specificationDetailList[0].retailPrice
n.up = true
v.up = true
}
}
n.retailPrice = Number(centsToyuan(n.retailPrice)).toFixed(2)
if (n.retailPrice > 9999) {
n.retailPrice = Number(n.retailPrice / 10000).toFixed(2)
n.unit = '万'
v.unit = '万'
}
}
})
......
/* components/Goods/Goods.wxss */
.text-hide{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.Goods{
display: flex;
flex-direction: row;
......@@ -73,7 +78,10 @@
margin-top: 12rpx;
vertical-align: middle;
}
.item-box-time .text{
display: flex;
align-items: center;
}
.item-box-price{
margin-top: 12rpx;
display: flex;
......
......@@ -49,7 +49,6 @@
"tabSize": 2
},
"condition": {},
"libVersion": "2.24.4",
"packOptions": {
"ignore": [
{
......@@ -59,6 +58,5 @@
],
"include": []
},
"appid": "wx2a9f38eb8e39b823",
"projectname": "hmd-0817"
"appid": "wx2a9f38eb8e39b823"
}
\ 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!