Browse Source

no message

master
xpz2018 5 years ago
parent
commit
cf5a75d769
8 changed files with 36 additions and 25 deletions
  1. BIN
      assets/image/icon_adv.webp
  2. 4
      pages/index/index.js
  3. 2
      pages/mall/order-offer/index.js
  4. 4
      pages/mall/order-offer/index.wxml
  5. 25
      pages/mall/shops/index.js
  6. 20
      pages/mall/shops/index.wxml
  7. 2
      pages/mall/shops/index.wxss
  8. 4
      utils/request.js

BIN
assets/image/icon_adv.webp

Before After

4
pages/index/index.js

@ -64,8 +64,8 @@ Page({
data: { openid: app.globalData.openId }, data: { openid: app.globalData.openId },
method: 'POST', method: 'POST',
success: function (result) { success: function (result) {
if (result.data.code == 0 && result.data.data.token) {
app.globalData.token = result.data.data.token
if (result.data.code == 0 && result.data.data.userToken) {
app.globalData.token = result.data.data.userToken
} }
}, },
complete: function () { complete: function () {

2
pages/mall/order-offer/index.js

@ -19,7 +19,7 @@ Page({
onLoad: function (options) { onLoad: function (options) {
if (options.json) { if (options.json) {
var form = JSON.parse(options.json) var form = JSON.parse(options.json)
form.payType = form.sellMode == 1 ? 1 : 3
form.payType = form.sellMode == 2 ? 3 : 1
// form.totalPrice = float.accAdd(float.accMul(form.unitPrice, form.number), form.dividePrice) // form.totalPrice = float.accAdd(float.accMul(form.unitPrice, form.number), form.dividePrice)
form.totalPrice = float.accMul(form.unitPrice, form.number).toFixed(2) form.totalPrice = float.accMul(form.unitPrice, form.number).toFixed(2)
form.preAmount = float.accMul(float.accMul(form.unitPrice, form.number), 0.1).toFixed(2) form.preAmount = float.accMul(float.accMul(form.unitPrice, form.number), 0.1).toFixed(2)

4
pages/mall/order-offer/index.wxml

@ -76,14 +76,14 @@
<text class="cuIcon-titles text-blue"></text> <text class="cuIcon-titles text-blue"></text>
<view style="color:black;font-size:32rpx">付款方式</view> <view style="color:black;font-size:32rpx">付款方式</view>
</view> </view>
<view class="flex flex-justify" style="height:80rpx" data-index="1" bindtap="checkMode" wx:if="{{form.sellMode == 1}}">
<view class="flex flex-justify" style="height:80rpx" data-index="1" bindtap="checkMode" wx:if="{{form.sellMode == 1 || form.sellMode == 3}}">
<view class="flex align-end"> <view class="flex align-end">
<text style="font-size:28rpx;line-height: 30rpx">预付定金</text> <text style="font-size:28rpx;line-height: 30rpx">预付定金</text>
<text class="offer-hint" style="margin-left:10rpx;line-height: 30rpx;text-align: bottom">预付款10%,余款货到付款</text> <text class="offer-hint" style="margin-left:10rpx;line-height: 30rpx;text-align: bottom">预付款10%,余款货到付款</text>
</view> </view>
<text class="cuIcon-{{form.payType==1?'roundcheckfill':'roundcheck'}} text-{{form.payType==1?'blue':'grey'}}" style="font-size:36rpx"></text> <text class="cuIcon-{{form.payType==1?'roundcheckfill':'roundcheck'}} text-{{form.payType==1?'blue':'grey'}}" style="font-size:36rpx"></text>
</view> </view>
<view class="flex flex-justify" style="height:80rpx" data-index="2" bindtap="checkMode" wx:if="{{form.sellMode == 1}}">
<view class="flex flex-justify" style="height:80rpx" data-index="2" bindtap="checkMode" wx:if="{{form.sellMode == 1 || form.sellMode == 3}}">
<view style="font-size:28rpx">全额支付</view> <view style="font-size:28rpx">全额支付</view>
<text class="cuIcon-{{form.payType==2?'roundcheckfill':'roundcheck'}} text-{{form.payType==2?'blue':'grey'}}" style="font-size:36rpx"></text> <text class="cuIcon-{{form.payType==2?'roundcheckfill':'roundcheck'}} text-{{form.payType==2?'blue':'grey'}}" style="font-size:36rpx"></text>
</view> </view>

25
pages/mall/shops/index.js

@ -51,7 +51,7 @@ Page({
} }
this.fetchTabList() this.fetchTabList()
this.fetchCheapList() this.fetchCheapList()
this.fetchTaskList()
// this.fetchTaskList()
}, },
onReady: function(){ onReady: function(){
wx.getSystemInfo({ wx.getSystemInfo({
@ -119,17 +119,28 @@ Page({
finished: false finished: false
}) })
this.fetchCheapList() this.fetchCheapList()
this.fetchTaskList()
// this.fetchTaskList()
}, },
// 获取特价列表 // 获取特价列表
fetchCheapList: function () { fetchCheapList: function () {
request.get('/bxe-mall/product/cheapList', this.data.form).then(result => {
if (this.data.requesting || this.data.finished) {
return
}
if(this.data.loading){
this.data.requesting = true
} else {
this.setData({ requesting: true })
}
request.get('/bxe-mall/product/indexList', this.data.form).then(result => {
//成功回调 //成功回调
if(this.data.form.pageNum == 1){ if(this.data.form.pageNum == 1){
this.setData({ loading: false, top: 0, cheapList: result.data })
this.setData({ requesting: false, loading: false, finished: true, top: 0, cheapList: result.data })
} else { } else {
this.setData({ loading: false, cheapList: result.data })
this.setData({ requesting: false, loading: false, finished: true, cheapList: result.data })
} }
}).catch(err => {
//异常回调
this.setData({ requesting: false, loading: false, finished: true })
}) })
}, },
// 获取团购列表 // 获取团购列表
@ -208,8 +219,8 @@ Page({
data: { openid: app.globalData.openId }, data: { openid: app.globalData.openId },
method: 'POST', method: 'POST',
success: function (result) { success: function (result) {
if (result.data.code == 0 && result.data.data.token) {
app.globalData.token = result.data.data.token
if (result.data.code == 0 && result.data.data.userToken) {
app.globalData.token = result.data.data.userToken
} }
}, },
complete: function () { complete: function () {

20
pages/mall/shops/index.wxml

@ -103,15 +103,15 @@
</view> </view>
<view wx:else style="padding: 0rpx 24rpx"> <view wx:else style="padding: 0rpx 24rpx">
<image src="/assets/image/icon_adv.webp" class="swiper-image" mode="aspectFill" style="margin-top:24rpx"></image>
<view wx:if="{{cheapList.length}}">
<view class="flex nav-li">
<view class="shadow">特价</view>
<view style="font-size:36rpx;color:white">专区</view>
<image src="https://p.pstatp.com/origin/ff4c00012a45f918338e" class="swiper-image" mode="aspectFill" style="margin-top:24rpx"></image>
<view wx:for-item="item" wx:for="{{cheapList}}" wx:key="index">
<view class="flex nav-li" wx:if="{{item.list.length}}">
<view class="shadow">{{item.name}}</view>
<!-- <view style="font-size:36rpx;color:white">专区</view> -->
<view class="v-driver"></view> <view class="v-driver"></view>
<view class="nav-title">限时限量 售完即止</view>
<view class="nav-title">{{item.summary}}</view>
</view> </view>
<page-list dataList="{{cheapList}}"></page-list>
<page-list dataList="{{item.list}}"></page-list>
</view> </view>
<view wx:if="{{taskList.length}}"> <view wx:if="{{taskList.length}}">
<view class="flex nav-li"> <view class="flex nav-li">
@ -121,11 +121,11 @@
<view class="nav-title">大厂品牌 质量保证</view> <view class="nav-title">大厂品牌 质量保证</view>
</view> </view>
</view> </view>
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{taskList}}" wx:key="pageIndex">
<!-- <view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{taskList}}" wx:key="pageIndex">
<page-list dataList="{{pageItem}}"></page-list> <page-list dataList="{{pageItem}}"></page-list>
</view>
</view> -->
<!--加载更多的UI--> <!--加载更多的UI-->
<wux-divider wx:if="{{form.pageNum>1}}">
<wux-divider>
<view class="loadmore"> <view class="loadmore">
<text class="icon--refresher" wx:if="{{!finished}}"></text> <text class="icon--refresher" wx:if="{{!finished}}"></text>
<text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text> <text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text>

2
pages/mall/shops/index.wxss

@ -50,7 +50,7 @@
} }
.shadow { .shadow {
width: 36px;
width: 72px;
height: 25px; height: 25px;
font-size: 18px; font-size: 18px;
font-family: PingFang-SC-Medium, PingFang-SC; font-family: PingFang-SC-Medium, PingFang-SC;

4
utils/request.js

@ -72,8 +72,8 @@ function loginByOpenId(form, resolve, reject) {
data: form, data: form,
method: 'POST', method: 'POST',
success: function (result) { success: function (result) {
if (result.data.code == 0 && result.data.data.token) {
app.globalData.token = result.data.data.token
if (result.data.code == 0 && result.data.data.userToken) {
app.globalData.token = result.data.data.userToken
wx.showToast({ wx.showToast({
title: '登录成功', title: '登录成功',
icon: "none" icon: "none"

Loading…
Cancel
Save