Commit 574a3c97 by 施宇

111

parent c661025b
......@@ -17,8 +17,6 @@
"pages/list/xj/index",
"pages/tab/message/message",
"pages/tab/me/me",
"pages/search/index/index",
"pages/search/result/index",
"pages/form/xj/index",
"pages/detail/good/index",
"pages/detail/xj/index",
......@@ -46,6 +44,15 @@
"pages/person/invitationrecord/index",
"pages/form/report/index"
],
"subPackages": [
{
"root": "pages/search/",
"pages": [
"index/index",
"result/index"
]
}
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
......
......@@ -11,7 +11,8 @@ Page({
topInfo: null,
total: 0,
inquiryItemsId: "",
offerId:""
offerId: "",
isShowImg: false,
},
/**
......@@ -24,7 +25,7 @@ Page({
inquiryItemsId: inquiryItemsId,
offerId: offerId
});
},
getTopInfo: function () {
let me = this;
......@@ -89,14 +90,21 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({
priceList: null,
topInfo: null,
total: 0,
if (this.data.isShowImg) {
this.setData({
isShowImg: false
})
} else {
this.setData({
priceList: null,
topInfo: null,
total: 0,
});
this.getTopInfo();
this.getList()
}
})
this.getTopInfo();
this.getList()
},
/**
......@@ -154,5 +162,18 @@ Page({
}
},
previewImage: function () {
let img = this.data.topInfo.goods_images;
if (img) {
this.setData({
isShowImg: true
})
wx.previewImage({
urls: [img]
})
} else {
return
}
}
})
\ No newline at end of file
......@@ -50,7 +50,7 @@
<text class="c-com">{{topInfo.remark||'--'}}</text>
</view>
</view>
<image class="right" src="{{topInfo.goods_images?topInfo.goods_images:'/res/images/imgs/defaultgood.png'}}"></image>
<image class="right" src="{{topInfo.goods_images?topInfo.goods_images:'/res/images/imgs/defaultgood.png'}}" bindtap="previewImage"></image>
</view>
</view>
......
// pages/list/xj/index.js
import { getData } from '../../../utils/util.js';
import { apis } from '../../../utils/api.js';
import {
getData
} from '../../../utils/util.js';
import {
apis
} from '../../../utils/api.js';
Page({
/**
......@@ -9,8 +13,8 @@ Page({
data: {
priceList: null,
topInfo: null,
limit: 10,//每页的条数
p: 1,//当前页面
limit: 10, //每页的条数
p: 1, //当前页面
total: 0,
id: "",
isShowBottom: false,
......@@ -29,7 +33,10 @@ Page({
getTopInfo: function () {
let me = this;
let token = wx.getStorageSync('access_token');
getData(apis.inquiryInfo, 'get', { "inquiry_items_id/eq": me.data.id, token: token }, function (res) {
getData(apis.inquiryInfo, 'get', {
"inquiry_items_id/eq": me.data.id,
token: token
}, function (res) {
if (res.errcode == 0) {
me.setData({
topInfo: res.inquiry_list[me.data.id]
......@@ -44,7 +51,12 @@ Page({
getBjData: function () {
let me = this;
let token = wx.getStorageSync('access_token');
getData(apis.inquiryMyOffer, 'get', { "inquiry_items_id/eq": me.data.id, offset: me.data.limit, p: me.data.p, token: token }, function (res) {
getData(apis.inquiryMyOffer, 'get', {
"inquiry_items_id/eq": me.data.id,
offset: me.data.limit,
p: me.data.p,
token: token
}, function (res) {
if (res.errcode === 0) {
let newArr = [];
if (me.data.p > 1) {
......@@ -123,5 +135,15 @@ Page({
*/
onShareAppMessage: function () {
},
previewImage: function () {
let img = this.data.topInfo.goods_images;
if (img) {
wx.previewImage({
urls: [img]
})
} else {
return
}
}
})
\ No newline at end of file
......@@ -42,7 +42,7 @@
<text class="c-com">{{topInfo.remark||'--'}}</text>
</view>
</view>
<image class="right" src="{{topInfo.goods_images?topInfo.goods_images:'/res/images/imgs/defaultgood.png'}}"></image>
<image class="right" src="{{topInfo.goods_images?topInfo.goods_images:'/res/images/imgs/defaultgood.png'}}" bindtap="previewImage"></image>
</view>
</view>
</view>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment