Browse Source

体验优化

master
xpz2018 6 years ago
parent
commit
33f6cc0992
8 changed files with 21 additions and 13 deletions
  1. 9
      app.js
  2. 4
      components/refresher/index.js
  3. 1
      pages/mall/order-info/index.json
  4. 2
      pages/mall/order-info/index.wxml
  5. 7
      pages/mall/search-list/index.js
  6. 2
      pages/mall/search-list/index.wxml
  7. 7
      pages/mall/shops/index.js
  8. 2
      pages/mall/shops/index.wxml

9
app.js

@ -11,17 +11,10 @@ App({
}, },
onLaunch: function () { onLaunch: function () {
// 获取全局尺寸的一些配置
// var sysInfo = wx.getAccountInfoSync()
// if (sysInfo.miniProgram.appId == 'wx9e774103645f5c54') {
// this.httpUrl = 'http://192.168.0.106:9000'
// } else if (sysInfo.miniProgram.appId == 'wx5371934de00d6215') {
// this.httpUrl = 'https://mini.qniao.cn'
// }
if (this.release) { if (this.release) {
this.httpUrl = 'https://api.qniao.cn' this.httpUrl = 'https://api.qniao.cn'
} else { } else {
this.httpUrl = 'http://192.168.0.24:9000'
this.httpUrl = 'https://api-test.qniao.cn'
} }
wx.getSystemInfo({ wx.getSystemInfo({
success: e => { success: e => {

4
components/refresher/index.js

@ -27,6 +27,10 @@ let options = janComponent({
type: String, type: String,
value: "inherit" value: "inherit"
}, },
scrollTop: {
type: Number,
value: true
},
triggered: { triggered: {
type: Boolean, type: Boolean,
value: false value: false

1
pages/mall/order-info/index.json

@ -1,6 +1,7 @@
{ {
"usingComponents": { "usingComponents": {
"wux-button": "/components/button/index", "wux-button": "/components/button/index",
"wux-icon": "/components/icon/index",
"wux-input-number": "/components/input-number/index" "wux-input-number": "/components/input-number/index"
} }
} }

2
pages/mall/order-info/index.wxml

@ -18,7 +18,7 @@
<view class="flex flex-center"> <view class="flex flex-center">
<view class="text-gray" style="font-size:12px;margin-right:24rpx">{{orderInfo.viewNum}} 浏览</view> <view class="text-gray" style="font-size:12px;margin-right:24rpx">{{orderInfo.viewNum}} 浏览</view>
<button open-type="share" style="background-color: #fff;border-radius: 0;padding-left: 0px;padding-right: 0px;"> <button open-type="share" style="background-color: #fff;border-radius: 0;padding-left: 0px;padding-right: 0px;">
<image style="width:24rpx;height:24rpx" src="/assets/image/icon_share.png"></image>
<wux-icon type="md-share" color="#333333" size="16" />
</button> </button>
</view> </view>
</view> </view>

7
pages/mall/search-list/index.js

@ -16,6 +16,7 @@ Page({
loading: false, loading: false,
finished: false, finished: false,
requesting: false, requesting: false,
top: 0,
rearchStringList: [], rearchStringList: [],
taskList: [], taskList: [],
form: { form: {
@ -113,7 +114,11 @@ Page({
request.get('/bxe-mall/product/list', this.data.form).then(result => { request.get('/bxe-mall/product/list', this.data.form).then(result => {
//成功回调 //成功回调
this.data.requesting = false this.data.requesting = false
this.setData({ focus: false })
if(this.data.form.pageNum == 1){
this.setData({ focus: false, top: 0 })
} else {
this.setData({ focus: false })
}
if (result.data.records.length) { if (result.data.records.length) {
var respList = result.data.records var respList = result.data.records
let nowList = `taskList[${this.data.taskList.length}]` let nowList = `taskList[${this.data.taskList.length}]`

2
pages/mall/search-list/index.wxml

@ -35,7 +35,7 @@
<image class="img-empty" src="/assets/image/list_empty.png"></image> <image class="img-empty" src="/assets/image/list_empty.png"></image>
<view class="text-empty">暂无数据</view> <view class="text-empty">暂无数据</view>
</view> </view>
<scroll-view scroll-y style="height:{{height}}rpx;padding: 0rpx 24rpx" wx:else bindscrolltolower="fetchTaskList">
<scroll-view scroll-y scroll-top="{{top}}" style="height:{{height}}rpx;padding: 0rpx 24rpx" wx:else bindscrolltolower="fetchTaskList">
<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">
<view class="flex content" wx:for="{{pageItem}}" wx:key="index" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem"> <view class="flex content" wx:for="{{pageItem}}" wx:key="index" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem">
<wux-image width="{{120}}" height="{{120}}" wux-class="page-icon" src="{{item.litimgUrl}}" mode="{{aspectFill}}"> <wux-image width="{{120}}" height="{{120}}" wux-class="page-icon" src="{{item.litimgUrl}}" mode="{{aspectFill}}">

7
pages/mall/shops/index.js

@ -14,6 +14,7 @@ Page({
height: app.globalData.fragmentHeight - 180, height: app.globalData.fragmentHeight - 180,
CustomBar: app.globalData.CustomBar, CustomBar: app.globalData.CustomBar,
scroll: true, scroll: true,
top: 0,
pageIndex: 0, pageIndex: 0,
pageList: [], pageList: [],
tabs: [], tabs: [],
@ -107,7 +108,11 @@ Page({
fetchCheapList: function () { fetchCheapList: function () {
request.get('/bxe-mall/product/cheapList', this.data.form).then(result => { request.get('/bxe-mall/product/cheapList', this.data.form).then(result => {
//成功回调 //成功回调
this.setData({ loading: false, cheapList: result.data })
if(this.data.form.pageNum == 1){
this.setData({ loading: false, top: 0, cheapList: result.data })
} else {
this.setData({ loading: false, cheapList: result.data })
}
}) })
}, },
// 获取团购列表 // 获取团购列表

2
pages/mall/shops/index.wxml

@ -28,7 +28,7 @@
</view> </view>
<view style="height:200rpx;width:100%"></view> <view style="height:200rpx;width:100%"></view>
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{ requesting }}" bind:scrolltolower="fetchTaskList">
<refresh-view bind:refresh="onRefreshList" height="{{height}}" scrollTop="{{top}}" triggered="{{requesting}}" bind:scrolltolower="fetchTaskList">
<view wx:if="{{loading}}" class="page__bd page__bd_spacing"> <view wx:if="{{loading}}" class="page__bd page__bd_spacing">
<view class="sub-title"></view> <view class="sub-title"></view>

Loading…
Cancel
Save