仿互站小程序

This commit is contained in:
Drawfans
2020-06-09 16:17:23 +08:00
commit 7bfd53851e
321 changed files with 22890 additions and 0 deletions

223
pages/member/cart.js Normal file
View File

@@ -0,0 +1,223 @@
function t(t, a, e) {
return a in t ? Object.defineProperty(t, a, {
value: e,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[a] = e, t;
}
var a = require("../../common/common.js");
Page({
data: {
loading: !1,
Form: {},
ListSh: {},
getdata: "",
listdata: {},
popup: [],
title: "",
tabCurrent: 0,
MyJifen: 0,
CartMoney: 0,
CartCount: 0,
CartTotal: 0,
CartPost: {},
Allchecked: !0,
spin: !0,
timestamp: 0,
previewList: []
},
onReachBottom: function() {
var t = this, e = this.data.listdata;
!t.data.loading && e.CurPage < e.TotalPage && (t.setData({
"getdata.page": 1 * t.data.getdata.page + 1,
spin: !0,
timestamp: a.timestamp()
}), a.GetList(function(a) {
t.create_cartList("init");
}));
},
create_cartList: function(t) {
var e = this, o = e.data.listdata.list, i = [], n = [], s = [], d = [], r = 0, c = 0, g = 0, l = {};
for (var h in o) {
var u = o[h];
for (var f in u.goods) {
var m = u.goods[f];
m.gchecked && (i[r] = m.bh, n[r] = m.yjifen, s[r] = m.type, d[r] = m.achecked ? 1 : 0,
c += Number(m.money), m.achecked && (c += Number(m.amoney)), m.yjifen > 0 && (c -= Number((.1 * m.yjifen).toFixed(2))),
"init" != t && m["m_" + m.bh] && (l["m_" + m.bh] = m["m_" + m.bh], l["z_" + m.bh] = m["z_" + m.bh]),
r++), m.gdisabled || g++;
}
}
var y = {
id: i.join("|"),
jf: n.join("|"),
ty: s.join("|"),
az: d.join("|")
};
"init" == t ? e.setData({
CartMoney: c,
CartCount: r,
CartTotal: g,
CartPost: y,
spin: !1
}) : (e.setData({
postIng: !0
}), a.HttpMember({
url: "post/cart",
data: Object.assign(y, l)
}, function(t) {
e.setData({
postIng: !1
}), "url" == t.action && a.Lay(t);
}));
},
AllChange: function(a) {
if (a.detail && (a.detail.checked || this.data.CartTotal == this.data.CartCount && this.data.CartCount > 0)) {
var e = this, o = a.detail.checked, i = e.data.listdata.list;
for (var n in i) for (var s in i[n].goods) o !== i[n].goods[s].gchecked && e.goodChange({
detail: {
name: "good_" + n + "_" + i[n].goods[s].bh,
checked: o
}
});
e.setData(t({
ListSh: {},
Allchecked: o
}, "listdata.list", i));
}
},
ListSh: function(a) {
var e = this, o = a.currentTarget.id, i = "ListSh." + o, n = wx.createAnimation({
duration: 200,
timingFunction: "ease",
delay: 0
});
e.data.ListSh[o] ? (n.translateX("100%").step(), setTimeout(function() {
e.setData(t({}, i, !1));
}, 201)) : (e.setData(t({}, i, !0)), n.translateX("0").step()), this.setData(t({}, i, n.export()));
},
action: function(e) {
var o = this, i = o.data.listdata.list, n = e.currentTarget.dataset, s = n.action, d = n.id, r = n.gid, c = i[d].goods, g = c[r], l = i[d].sell, h = c.length <= 1;
a.PostMember("post/" + s, {
action: s,
bh: g.bh,
tab: g.type
}, function(a) {
if (1 != a.state) return !1;
var e = wx.createAnimation({
duration: 300,
timingFunction: "ease",
delay: 0
});
e.translateX("120%").step(), o.setData(t({}, "delAnimation." + (h ? l : g.bh), e.export())),
setTimeout(function() {
h ? i.splice(d, 1) : i[d].goods.splice(r, 1);
var a = t({
delAnimation: {}
}, "listdata.list", i);
h && (a.ListSh = {}), o.setData(a), o.create_cartList("init");
}, 301);
});
},
goodChange: function(a) {
if (a.detail) {
var e = this, o = a.detail.checked, i = a.detail.name.split("_"), n = i[0], s = i[1], d = i[2], r = e.data.listdata.list[s], c = {
no: 0,
ok: 0
}, g = "listdata.list[" + s + "]";
if ("install" == n || "jifen" == n) for (var l in r.goods) r.goods[l].bh != d || r.goods[l].gdisabled || (o && !r.goods[l].gchecked && e.goodChange({
detail: {
name: "good_" + s + "_" + d,
checked: o
}
}), "install" == n ? (r.goods[l].achecked = o, e.setData({
CartMoney: e.data.CartMoney + Number(o ? r.goods[l].amoney : -1 * r.goods[l].amoney)
})) : (r.goods[l].jchecked = o, o ? (r.goods[l].yjifen = e.data.MyJifen <= r.goods[l].kjifen ? e.data.MyJifen : r.goods[l].kjifen,
e.setData({
MyJifen: e.data.MyJifen - r.goods[l].yjifen,
CartMoney: e.data.CartMoney - Number((.1 * r.goods[l].yjifen).toFixed(2))
})) : (e.setData({
MyJifen: e.data.MyJifen + r.goods[l].yjifen,
CartMoney: e.data.CartMoney + Number((.1 * r.goods[l].yjifen).toFixed(2))
}), r.goods[l].yjifen = 0))); else if ("good" == n) {
for (var l in r.goods) if (!r.goods[l].gdisabled) {
if (r.goods[l].bh == d) {
var h = r.goods[l].achecked, u = r.goods[l].jchecked;
r.goods[l].gchecked = o, o ? (e.setData({
CartCount: e.data.CartCount + 1,
CartMoney: e.data.CartMoney + Number(r.goods[l].money)
}), r.goods[l].achecked || (r.goods[l].achecked = r.goods[l].amoney <= 0)) : (e.setData({
CartCount: e.data.CartCount - 1,
CartMoney: e.data.CartMoney - Number(r.goods[l].money)
}), r.goods[l].achecked = !1, r.goods[l].jchecked = !1), r.goods[l].achecked !== h && e.goodChange({
detail: {
name: "install_" + s + "_" + d,
checked: r.goods[l].achecked
}
}), r.goods[l].jchecked !== u && e.goodChange({
detail: {
name: "jifen_" + s + "_" + d,
checked: r.goods[l].jchecked
}
});
}
r.goods[l].gchecked ? c.ok++ : c.no++;
}
e.data.CartTotal > e.data.CartCount && e.data.Allchecked && e.setData({
Allchecked: !1
}), e.data.CartTotal != e.data.CartCount || e.data.Allchecked || e.setData({
Allchecked: !0
}), 0 != c.ok && 0 != c.no || (r.schecked = 0 === c.no);
} else if ("shop" == n) {
for (var l in r.goods) r.goods[l].gdisabled || r.goods[l].gchecked === o || (e.goodChange({
detail: {
name: "good_" + s + "_" + r.goods[l].bh,
checked: o
}
}), r.goods[l].gchecked = o);
r.schecked !== o && (r.schecked = o);
}
e.setData(t({}, g, r));
}
},
initialize: function() {
var t = this;
t.setData({
spin: !0,
postIng: !1
}), a.HttpMember("get/member/cart?islogin=0", function(e) {
a.initializeRefresh(e), t.setData({
"getdata.page": 1,
MyJifen: e.Myjifen,
timestamp: a.timestamp()
}), wx.stopPullDownRefresh(), a.GetList(function(a) {
t.create_cartList("init");
});
});
},
Lay: function(t) {
a.Lay(JSON.parse(JSON.stringify(t)));
},
Commom: function(t) {
var e = JSON.parse(JSON.stringify((t.currentTarget, t))), o = t.currentTarget ? e.currentTarget.dataset.action : e.action;
a[o](e);
},
Popup: function(t) {
a.Popup(t.currentTarget.dataset);
},
onLoad: function() {
a.init(this);
},
onShow: function() {
a.init(this);
var t = a.timestamp();
(!wx.getStorageSync("sessionid") || t - this.data.timestamp >= 30) && this.initialize();
},
onPullDownRefresh: function() {
this.initialize();
},
onShareAppMessage: function() {}
});

15
pages/member/cart.json Normal file
View File

@@ -0,0 +1,15 @@
{
"usingComponents": {
"van-submit-bar": "/vant/submit-bar/index",
"van-checkbox": "/vant/checkbox/index",
"van-checkbox-group": "/vant/checkbox-group/index",
"van-popup": "/vant/popup/index",
"forview": "/utils/forview/index",
"van-loading": "/vant/loading/index",
"van-dialog": "/vant/dialog/index",
"van-button": "/vant/button/index",
"van-icon": "/vant/icon/index",
"van-tab": "/vant/tab/index",
"van-tabs": "/vant/tabs/index"
}
}

111
pages/member/cart.wxml Normal file
View File

@@ -0,0 +1,111 @@
<import src="/template/template.wxml"></import>
<template is="ly" data="{{popup:popup,popuphtml:popuphtml,spin:spin}}"></template>
<view class="flex-item cartList" style="padding-bottom:{{Form.pd?50+Form.pd:50}}px" wx:if="{{!spin}}">
<template is="forview" data="{{list:listdata.nologin}}" wx:if="{{listdata.nologin}}"></template>
<view animation="{{delAnimation[shop.sell]}}" class="item" wx:if="{{getdata.page>=1}}" wx:for="{{listdata.list}}" wx:for-index="id" wx:for-item="shop" wx:key="sell">
<view class="row-flex shops">
<view class="flex-item">
<view class="row-flex">
<view style="width:30px;">
<van-checkbox bind:change="goodChange" disabled="{{shop.sdisabled}}" name="{{'shop_'+id}}" type="circle" value="{{shop.schecked}}"></van-checkbox>
</view>
<view class="flex-item">
<navigator url="{{shop.url}}">{{shop.name}}</navigator>
</view>
</view>
</view>
<view catchtap="ListSh" id="{{id}}" style="width:35px;text-align:right;height:20px;">
<van-icon color="#999999" name="ellipsis" size="22px"></van-icon>
</view>
</view>
<view animation="{{delAnimation[data.bh]}}" wx:for="{{shop.goods}}" wx:for-index="gid" wx:for-item="data" wx:key="bh">
<view class="row-flex info">
<view class="middle" style="width:30px;">
<van-checkbox bind:change="goodChange" disabled="{{data.gdisabled}}" name="{{'good_'+id+'_'+data.bh}}" shape="square" value="{{data.gchecked}}"></van-checkbox>
</view>
<view class="pic middle center" style="width:78px;">
<image bindtap="Lay" data-action="preview" data-src="{{data.pic.value}}" src="{{data.pic.value}}" wx:if="{{data.pic.type=='image'}}"></image>
<text wx:else>{{data.pic.value}}</text>
</view>
<view class="flex-item">
<navigator class="tit" url="{{data.goodurl}}">[{{data.typename}}]{{data.tit}}</navigator>
<view class="bot">
<view class="gicon" wx:if="{{!data.gdisabled}}">
<view bind:change="goodChange" bindtap="Lay" class="protect tips view" data-action="bond" data-info="已加入消保,商家已缴纳保证金 300 元">
</view>
</view>
<view class="{{data.error.class}}" wx:if="{{data.error.text}}">
{{data.error.text}}
<navigator url="{{data.error.link}}" wx:if="{{data.error.link}}">查看详情</navigator>
</view>
</view>
</view>
<view class="money tright" style="width:80px;">
<view class="text">¥<view class="num">{{data.money}}</view>
</view>
</view>
<view animation="{{ListSh[id]}}" catchtap="ListSh" class="row-flex more {{ListSh[id]?'show':'hide'}}" id="{{id}}">
<view catchtap="Lay" class="flex-item" data-action="contact" data-info="{{shop.sell+'/'+data.type}}">
<view class="action">
<van-icon customStyle="background:#498BF8;" name="chat-o"></van-icon>
<view>联系商家</view>
</view>
</view>
<view catchtap="action" class="flex-item" data-action="cart_delete" data-gid="{{gid}}" data-id="{{id}}">
<view class="action">
<van-icon customStyle="background:#ff5000;" name="delete"></van-icon>
<view>删除商品</view>
</view>
</view>
<view catchtap="action" class="flex-item" data-action="fav" data-gid="{{gid}}" data-id="{{id}}">
<view class="action">
<van-icon customStyle="background:#ff9402;" name="star-o"></van-icon>
<view>移至收藏</view>
</view>
</view>
<view class="flex-item">
<view class="action">
<van-icon name="cross"></van-icon>
<view>关闭</view>
</view>
</view>
</view>
</view>
<view class="row-flex attach" wx:if="{{data.type=='code'&&!data.gdisabled}}">
<view style="width:24px"></view>
<view class="pl-5 middle" style="width:90px">
<van-checkbox bind:change="goodChange" disabled="{{data.amoney<=0}}" name="{{'install_'+id+'_'+data.bh}}" shape="square" value="{{data.achecked}}">安装服务</van-checkbox>
</view>
<view class="flex-item explain">
购买前请看【<text bindtap="Lay" class="u" data-action="install" data-info="{{data.id}}">要求说明</text>】
</view>
<view class="money tright" style="width:80px">
<view class="text" wx:if="{{data.amoney>0}}">¥<view class="num">{{data.amoney}}</view>
</view>
<view class="text green" wx:else>免费</view>
</view>
</view>
<view class="row-flex attach" wx:if="{{data.type=='code'&&!data.gdisabled&&data.kjifen>0}}">
<view style="width:24px"></view>
<view class="pl-5" style="width:90px">
<van-checkbox bind:change="goodChange" disabled="{{MyJifen<=0&&data.yjifen<=0}}" name="{{'jifen_'+id+'_'+data.bh}}" shape="square" value="{{data.jchecked}}">积分抵价</van-checkbox>
</view>
<view class="flex-item explain">
<view wx:if="{{MyJifen<=0&&data.yjifen<=0}}">您当前可用积分不足</view>
<view wx:else>商品支持使用<view class="b">{{data.kjifen}}</view>积分</view>
<view wx:if="{{data.yjifen>0}}">当前准备使用<view class="b">{{data.yjifen}}</view>积分</view>
</view>
<view class="money tright" style="width:80px">
<view class="text green" wx:if="{{data.yjifen>0}}">-¥<view class="num">{{data.yjifen/10}}</view>
</view>
</view>
</view>
</view>
</view>
<van-submit-bar bind:submit="create_cartList" buttonText="提交结算" buttonHidden="{{Form.buttonHidden}}" disabled="{{CartMoney<=0}}" loading="{{postIng}}" price="{{CartMoney*100}}" tip="{{Form.tip}}">
<view slot="tip"></view>
<view style="width:10px"></view>
<van-checkbox bind:change="AllChange" shape="square" value="{{Allchecked}}">全选({{CartCount}}</van-checkbox>
</van-submit-bar>
</view>

294
pages/member/cart.wxss Normal file
View File

@@ -0,0 +1,294 @@
@import "../../__wuBaseWxss__/0.wxss";
.nologin {
position: absolute;
margin-top: -100px;
top: 50%;
left: 0;
width: 100%;
text-align: center;
}
.cartList .item {
position: relative;
background: #fff;
margin-bottom: 10px;
border-bottom: 1px #ddd solid;
border-top: 1px #ddd solid;
}
.cartList .item:last-child {
margin: 0;
}
.cartList .shops {
padding: 10px;
}
.cartList .ListSh {
display: inline-block;
margin-bottom: -5px;
padding: 0 0 5px 10px;
line-height: 20px;
font-size: 14px;
color: #999;
}
.cartList .info {
position: relative;
background: #fafafa;
padding: 10px;
border-top: 1px #e1e1e1 solid;
}
.cartList .info .more {
position: absolute;
width: 100%;
background-color: rgba(255,255,255,.9);
text-align: center;
top: 0;
left: 0;
height: 100%;
font-size: 12px;
line-height: 24px;
transform: translateX(100%);
}
.cartList .info .more.hide {
display: none;
}
.cartList .info .action {
padding-top: 14px;
}
.cartList .info .action .van-icon {
background: #c1c1c1;
border-radius: 50%;
padding: 5px;
color: #fff;
font-size: 20px;
}
.cartList .info .pic {
overflow: hidden;
margin: 0 10px 0 0;
line-height: 58px;
height: 58px;
width: 76px;
color: #36c;
border: 1px solid #eee;
}
.cartList .info .pic image {
width: 76px;
height: 58px;
}
.cartList .info .tit {
overflow: hidden;
height: 32px;
line-height: 16px;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.cartList .info .bot {
position: relative;
height: 20px;
line-height: 20px;
display: block;
}
.cartList .info .bot .gicon {
padding: 0;
background: 0 0;
left: 0;
right: auto;
}
.cartList .info .bot .gicon view {
margin: 0 5px 0 0;
}
.cartList .info .text {
color: #ccc;
height: 19px;
line-height: 19px;
font-size: 14px;
}
.cartList .info .money .text {
display: inline;
font-size: 12px;
color: #f30;
}
.cartList .info .num {
font-size: 14px;
display: inline-block;
font-weight: 700;
}
.cartList .attach {
background: #fff;
padding: 8px 10px;
line-height: 18px;
font-size: 14px;
border-top: 1px solid #eee;
}
.cartList .attach .van-checkbox {
margin-top: -2px;
}
.cartList .attach .explain {
font-size: 12px;
color: rgba(69,90,100,.6);
}
.cartList .attach .explain .b {
font-weight: 700;
}
.cartList .attach .explain view {
display: inline-block;
}
.cartList .attach .money .text {
display: inline;
font-size: 12px;
color: #f30;
}
.cartList .attach .money .green {
color: #3a933a;
}
.cartList .attach .money .num {
display: inline-block;
font-weight: 700;
}
.cartList .shop {
color: #333;
background-color: rgba(255,255,255,.5);
position: absolute;
bottom: 0;
left: 0;
width: 100%;
}
.cartList .shop .seller {
background-color: rgba(255,255,255,.9);
float: left;
height: 100px;
width: 82%;
}
.cartList .shop .avatar {
display: inline-block;
width: 20px;
height: 20px;
}
.cartList .shop .avatar image {
width: 16px;
height: 16px;
}
.cartList .shop .name {
color: #000;
}
.cartList .shop .tname {
color: #666;
padding-right: 5px;
display: inline-block;
}
.cartList .shop .litem {
float: left;
width: 100%;
height: 20px;
line-height: 20px;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.cartList .shop .action {
float: right;
height: 100%;
width: 18%;
}
.cartList .shop .action .navigator,.cartList .shop .action view {
text-align: center;
display: block;
width: 100%;
height: 33.5px;
line-height: 33.5px;
background: #ff9402;
color: #fff;
}
.cartList .shop .action navigator:nth-child(1) {
background: #ff5000;
}
.cartList .shop .action view {
background: #c1c1c1;
}
.shop_view {
padding-bottom: 50px;
}
.shop_list {
height: 100px;
border-bottom: 1px solid #dbdbdb;
line-height: 100px;
padding-left: 20px;
}
.fixed_top {
background: #ff774f;
}
.fixed_top .ui-col {
color: #fff;
}
.fixed_bottom {
background: #fff;
box-shadow: 0 -8px 10px 0 #eaeaea;
}
.fixed_bottom .form_list {
background: #fe6a3c;
color: #fff;
height: 50px;
text-align: center;
line-height: 50px;
font-size: 16px;
}
.fixed_bottom .money {
color: #f30;
display: inline-block;
font-size: 12px;
}
.fixed_bottom .money .num {
font-size: 20px;
display: inline-block;
font-weight: 700;
}
.fixed_bottom .form_num {
display: inline-block;
}

115
pages/member/html.js Normal file
View File

@@ -0,0 +1,115 @@
function t(t, e, i) {
return e in t ? Object.defineProperty(t, e, {
value: i,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[e] = i, t;
}
var e = function(t) {
return t && t.__esModule ? t : {
default: t
};
}(require("../../vant/dialog/dialog")), i = require("../../common/common.js");
Page({
data: {
url: "",
popup: [],
previewList: []
},
initialize: function() {
var t = this;
t.setData({
spin: !0,
popupSpin: !1,
Form: {
form: {
radio: {},
checkbox: {},
picker: {},
rate: {}
}
},
popupForm: {
form: {
radio: {},
checkbox: {},
picker: {}
}
}
}), i.HttpMember(t.data.url, function(t) {
i.initializeRefresh(t);
});
},
onPullDownRefresh: function() {
this.initialize();
},
onLoad: function(t) {
t && this.setData({
url: i.UrlOptions(t)
}), i.init(this), this.initialize();
},
onShow: function() {
i.init(this), this.data.Form.form.formLoad && this.initialize();
},
Lay: function(t) {
i.Lay(JSON.parse(JSON.stringify(t)));
},
Commom: function(t) {
var e = JSON.parse(JSON.stringify((t.currentTarget, t))), a = t.currentTarget ? e.currentTarget.dataset.action : e.action;
i[a](e);
},
Popup: function(t) {
i.Popup(t.currentTarget.dataset);
},
AllmoneyChange: function(e) {
var i = commom.getTableName(), a = this.data[i].form, r = a.radio.SelectEdition, o = a.radio.piece, n = a.allMoney;
if (r) {
var l = r.split("-|-");
n.edition = l[0], n.money = parseInt(l[1]);
}
n.count = parseInt(o * n.money), a.allMoney = n, this.setData(t({}, i + ".form", a));
},
allMoney: function(i) {
var a = this, r = i.currentTarget.dataset.action, o = i.currentTarget.dataset.data, n = 0, l = [];
for (var s in a.data.Form.input) if ("moneyBox" == a.data.Form.input[s].id) var u = s;
var f = a.data.Form.input[u].list[1].list[0].list[1].list, m = f.length;
if ("up" == r || "down" == r) {
var c = JSON.parse(JSON.stringify(f[o])), d = "up" == r ? o <= 0 ? m - 1 : o - 1 : o >= m - 1 ? 0 : o + 1;
f[o] = f[d], f[o] = f[d], f[d] = c, f[d] = c;
} else if ("del" == r) {
if (m <= 1) return e.default.alert({
title: "提示",
message: '至少需要保留<b style="color:red">1个</b>价格!',
overlay: !0,
closable: !1
}).then(function() {
var e;
a.setData((e = {}, t(e, "Form.form.formLoad", !1), t(e, "Form.form.textareaToggle", !1),
e));
}), !1;
delete f[o];
} else if ("add" == r) {
if (m >= 5) return e.default.alert({
title: "提示",
message: '最多只能设置<b style="color:blue">5个</b>动态价格!',
overlay: !0,
closable: !1
}).then(function() {
var e;
a.setData((e = {}, t(e, "Form.form.formLoad", !1), t(e, "Form.form.textareaToggle", !1),
e));
}), !1;
f[m] = JSON.parse(JSON.stringify(f[0])), f[m].list[0].list[0].value = "", f[m].list[1].list[0].value = "";
}
for (var s in f) {
f[s].list[0].list[0].name = f[s].list[0].list[0].name.replace(/[\d]/g, "") + n,
f[s].list[1].list[0].name = f[s].list[1].list[0].name.replace(/[\d]/g, "") + n;
for (var p in f[s].list[2].list) f[s].list[2].list[p].data = n;
l[n] = f[s], n++;
}
a.setData(t({}, "Form.input[" + u + "].list[1].list[0].list[1].list", l));
}
});

25
pages/member/html.json Normal file
View File

@@ -0,0 +1,25 @@
{
"usingComponents": {
"down": "/utils/count-down/index",
"van-field": "/vant/field/index",
"van-radio": "/vant/radio/index",
"van-radio-group": "/vant/radio-group/index",
"van-cell": "/vant/cell/index",
"van-cell-group": "/vant/cell-group/index",
"van-stepper": "/vant/stepper/index",
"van-picker": "/vant/picker/index",
"van-checkbox": "/vant/checkbox/index",
"van-checkbox-group": "/vant/checkbox-group/index",
"van-notice-bar": "/vant/notice-bar/index",
"van-search": "/vant/search/index",
"van-steps": "/vant/steps/index",
"forview": "/utils/forview/index",
"van-loading": "/vant/loading/index",
"van-dialog": "/vant/dialog/index",
"van-button": "/vant/button/index",
"van-icon": "/vant/icon/index",
"van-popup": "/vant/popup/index",
"van-tab": "/vant/tab/index",
"van-tabs": "/vant/tabs/index"
}
}

4
pages/member/html.wxml Normal file
View File

@@ -0,0 +1,4 @@
<import src="/template/template.wxml"></import>
<template is="ly" data="{{popup:popup,popuphtml:popuphtml,spin:spin||popupSpin||false}}"></template>
<template is="form" data="{{Form:Form}}" wx:if="{{!spin}}"></template>
<template is="popupform" data="{{Form:popupForm}}"></template>

5
pages/member/html.wxss Normal file
View File

@@ -0,0 +1,5 @@
@import "../../__wuBaseWxss__/0.wxss";
@import "../../__wuBaseWxss__/1.wxss";
@import "../../vant/area/index.wxss";

123
pages/member/list/detail.js Normal file
View File

@@ -0,0 +1,123 @@
function t(t, a, e) {
return a in t ? Object.defineProperty(t, a, {
value: e,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[a] = e, t;
}
var a = require("../../../common/common.js");
Page({
data: {
previewList: [],
dropShow: !1,
searchVal: [],
loading: !1,
Form: {},
getdata: [],
listdata: [],
popup: [],
spin: !0,
listIndex: 0,
loadnot: !1,
gotop: !1,
popupForm: {}
},
onLoad: function(t) {
a.init(this);
var e = this;
a.HttpMember({
url: "get/member/detail",
data: {
mode: t.mode
}
}, function(i) {
var n = {
getdata: {},
listdata: {},
listIndex: 0,
searchVal: []
};
i.tabs.forEach(function(a, e) {
a.value === t.mode && (n.listIndex = e), n.getdata[e] = {
mode: a.value,
page: 1
}, n.listdata[e] = {
list: [],
CurPage: 0
};
}), a.initializeRefresh(i), t.bh && i.tabs[n.listIndex].search && (n.getdata[n.listIndex].bh = t.bh,
n.searchVal[n.listIndex] = t.bh), e.setData({
getdata: n.getdata,
listdata: n.listdata,
listIndex: n.listIndex,
searchVal: n.searchVal
}), a.initialFun(!1), a.GetList(function(t) {
e.setData({
spin: !1
});
});
});
},
onShow: function() {
a.init(this);
},
initialize: function() {
var e, i = this, n = i.data.listIndex;
i.setData((e = {}, t(e, "initialValue.listIndex", n), t(e, "listdata." + n, {
list: [],
CurPage: 0
}), e)), a.initialFun(!0), a.GetList(function(t) {
wx.stopPullDownRefresh();
});
},
searchSubmit: function(e) {
var i, n = this, s = n.data.listIndex, o = e.detail ? e.detail.replace(/\s+/g, "") : "", l = n.data.searchVal[s], d = n.data.getdata;
if (l === o) return "" == o && a.Lay({
info: "亲,搜索内容不能为空!"
}), !1;
"" == o ? delete d[s].bh : d[s].bh = o, d[s].page = 1, n.setData((i = {
getdata: d
}, t(i, "searchVal." + s, o), t(i, "listdata." + s, {
list: [],
CurPage: 0
}), i)), a.GetList();
},
onReachBottom: function() {
var e = this, i = e.data.listIndex, n = e.data.listdata[i];
if (!e.data.loadnot && !e.data.loading && n.CurPage < n.TotalPage) {
var s = "getdata." + i + ".page";
e.setData(t({}, s, 1 * e.data.getdata[i].page + 1)), a.GetList();
}
},
tabChange: function(t) {
var e = this, i = t.detail.index, n = e.data.listdata[i];
i != e.data.listIndex && (e.setData({
listIndex: i
}), wx.setNavigationBarTitle({
title: e.data.Form.tabs[i].title
}), n.CurPage ? n.CurPage < n.TotalPage ? this.loadnot = !1 : this.loadnot = !0 : a.GetList());
},
onPageScroll: function(t) {
var a = this, e = t.scrollTop, i = a.data.gotop, n = 2 * a.data.SystemInfo.windowHeight;
(e >= n && !i || e < n && i) && a.setData({
gotop: !i
});
},
Lay: function(t) {
a.Lay(JSON.parse(JSON.stringify(t)));
},
Commom: function(t) {
var e = JSON.parse(JSON.stringify((t.currentTarget, t))), i = t.currentTarget ? e.currentTarget.dataset.action : e.action;
a[i](e);
},
Popup: function(t) {
a.Popup(t.currentTarget.dataset);
},
onPullDownRefresh: function() {
this.initialize();
},
onShareAppMessage: function() {}
});

View File

@@ -0,0 +1,16 @@
{
"usingComponents": {
"van-search": "/vant/search/index",
"van-field": "/vant/field/index",
"van-cell": "/vant/cell/index",
"van-cell-group": "/vant/cell-group/index",
"forview": "/utils/forview/index",
"van-loading": "/vant/loading/index",
"van-dialog": "/vant/dialog/index",
"van-button": "/vant/button/index",
"van-icon": "/vant/icon/index",
"van-popup": "/vant/popup/index",
"van-tab": "/vant/tab/index",
"van-tabs": "/vant/tabs/index"
}
}

View File

@@ -0,0 +1,27 @@
<import src="/template/template.wxml"></import>
<template is="ly" data="{{popup:popup,popuphtml:popuphtml,spin:spin,gotop:gotop}}"></template>
<block wx:if="{{!spin}}">
<van-tabs animated sticky swipeable active="{{listIndex}}" bind:change="tabChange" swipeThreshold="6">
<van-tab title="{{tab.name}}" wx:for="{{Form.tabs}}" wx:for-index="id" wx:for-item="tab" wx:key="value">
<van-search bind:search="searchSubmit" icon="search" placeholder="请输入{{tab.search}}" value="{{searchVal[id]}}" wx:if="{{tab.search}}"></van-search>
<view class="detailList" id="main">
<view class="item" wx:for="{{listdata[id].list}}" wx:for-item="list" wx:key="index">
<view class="row-flex">
<view class="t{{type}}" style="{{list.style[type]?list.style[type]:''}}" wx:if="{{type!='style'}}" wx:for="{{list}}" wx:for-index="type" wx:for-item="array" wx:key="index">
<view>
<block wx:for="{{array}}" wx:for-item="data" wx:key="index">
<view bindtap="{{data.bind||''}}" class="{{data.class||''}}" data-action="{{data.action||''}}" data-data="{{data.data||data.data===0?data.data:''}}" data-info="{{data.info||''}}" data-method="{{data.method||''}}" data-title="{{data.title||''}}" style="{{data.style||''}}" wx:if="{{!data.icon}}">
{{data.text}}
</view>
<van-icon bindtap="{{data.bind||''}}" customClass="{{data.class||''}}" data-action="{{data.action||''}}" data-info="{{data.info||''}}" data-title="{{data.title||''}}" name="{{data.icon}}" wx:else></van-icon>
</block>
</view>
</view>
</view>
</view>
</view>
</van-tab>
</van-tabs>
<template is="list_bottom" data="{{...listdata[listIndex],loading:loading,lazy:Form.lazy.add>0,unit:'条'}}"></template>
<template is="popupform" data="{{Form:popupForm}}"></template>
</block>

View File

@@ -0,0 +1,5 @@
@import "../../../__wuBaseWxss__/0.wxss";
@import "../../../__wuBaseWxss__/1.wxss";
@import "../../../vant/area/index.wxss";

144
pages/member/list/fav.js Normal file
View File

@@ -0,0 +1,144 @@
function t(t, a, i) {
return a in t ? Object.defineProperty(t, a, {
value: i,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[a] = i, t;
}
var a = require("../../../common/common.js");
Page({
data: {
loading: !1,
getdata: [],
listdata: [],
ListSh: {},
spin: !0,
Form: {},
listIndex: 0,
loadnot: !1,
gotop: !1,
popupForm: {},
itemAnimation: {}
},
onLoad: function(t) {
a.init(this);
var i = this;
a.HttpMember({
url: "get/member/fav",
data: {
mode: t.mode
}
}, function(e) {
var n = {
getdata: {},
listdata: {},
listIndex: 0
};
e.tabs.forEach(function(a, i) {
a.value === t.mode && (n.listIndex = i), n.getdata[i] = {
mode: a.value,
page: 1
}, n.listdata[i] = {
list: [],
CurPage: 0
};
}), a.initializeRefresh(e), t.bh && e.tabs[n.listIndex].search && (n.getdata[n.listIndex].bh = t.bh,
n.searchVal[n.listIndex] = t.bh), i.setData({
getdata: n.getdata,
listdata: n.listdata,
listIndex: n.listIndex
}), a.initialFun(!1), a.GetList(function(t) {
i.setData({
spin: !1
});
});
});
},
onShow: function() {
a.init(this);
},
initialize: function() {
var i, e = this, n = e.data.listIndex;
e.setData((i = {}, t(i, "initialValue.listIndex", n), t(i, "listdata." + n, {
list: [],
CurPage: 0
}), i)), a.initialFun(!0), a.GetList(function(t) {
wx.stopPullDownRefresh();
});
},
ListSh: function(a) {
var i = this, e = a.currentTarget.id, n = "ListSh." + e, s = wx.createAnimation({
duration: 200,
timingFunction: "ease",
delay: 0
});
i.data.ListSh[e] ? (s.translateY("100%").step(), setTimeout(function() {
i.setData(t({}, n, !1));
}, 201)) : (i.setData(t({}, n, !0)), s.translateY("0").step()), this.setData(t({}, n, s.export()));
},
action: function(i) {
var e = this, n = e.data.listIndex, s = e.data.listdata[n], o = i.currentTarget.dataset, r = o.id, l = o.action, d = s.list[r].bh, u = e.data.Form.tabs[n].value;
a.PostMember("post/fav", {
action: l,
bh: d,
tab: u
}, function(a) {
if (1 != a.state) return !1;
if ("del" == l) {
var i = wx.createAnimation({
duration: 300,
timingFunction: "ease",
delay: 0
});
i.translateX("120%").step(), e.setData(t({}, "itemAnimation." + d, i.export())),
setTimeout(function() {
s.Total--, s.list.splice(r, 1), e.setData(t({
itemAnimation: {}
}, "listdata." + n, s));
}, 301);
} else if ("up" == l || "down" == l) {
var o = s.list.splice(r, 1)[0];
o.top = Number(!Boolean(parseInt(o.top))), "up" == l ? s.list.unshift(o) : s.list.push(o),
e.setData(t({}, "listdata." + n, s));
}
});
},
onReachBottom: function() {
var i = this, e = i.data.listIndex, n = i.data.listdata[e];
if (!i.data.loadnot && !i.data.loading && n.CurPage < n.TotalPage) {
var s = "getdata." + e + ".page";
i.setData(t({}, s, 1 * i.data.getdata[e].page + 1)), a.GetList();
}
},
tabChange: function(t) {
var i = this, e = t.detail.index, n = i.data.listdata[e];
e != i.data.listIndex && (i.setData({
listIndex: e
}), wx.setNavigationBarTitle({
title: i.data.Form.tabs[e].title
}), n.CurPage ? n.CurPage < n.TotalPage ? this.loadnot = !1 : this.loadnot = !0 : a.GetList());
},
onPageScroll: function(t) {
var a = this, i = t.scrollTop, e = a.data.gotop, n = 2 * a.data.SystemInfo.windowHeight;
(i >= n && !e || i < n && e) && a.setData({
gotop: !e
});
},
Lay: function(t) {
a.Lay(JSON.parse(JSON.stringify(t)));
},
Commom: function(t) {
var i = JSON.parse(JSON.stringify((t.currentTarget, t))), e = t.currentTarget ? i.currentTarget.dataset.action : i.action;
a[e](i);
},
Popup: function(t) {
a.Popup(t.currentTarget.dataset);
},
onPullDownRefresh: function() {
this.initialize();
},
onShareAppMessage: function() {}
});

View File

@@ -0,0 +1,12 @@
{
"usingComponents": {
"forview": "/utils/forview/index",
"van-loading": "/vant/loading/index",
"van-dialog": "/vant/dialog/index",
"van-button": "/vant/button/index",
"van-icon": "/vant/icon/index",
"van-popup": "/vant/popup/index",
"van-tab": "/vant/tab/index",
"van-tabs": "/vant/tabs/index"
}
}

125
pages/member/list/fav.wxml Normal file
View File

@@ -0,0 +1,125 @@
<import src="/template/template.wxml"></import>
<template is="ly" data="{{popup:popup,popuphtml:popuphtml,spin:spin,gotop:gotop}}"></template>
<block wx:if="{{!spin}}">
<van-tabs animated sticky swipeable active="{{listIndex}}" bind:change="tabChange" swipeThreshold="7">
<van-tab title="{{tab.name}}" wx:if="{{tab.value=='code'||tab.value=='shop'||tab.num>0}}" wx:for="{{Form.tabs}}" wx:for-index="id" wx:for-item="tab" wx:key="value">
<view class="shopList" wx:if="{{tab.value=='shop'}}">
<view animation="{{itemAnimation[item.bh]}}" class="item" wx:for="{{listdata[id].list}}" wx:key="bh">
<view class="row-flex">
<navigator class="avatar" hoverClass="hover" url="{{item.url}}">
<image src="{{item.avatar}}!t40" webp="{{true}}"></image>
</navigator>
<view class="flex-item shop">
<view class="name">
<navigator hoverClass="hover" url="{{item.url}}">{{item.name}}</navigator>
</view>
<view class="{{item.rev}}"></view>
<view class="info">
<view class="num">
宝贝数:{{item.goods}}
</view>
<van-icon catchtap="ListSh" id="{{item.bh}}" name="ellipsis"></van-icon>
</view>
</view>
<view animation="{{ListSh[item.bh]}}" class="action {{ListSh[item.bh]?'show':'hide'}}">
<view catchtap="ListSh" class="row-flex" id="{{item.bh}}">
<view bindtap="action" class="flex-item" data-action="del" data-id="{{index}}">
<view class="icon delete">
<van-icon name="delete"></van-icon>
</view>
<view>删除收藏</view>
</view>
<view bindtap="action" class="flex-item" data-action="down" data-id="{{index}}" hidden="{{item.top!=1}}">
<view class="icon down">
<van-icon name="arrow-down"></van-icon>
</view>
<view>取消置顶</view>
</view>
<view bindtap="action" class="flex-item" data-action="up" data-id="{{index}}" hidden="{{item.top==1}}">
<view class="icon up">
<van-icon name="arrow-up"></van-icon>
</view>
<view>置顶收藏</view>
</view>
<view class="flex-item">
<view class="icon cross">
<van-icon name="cross"></van-icon>
</view>
<view>关闭</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="favList" id="main" wx:else>
<view animation="{{itemAnimation[item.bh]}}" class="item" wx:for="{{listdata[id].list}}" wx:key="bh">
<view class="row-flex">
<view class="pic">
<navigator url="{{item.url}}" wx:if="{{item.url!==false}}">
<image mode="widthFix" src="{{item.pic}}" webp="{{true}}" wx:if="{{item.pic}}"></image>
<text wx:else>{{item.typename}}</text>
</navigator>
<block wx:else>
<image src="{{item.pic}}" webp="{{true}}" wx:if="{{item.pic}}"></image>
<text wx:else>{{item.typename}}</text>
</block>
</view>
<view class="flex-item info">
<view class="tit">
<navigator url="{{item.url}}" wx:if="{{item.url!==false}}">{{item.tit}}</navigator>
<block wx:else>
{{item.tit}}
</block>
</view>
<view class="bottom">
<view class="row-flex">
<view class="flex-item money">{{item.money}}</view>
<view class="flex-item">
<text class="{{item.state.class||''}}">{{item.state.text}}</text>
</view>
<van-icon catchtap="ListSh" class="ListSh" id="{{item.bh}}" name="ellipsis"></van-icon>
</view>
</view>
<view animation="{{ListSh[item.bh]}}" class="action {{ListSh[item.bh]?'show':'hide'}}">
<view catchtap="ListSh" class="row-flex" id="{{item.bh}}">
<view bindtap="action" class="flex-item" data-action="cart" data-id="{{index}}" wx:if="{{item.card}}">
<view class="icon">
<van-icon name="cart-o"></van-icon>
</view>
<view>放购物车</view>
</view>
<view bindtap="action" class="flex-item" data-action="del" data-id="{{index}}">
<view class="icon delete">
<van-icon name="delete"></van-icon>
</view>
<view>删除收藏</view>
</view>
<view bindtap="action" class="flex-item" data-action="down" data-id="{{index}}" hidden="{{item.top!=1}}">
<view class="icon down">
<van-icon name="arrow-down"></van-icon>
</view>
<view>取消置顶</view>
</view>
<view bindtap="action" class="flex-item" data-action="up" data-id="{{index}}" hidden="{{item.top==1}}">
<view class="icon up">
<van-icon name="arrow-up"></van-icon>
</view>
<view>置顶收藏</view>
</view>
<view class="flex-item">
<view class="icon cross">
<van-icon name="cross"></van-icon>
</view>
<view>关闭</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</van-tab>
</van-tabs>
<template is="list_bottom" data="{{...listdata[listIndex],loading:loading}}"></template>
</block>

114
pages/member/list/fav.wxss Normal file
View File

@@ -0,0 +1,114 @@
@import "../../../__wuBaseWxss__/0.wxss";
.favList .item {
overflow: hidden;
color: #999;
position: relative;
margin: 10px 10px 0 10px;
background: #fff;
padding: 10px;
border-radius: 2px;
}
.favList .pic {
color: #333;
font-size: 14px;
overflow: hidden;
width: 100px;
text-align: center;
height: 80px;
line-height: 80px;
background: #fafafa;
border: 1px #eee solid;
}
.favList .pic image {
width: 100px;
height: 80px;
}
.favList .info {
position: relative;
height: 80px;
margin-left: 10px;
}
.favList .info .tit {
line-height: 16px;
font-size: 12px;
height: 32px;
overflow: hidden;
}
.favList .info .bottom {
position: absolute;
right: 0;
bottom: -10px;
width: 100%;
line-height: 25px;
}
.favList .info .bottom .money {
color: #ff5000;
padding-right: 5px;
}
.favList .info .bottom .money:before {
content: "¥";
font-size: 12px;
}
.favList .info .bottom .ListSh {
font-size: 18px;
padding: 0 0 5px 15px;
line-height: 25px;
color: #999;
}
.favList .info .action {
line-height: 20px;
text-align: center;
background-color: rgba(255,255,255,.9);
position: absolute;
right: 0;
top: 0;
height: 100%;
width: 100%;
transform: translateY(100%);
}
.favList .info .action .van-icon {
line-height: 28px;
width: 100%;
font-size: 20px;
color: #fff;
}
.favList .info .icon {
margin-top: 18px;
border-radius: 50%;
width: 30px;
height: 30px;
display: inline-block;
background: #f60;
}
.action .row-flex .flex-item .icon.delete {
background: #f00;
}
.action .row-flex .flex-item .icon.up {
background: #498BF8;
}
.action .row-flex .flex-item .icon.cross {
background: #c1c1c1;
}
.action .row-flex .flex-item .icon.down {
background: #3eabc3;
}
.action .row-flex .flex-item:last-child {
flex: 0.7;
}

209
pages/member/list/manage.js Normal file
View File

@@ -0,0 +1,209 @@
function t(t, a, e) {
return a in t ? Object.defineProperty(t, a, {
value: e,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[a] = e, t;
}
var a = require("../../../common/common.js");
Page({
data: {
postShow: !1,
searchShow: !1,
searchVal: "",
searchFocus: !1,
loading: !1,
getdata: [],
listdata: [],
popup: [],
spin: !0,
listIndex: 0,
loadnot: !1,
gotop: !1,
active: {},
previewList: [],
Form: {
form: {
radio: {},
checkbox: {},
picker: {}
}
},
popupForm: {
form: {
radio: {},
checkbox: {},
picker: {}
}
}
},
onLoad: function(t) {
a.init(this);
var e = this;
a.HttpMember({
url: "get/member/manage",
data: {
list: t.list || "goods"
}
}, function(i) {
a.initializeRefresh(i);
var s = {
listIndex: 0,
getdata: {},
listdata: {},
active: {}
};
i.tabs.total.forEach(function(a, e) {
s.getdata[e] = {
page: 1,
mode: a.key,
type: a.default
}, s.listdata[e] = {
list: [],
CurPage: 0
}, s.active[e] = 0, t.mode === a.key && (s.listIndex = e, t.type && i.tabs[a.key] && i.tabs[a.key].forEach(function(a, i) {
t.type === a.key && (s.active[e] = i, s.getdata[e].type = a.key);
}));
}), e.setData({
active: s.active,
getdata: s.getdata,
listdata: s.listdata,
listIndex: s.listIndex
}), a.initialFun(!1), a.GetList(function(t) {
e.setData({
spin: !1
});
});
});
},
initialize: function() {
a.initialFun(!0), a.GetList(function(t) {
wx.stopPullDownRefresh();
});
},
onShow: function() {
a.init(this), this.data.Form.form.formLoad && this.initialize();
},
searchRemove: function() {
(!(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]) && "" != this.data.searchVal.replace(/(^\s*)|(\s*$)/g, "") && this.searchSubmit({
detail: ""
}), this.setData({
searchShow: !1,
searchVal: ""
});
},
searchSubmit: function(e) {
var i = this, s = i.data.listIndex, o = e.detail ? e.detail.replace(/\s+/g, "") : "", n = i.data.searchVal, r = i.data.getdata;
if (n === o) return "" == o && a.Lay({
info: "亲,搜索内容不能为空!"
}), !1;
"" == o ? delete r[s].key : r[s].key = o, r[s].page = 1, i.setData(t({
getdata: r,
searchVal: o
}, "listdata." + s, {
list: [],
CurPage: 0
})), a.GetList();
},
searchToggle: function(t) {
var a = this, e = a.data.searchShow;
a.setData({
searchShow: !e,
searchFocus: !1
}), e || setTimeout(function() {
a.setData({
searchFocus: !0
});
}, 100);
},
postToggle: function() {
this.setData({
postShow: !this.data.postShow
});
},
onReachBottom: function() {
var e = this, i = e.data.listIndex, s = e.data.listdata[i];
if (!e.data.loadnot && !e.data.loading && s.CurPage < s.TotalPage) {
var o = "getdata." + i + ".page";
e.setData(t({}, o, 1 * e.data.getdata[i].page + 1)), a.GetList();
}
},
typeChange: function(e) {
var i = this, s = e.detail, o = i.data.listIndex, n = i.data.getdata[o], r = i.data.Form.tabs[n.mode];
if (n.type != r[s].key) {
var d;
n.type = r[s].key, n.page = 1, n.key && (i.searchRemove(!1), delete n.key), i.setData((d = {},
t(d, "active." + o, s), t(d, "getdata." + o, n), t(d, "listdata." + o, {
list: [],
CurPage: 0
}), d)), a.GetList();
}
},
tabChange: function(t) {
var e = this, i = t.detail.index, s = e.data.listdata[i];
i != e.data.listIndex && (e.setData({
listIndex: i
}), s.CurPage ? s.CurPage < s.TotalPage ? this.loadnot = !1 : this.loadnot = !0 : a.GetList());
},
onPageScroll: function(t) {
var a = this, e = t.scrollTop, i = a.data.gotop, s = 2 * a.data.SystemInfo.windowHeight;
(e >= s && !i || e < s && i) && a.setData({
gotop: !i
});
},
UpdateTabs: function(a) {
var e, i = this.data.Form.tabs;
for (var s in a) {
var o = a[s];
for (var n in i) for (var r in i[n]) ("total" == n && i[n][r].key == o.mode || n == o.mode && i[n][r].key == o.type) && (i[n][r].num = o.number > 0 ? parseInt(i[n][r].num) + parseInt(o.number) : parseInt(i[n][r].num) - parseInt(-1 * o.number));
}
this.setData((e = {}, t(e, "Form.tabs", i), t(e, "initialValue.Form.tabs", i), e));
},
ExecuteCallBack: function(a) {
var e = this, i = e.data.listIndex, s = e.data.listdata[i], o = a.action, n = a.index;
if ("uptime" == o) s.list[n].time = a.time; else {
var r = a.mode, d = a.toMode, l = a.type;
if (s.list.splice(n, 1), s.Total--, "updown" == o) {
var c = [ {
type: l,
mode: r,
number: -1
}, {
type: l,
mode: d,
number: 1
} ], u = e.data.getdata;
for (var h in u) if (d == u[h].mode && l == u[h].type && e.data.listdata[h].list.length > 0) {
var p;
e.setData((p = {}, t(p, "listdata." + h, {
list: [],
CurPage: 0
}), t(p, "getdata." + h + ".page", 1), p));
break;
}
} else if ("del" == o) c = [ {
type: l,
mode: r,
number: -1
} ];
e.UpdateTabs(c);
}
e.setData(t({}, "listdata." + i, s));
},
Lay: function(t) {
a.Lay(JSON.parse(JSON.stringify(t)));
},
Commom: function(t) {
var e = JSON.parse(JSON.stringify((t.currentTarget, t))), i = t.currentTarget ? e.currentTarget.dataset.action : e.action;
a[i](e);
},
Popup: function(t) {
a.Popup(t.currentTarget.dataset);
},
onPullDownRefresh: function() {
this.initialize();
}
});

View File

@@ -0,0 +1,26 @@
{
"usingComponents": {
"van-search": "/vant/search/index",
"van-picker": "/vant/picker/index",
"van-tabbar": "/vant/tabbar/index",
"van-tabbar-item": "/vant/tabbar-item/index",
"van-transition": "/vant/transition/index",
"van-field": "/vant/field/index",
"van-radio": "/vant/radio/index",
"van-radio-group": "/vant/radio-group/index",
"van-cell": "/vant/cell/index",
"van-cell-group": "/vant/cell-group/index",
"van-rate": "/vant/rate/index",
"van-stepper": "/vant/stepper/index",
"van-checkbox": "/vant/checkbox/index",
"van-checkbox-group": "/vant/checkbox-group/index",
"forview": "/utils/forview/index",
"van-loading": "/vant/loading/index",
"van-dialog": "/vant/dialog/index",
"van-button": "/vant/button/index",
"van-icon": "/vant/icon/index",
"van-popup": "/vant/popup/index",
"van-tab": "/vant/tab/index",
"van-tabs": "/vant/tabs/index"
}
}

View File

@@ -0,0 +1,90 @@
<import src="/template/template.wxml"></import>
<template is="ly" data="{{popup:popup,popuphtml:popuphtml,spin:spin||popupSpin||false,gotop:gotop,bottom:45}}"></template>
<block wx:if="{{!spin&&Form.tabs}}">
<van-tabs animated sticky swipeable active="{{listIndex}}" bind:change="tabChange" customClass="fixed-tabs" id="total" lineWidth="{{(SystemInfo.windowWidth-50)/4}}" swipeThreshold="4">
<van-tab title="{{tab.name}}({{tab.num}})" wx:for="{{Form.tabs.total}}" wx:for-index="listid" wx:for-item="tab" wx:key="key">
<view hidden="{{getdata[listIndex].mode!==tab.key}}">
<van-tabbar fixed active="{{active[listid]}}" bind:change="typeChange" id="{{tab.key}}">
<van-tabbar-item icon="home-o" info="{{tabs.num||null}}" title="{{tabs.name}}" wx:for="{{Form.tabs[tab.key]}}" wx:for-index="typeid" wx:for-item="tabs" wx:key="name">{{tabs.name}}</van-tabbar-item>
</van-tabbar>
</view>
<view class="manageList">
<view class="item" wx:for="{{listdata[listid].list}}" wx:for-index="itemIndex" wx:key="bh">
<view class="top">
<view class="time">
{{item.time.name}}<text style="{{item.time.color?'color:'+item.time.color:''}}">{{item.time.value}}</text>
<block wx:if="{{item.djl}}">
{{item.djl.name}}<text>{{item.djl.value}}</text>
</block>
</view>
<view bindtap="{{item.state.bind?item.state.bind:item.state.link?'Lay':''}}" class="state {{item.state.class}}" data-action="{{item.state.action||'url'}}" data-info="{{item.state.info||item.state.link||''}}">
<van-icon name="yuanjiaojuxing"></van-icon>{{item.state.text}}</view>
</view>
<view class="row-flex info" wx:if="{{item.pic}}">
<navigator class="pic" url="{{item.url}}">
<image mode="widthFix" src="{{item.pic}}"></image>
</navigator>
<view class="flex-item">
<view bindtap="Lay" class="tit" data-action="url" data-info="{{item.url}}">
<block wx:if="{{searchVal==''}}">{{item.title}}</block>
<rich-text nodes="{{item.title}}" wx:else></rich-text>
</view>
<view class="note">
<view>
<block wx:for="{{item.note.left}}" wx:for-item="M" wx:key="index">
<view class="{{type}}" wx:for="{{M}}" wx:for-index="type" wx:for-item="info" wx:key="index">{{info}}</view>
</block>
<view class="tright" wx:if="{{item.note.right}}">
<template is="forview" data="{{list:item.note.right,form:popupForm.form}}"></template>
</view>
</view>
</view>
</view>
</view>
<view class="row-flex info" wx:else>
<view class="flex-item">
<view bindtap="Lay" class="tit" data-action="url" data-info="{{item.url}}">
<block wx:for="{{item.note.left}}" wx:for-item="M" wx:key="index">
<text class="{{type}}" wx:for="{{M}}" wx:for-index="type" wx:for-item="info" wx:key="index">{{info}}</text>
</block>
<block wx:if="{{searchVal==''}}">{{item.title}}</block>
<rich-text nodes="{{item.title}}" wx:else></rich-text>
</view>
</view>
</view>
<view class="bot row-flex">
<view class="flex-item">
<view class="gicon" wx:if="{{item.icon}}">
<block wx:for="{{item.icon}}" wx:for-item="is" wx:key="index">
<van-icon bindtap="{{is.bind||'Lay'}}" customClass="{{is.class||''}}" data-action="{{is.action||''}}" data-data="{{is.data||''}}" data-info="{{is.info||''}}" data-method="{{is.method||''}}" name="{{is.name||''}}" wx:if="{{is.type=='icon'}}"></van-icon>
<view bindtap="{{is.bind||'Lay'}}" class="{{is.class}}" data-action="{{is.action||''}}" data-data="{{is.data||''}}" data-info="{{is.info||''}}" data-method="{{is.method||''}}" name="{{is.name||''}}" wx:else>
{{is.text}}
</view>
</block>
</view>
</view>
<view class="ListAction">
<van-button bindtap="{{btn.bind||'Lay'}}" customClass="{{btn.class||''}}" data-action="{{btn.action||''}}" data-batch="{{btn.batch||'updown'}}" data-c1="{{item.bh||''}}" data-data="{{btn.data||''}}" data-index="{{itemIndex}}" data-info="{{btn.info||''}}" data-list="{{Form.list}}" data-method="{{btn.method||''}}" data-mode="{{getdata[listIndex].mode}}" data-type="{{getdata[listIndex].type}}" icon="{{btn.icon||''}}" iconstyle="{{btn.iconstyle}}" plain="true" size="small" type="{{btn.type||'default'}}" wx:for="{{item.btn}}" wx:for-item="btn" wx:key="text">{{btn.text}}</van-button>
</view>
</view>
</view>
</view>
</van-tab>
<view class="manageAction van-hairline--right" slot="nav-left">
<van-icon bindtap="postToggle" customClass="Action-icon" name="zhuce2" size="26px"></van-icon>
</view>
<view class="manageAction van-hairline--left" slot="nav-right">
<van-transition customClass="fixed" name="slide-down" show="{{searchShow}}">
<view class="van-hairline--bottom">
<van-search showAction bind:cancel="searchRemove" bind:search="searchSubmit" customClass="tab-search" focus="{{searchFocus}}" placeholder="请输入搜索标题关键词" shape="round" value="{{searchVal}}"></van-search>
</view>
</van-transition>
<van-icon bindtap="searchToggle" customClass="Action-icon" name="fenlei2"></van-icon>
</view>
</van-tabs>
<van-popup bind:close="postToggle" closeOnClickOverlay="{{false}}" customStyle="width:80%;" show="{{postShow}}" title="{{Form.typename}}发布" titleStyle="font-weight:700;{{Form.titleStyle||'color:red'}}" zIndex="10000">
<template is="forview" data="{{list:Form.post}}"></template>
</van-popup>
<template is="list_bottom" data="{{...listdata[listIndex],loading:loading,lazy:Form.lazy.add>0,bottom:45}}"></template>
<template is="popupform" data="{{Form:popupForm}}"></template>
</block>

View File

@@ -0,0 +1,233 @@
@import "../../../__wuBaseWxss__/0.wxss";
@import "../../../vant/area/index.wxss";
page {
padding-bottom: 50px;
}
.manageList {
min-height: 1px;
}
.manageList .item {
overflow: hidden;
background: #fff;
margin: 10px 10px 0 10px;
padding: 0 10px;
border-radius: 2px;
}
.manageList .top {
position: relative;
height: 36px;
line-height: 36px;
border-bottom: 1px #eee solid;
}
.manageList .top .state {
text-align: right;
position: absolute;
right: 0;
top: 50%;
margin-top: -18px;
}
.manageList .top .state.green {
color: #58ba5b;
}
.manageList .top .state .van-icon {
line-height: 14px;
vertical-align: middle;
margin: -2.6px 2px 0 0;
font-size: 14px;
}
.manageList .top .time {
color: #777;
}
.manageList .top .time text {
font-family: Helvetica;
padding: 0 5px 0 3px;
color: #999;
}
.manageList .top .time text:last-child {
padding-right: 0;
}
.manageList .bot {
position: relative;
}
.manageList .bot .gicon {
padding: 0;
left: 0;
right: auto;
top: 11px;
}
.manageList .bot .gicon view {
border-radius: 2px;
padding: 3px 5px;
margin: 0 5px 0 0;
width: auto;
height: auto;
}
.manageList .bot .gicon view:last-child {
margin: 0;
}
.manageList .bot .gicon .van-icon.stats {
vertical-align: middle;
margin-top: -3px;
font-size: 22px;
margin-right: 2px;
border: 0;
color: #498BF8;
}
.manageList .bot .gicon .van-icon.image {
color: #6a4;
}
.manageList .info {
position: relative;
padding: 10px 0;
border-bottom: solid 1px #eee;
}
.manageList .info .pic {
border: 1px #eee solid;
width: 96px;
height: 76px;
overflow: hidden;
}
.manageList .info .pic image {
width: 100%;
}
.manageList .info .flex-item {
position: relative;
display: block;
margin-left: 10px;
}
.manageList .info .flex-item .tit {
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
line-height: 16px;
font-size: 12px;
color: #333;
max-height: 32px;
}
.manageList .info .flex-item .note {
color: #999;
position: absolute;
left: 0;
bottom: 5px;
width: 100%;
}
.manageList .info .flex-item .note>view {
position: relative;
}
.manageList .info .flex-item .note>view view {
display: inline-block;
}
.manageList .info .flex-item .note .tright {
position: absolute;
right: 0;
bottom: 0;
}
.manageList .info .flex-item .note .van-icon {
font-size: 14px;
margin-top: -2.6px;
vertical-align: middle;
}
.manageList .info .flex-item .note .text {
padding: 0 2px;
}
.manageList .info .flex-item .money {
font-family: Helvetica;
color: #f60;
padding-right: 2px;
}
.manageList .info .flex-item .money:first-child:before {
content: '¥';
font-size: 12px;
}
.manageAction {
width: 48px;
background: #fafafa;
}
.manageAction .Action-icon {
font-size: 20px;
color: #888;
line-height: 44px;
width: 40px;
text-align: center;
}
.tab-search.van-search {
padding: 5px 5px 5px 10px;
margin-top: 1px;
}
.released {
padding: 10px;
text-align: center;
}
.released .flex-item {
color: #3e98e2;
margin: 10px;
padding: 20px 35px;
border: #cde4f6 1px solid;
font-size: 18px;
border-radius: 6px;
background: #edf6fe;
}
.released .demand .flex-item {
color: #ff8521;
border: #ffe0cc 1px solid;
background: #fff8f4;
}
.released .flex-item:hover {
opacity: .8;
}
.released .title {
color: #666;
font-size: 18px;
line-height: 30px;
}
.released text {
vertical-align: top;
}
.released .van-icon {
font-size: 32px;
display: block;
margin-top: 3px;
}

View File

@@ -0,0 +1,134 @@
function t(t, a, e) {
return a in t ? Object.defineProperty(t, a, {
value: e,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[a] = e, t;
}
var a = require("../../../common/common.js");
Page({
data: {
search: "",
loading: !1,
Form: {},
getdata: [],
listdata: [],
spin: !0,
listIndex: 0,
loadnot: !1,
gotop: !1,
popupForm: {}
},
onLoad: function() {
a.init(this);
var t = this;
a.HttpMember("get/member/message", function(e) {
a.initializeRefresh(e);
var i = {
getdata: {},
listdata: {}
};
e.tabs.forEach(function(t, a) {
i.getdata[a] = {
mode: "message",
page: 1,
state: a
}, i.listdata[a] = {
list: [],
CurPage: 0
};
}), t.setData({
getdata: i.getdata,
listdata: i.listdata
}), a.initialFun(!1), a.GetList(function(a) {
t.setData({
spin: !1
});
});
});
},
initialize: function() {
var e, i = this, n = i.data.listIndex;
i.setData((e = {}, t(e, "initialValue.listIndex", n), t(e, "listdata." + n, {
list: [],
CurPage: 0
}), e)), a.initialFun(!0), a.GetList(function(t) {
wx.stopPullDownRefresh();
});
},
onShow: function() {
a.init(this);
},
searchChange: function(t) {
this.setData({
search: t.detail
});
},
searchSubmit: function() {
var t = this, e = {
getdata: {},
listdata: {}
};
t.data.Form.tabs.forEach(function(a, i) {
e.getdata[i] = {
page: 1,
state: i,
mode: "message"
}, "" != t.data.search && (e.getdata[i].key = t.data.search), e.listdata[i] = {
list: [],
CurPage: 0
};
}), t.setData({
getdata: e.getdata,
listdata: e.listdata
}), a.GetList();
},
onReachBottom: function() {
var e = this, i = e.data.listIndex, n = e.data.listdata[i];
if (!e.data.loadnot && !e.data.loading && n.CurPage < n.TotalPage) {
var s = "getdata." + i + ".page";
e.setData(t({}, s, 1 * e.data.getdata[i].page + 1)), a.GetList();
}
},
tabChange: function(t) {
var e = this, i = t.detail.index, n = e.data.listdata[i];
i != e.data.listIndex && (e.setData({
listIndex: i
}), n.CurPage ? n.CurPage < n.TotalPage ? e.loadnot = !1 : e.loadnot = !0 : a.GetList());
},
onPageScroll: function(t) {
var a = this, e = t.scrollTop, i = a.data.gotop, n = 2 * a.data.SystemInfo.windowHeight;
(e >= n && !i || e < n && i) && a.setData({
gotop: !i
});
},
readMessage: function(e) {
var i = this, n = e.currentTarget.dataset, s = n.index, o = n.url;
0 == n.state && (i.setData(t({}, "listdata." + i.data.listIndex + ".list[" + s + "].state", 1)),
a.Lay({
action: "ajax",
method: "execute",
batch: "message_read",
id: n.id
})), wx.navigateTo({
url: o
});
},
Lay: function(t) {
a.Lay(JSON.parse(JSON.stringify(t)));
},
Commom: function(t) {
var e = JSON.parse(JSON.stringify((t.currentTarget, t))), i = t.currentTarget ? e.currentTarget.dataset.action : e.action;
a[i](e);
},
Popup: function(t) {
a.Popup(t.currentTarget.dataset);
},
onPullDownRefresh: function() {
this.initialize();
},
onShareAppMessage: function() {}
});

View File

@@ -0,0 +1,13 @@
{
"usingComponents": {
"van-search": "/vant/search/index",
"forview": "/utils/forview/index",
"van-loading": "/vant/loading/index",
"van-dialog": "/vant/dialog/index",
"van-button": "/vant/button/index",
"van-icon": "/vant/icon/index",
"van-popup": "/vant/popup/index",
"van-tab": "/vant/tab/index",
"van-tabs": "/vant/tabs/index"
}
}

View File

@@ -0,0 +1,20 @@
<import src="/template/template.wxml"></import>
<template is="ly" data="{{popup:popup,popuphtml:popuphtml,spin:spin,gotop:gotop}}"></template>
<block wx:if="{{!spin}}">
<van-search bind:change="searchChange" bind:search="searchSubmit" icon="search" placeholder="请输入搜索标题关键词" shape="round" value="{{search}}"></van-search>
<van-tabs animated sticky swipeable active="{{listIndex}}" bind:change="tabChange" swipeThreshold="5">
<van-tab title="{{tab.name}}" wx:for="{{Form.tabs}}" wx:for-index="id" wx:for-item="tab" wx:key="value">
<view class="messageList" id="main">
<view bindtap="readMessage" class="item" data-id="{{item.id}}" data-index="{{index}}" data-state="{{item.state}}" data-url="{{item.url}}" wx:for="{{listdata[id].list}}" wx:key="id">
<view class="state v{{item.state}}"></view>
<view class="info">
<view class="time">
<text>{{item.sorts}}</text>{{item.time}}</view>
<view class="text">{{item.text}}</view>
</view>
</view>
</view>
</van-tab>
</van-tabs>
<template is="list_bottom" data="{{...listdata[listIndex],loading:loading,unit:'条'}}"></template>
</block>

View File

@@ -0,0 +1,45 @@
@import "../../../__wuBaseWxss__/0.wxss";
.messageList .item {
position: relative;
overflow: hidden;
margin: 10px 10px 0 10px;
}
.messageList .state {
background: #f00;
width: 8px;
height: 8px;
top: 50%;
left: 0;
position: absolute;
margin-top: -5px;
border-radius: 50px;
}
.messageList .state.v1 {
background: #c1c1c1;
}
.messageList .info {
margin-left: 18px;
background: #fff;
padding: 10px 10px 10px 13px;
line-height: 16px;
border: 1px #eee solid;
border-radius: 3px;
}
.messageList .info .time {
color: #999;
line-height: 12px;
padding-bottom: 5px;
}
.messageList .info text {
padding-right: 15px;
}
.messageList .info .text {
text-indent: -6px;
}

217
pages/member/list/order.js Normal file
View File

@@ -0,0 +1,217 @@
function t(t, a, e) {
return a in t ? Object.defineProperty(t, a, {
value: e,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[a] = e, t;
}
var a = function(t) {
return t && t.__esModule ? t : {
default: t
};
}(require("../../../vant/dialog/dialog")), e = require("../../../common/common.js");
Page({
data: {
dropShow: !1,
dropTips: "请输入订单号",
dropField: "order",
dropName: "订单号",
searchVal: "",
loading: !1,
Form: {},
getdata: [],
listdata: [],
animation: {},
popupSpin: !1,
popupForm: {},
previewList: [],
popup: [],
spin: !0,
listIndex: 0,
role: "buy",
loadnot: !1,
gotop: !1
},
onLoad: function(t) {
e.init(this);
var a = this;
e.HttpMember({
url: "get/member/order",
data: {
role: t.role || a.data.role
}
}, function(o) {
e.initializeRefresh(o);
var i = {
getdata: {},
listdata: {}
};
o.tabs.forEach(function(t, a) {
i.getdata[a] = {
mode: o.role,
page: 1,
state: t.value
}, i.listdata[a] = {
list: [],
CurPage: 0
};
}), a.setData({
role: t.role || a.data.role,
getdata: i.getdata,
listdata: i.listdata,
listIndex: t.mode || 0
}), e.initialFun(!1), e.GetList(function(t) {
a.setData({
spin: !1
});
});
});
},
onShow: function() {
e.init(this);
},
initialize: function() {
e.initialFun(!0), e.GetList(function(t) {
wx.stopPullDownRefresh();
});
},
confirmHandle: function(t) {
var o = t.currentTarget.dataset;
a.default.alert({
title: "提示",
message: decodeURIComponent(o.info),
overlay: !0,
showCancelButton: !0,
cancelButtonText: "返回",
closable: !1
}).then(function() {
e.HttpMember({
url: "deal/" + o.method,
data: o.data
});
}).catch(function() {});
},
orderHandlePopup: function(t) {
var a = t.currentTarget.dataset;
e.Lay({
table: "popupForm",
action: "pop",
method: "deal/" + a.method,
data: JSON.stringify({
number: a.data,
role: this.data.role,
action: a.action,
index: a.index
})
});
},
dropOpen: function() {
this.setData({
dropShow: !this.data.dropShow
});
},
searchChange: function(t) {
this.setData({
searchVal: t.detail
});
},
searchSubmit: function(t) {
var a = this, o = {
getdata: {},
listdata: {}
};
a.data.Form.tabs.forEach(function(t, e) {
o.getdata[e] = {
page: 1,
state: t.value,
mode: a.data.role,
first_input: a.data.searchVal,
first_select: a.data.dropField
}, o.listdata[e] = {
list: [],
CurPage: 0
};
}), a.setData({
listIndex: 0,
getdata: o.getdata,
listdata: o.listdata
}), e.GetList();
},
dropChange: function(t) {
var a = this, e = t.detail, o = a.data.Form.dropValue[e.index];
a.setData({
dropTips: "请输入" + e.value,
dropField: o,
dropName: e.value,
dropShow: !1
});
},
onReachBottom: function() {
var a = this, o = a.data.listIndex, i = a.data.listdata[o];
if (!a.data.loadnot && !a.data.loading && i.CurPage < i.TotalPage) {
var n = "getdata." + o + ".page";
a.setData(t({}, n, 1 * a.data.getdata[o].page + 1)), e.GetList();
}
},
tabChange: function(t) {
var a = this, o = t.detail.index, i = a.data.listdata[o];
o != a.data.listIndex && (a.setData({
listIndex: o
}), i.CurPage ? i.CurPage < i.TotalPage ? this.loadnot = !1 : this.loadnot = !0 : e.GetList());
},
onPageScroll: function(a) {
var e = this, o = a.scrollTop, i = e.data.gotop, n = 2 * e.data.SystemInfo.windowHeight;
if ((o >= n && !i || o < n && i) && e.setData({
gotop: !i
}), e.data.Form.lazy && e.data.Form.lazy.add > 0) {
var r = e.data.Form.lazy, d = Math.ceil((o + e.data.SystemInfo.windowHeight) / r.height) * e.data.Form.lazy.add;
d > r.pos && e.setData(t({}, "Form.lazy.pos", d));
}
},
ExecuteCallBack: function(a) {
var o = this, i = o.data.listIndex, n = a.index;
e.Popup({
action: "closeForm"
}), e.HttpMember({
url: o.data.Form.apiurl,
data: {
mode: o.data.role,
first_input: a.ddbh,
first_select: "order"
}
}, function(a) {
if (1 === a.Total) {
var e = a.list.shift(), r = wx.createAnimation({
duration: 600,
timingFunction: "ease"
});
r.rotateY(90).step(), setTimeout(function() {
o.setData(t({}, "animation." + e.ddbh, r.export()), function() {
setTimeout(function() {
r.rotateY(0).step(), o.setData(t({}, "animation." + e.ddbh, r.export()), function() {
o.setData(t({}, "listdata." + i + ".list[" + n + "]", e));
});
}, 600);
});
}, 100);
}
});
},
Lay: function(t) {
e.Lay(JSON.parse(JSON.stringify(t)));
},
Commom: function(t) {
var a = JSON.parse(JSON.stringify((t.currentTarget, t))), o = t.currentTarget ? a.currentTarget.dataset.action : a.action;
e[o](a);
},
Popup: function(t) {
e.Popup(t.currentTarget.dataset);
},
onPullDownRefresh: function() {
this.initialize();
},
onShareAppMessage: function() {}
});

View File

@@ -0,0 +1,23 @@
{
"usingComponents": {
"down": "/utils/count-down/index",
"van-search": "/vant/search/index",
"van-picker": "/vant/picker/index",
"van-cell": "/vant/cell/index",
"van-cell-group": "/vant/cell-group/index",
"van-field": "/vant/field/index",
"van-radio": "/vant/radio/index",
"van-radio-group": "/vant/radio-group/index",
"van-checkbox": "/vant/checkbox/index",
"van-checkbox-group": "/vant/checkbox-group/index",
"van-rate": "/vant/rate/index",
"forview": "/utils/forview/index",
"van-loading": "/vant/loading/index",
"van-dialog": "/vant/dialog/index",
"van-button": "/vant/button/index",
"van-icon": "/vant/icon/index",
"van-popup": "/vant/popup/index",
"van-tab": "/vant/tab/index",
"van-tabs": "/vant/tabs/index"
}
}

View File

@@ -0,0 +1,57 @@
<import src="/template/template.wxml"></import>
<template is="ly" data="{{popup:popup,popuphtml:popuphtml,spin:spin||popupSpin||false,gotop:gotop}}"></template>
<block wx:if="{{!spin}}">
<van-search useActionSlot bind:change="searchChange" bind:search="searchSubmit" icon="arrow-down" placeholder="{{dropTips}}" shape="round" value="{{searchVal}}">
<view catchtap="dropOpen" slot="label" style="padding:0 5px;line-height:34px;">{{dropName}}</view>
<view bind:tap="searchSubmit" slot="action">搜索</view>
</van-search>
<van-popup widthFull bind:close="dropOpen" closable="{{false}}" position="top" show="{{dropShow}}">
<van-picker showToolbar bind:cancel="dropOpen" bind:confirm="dropChange" columns="{{Form.dropKey}}" title="选择搜索对象"></van-picker>
</van-popup>
<van-tabs animated sticky swipeable active="{{listIndex}}" bind:change="tabChange" swipeThreshold="5">
<van-tab title="{{tab.name}}" wx:for="{{Form.tabs}}" wx:for-index="id" wx:for-item="tab" wx:key="value">
<view class="orderList" id="main">
<view animation="{{animation[item.ddbh]}}" class="item {{itemIndex===0&&'lazyView'}}" wx:for="{{listdata[id].list}}" wx:for-index="itemIndex" wx:key="itemIndex">
<view class="top">
<view class="name">{{item.dfinfo.role}}{{item.dfinfo.name}}</view>
<view class="contact">
<template is="forview" data="{{list:item.dfinfo.contact}}"></template>
</view>
<view class="money r">¥{{item.money}}<text wx:if="{{item.jifen>0}}">{{item.jifen}}积分</text>
</view>
</view>
<view class="row-flex info van-hairline--top-bottom">
<view class="pic loadImage van-hairline--surround" wx:if="{{item.thumb.type=='img'}}">
<image bindtap="Lay" data-action="preview" data-src="{{item.thumb.value}}" mode="widthFix" src="{{item.thumb.value}}" wx:if="{{Form.lazy.pos>itemIndex}}"></image>
</view>
<view class="pic van-hairline--surround" style="background: #fafafa;" wx:else>
<view>{{item.thumb.value}}</view>
</view>
<view class="flex-item attr">
<view class="title">
<navigator hoverClass="hover" url="{{item.link}}" wx:if="{{item.link}}">{{item.title}}</navigator>
<block wx:else>{{item.title}}</block>
</view>
<view class="gicon" wx:if="{{item.icon}}">
<template is="forview" data="{{list:item.icon}}"></template>
</view>
</view>
</view>
<view class="ts van-hairline--bottom">
<view class="time" style="color:{{item.time.color}}">
<van-icon name="{{item.time.down?'shalou':'clock-o'}}"></van-icon>
{{item.time.text}}<down customClass="{{item.time.class||''}}" customStyle="{{item.time.style||''}}" expireTime="{{item.time.value}}" wx:if="{{item.time.down==1}}"></down>
<block wx:else>{{item.time.value}}</block>
</view>
<rich-text class="state r" nodes="{{item.state}}"></rich-text>
</view>
<view class="ListAction">
<van-button bindtap="{{btn.bind||''}}" customClass="{{btn.class}}" data-action="{{btn.action||''}}" data-data="{{btn.data||''}}" data-index="{{itemIndex}}" data-info="{{btn.info||''}}" data-method="{{btn.method||''}}" icon="{{btn.icon||''}}" iconstyle="{{btn.iconstyle||''}}" plain="true" size="small" type="{{btn.type||'default'}}" wx:for="{{item.btn}}" wx:for-item="btn" wx:key="text">{{btn.text}}</van-button>
</view>
</view>
</view>
</van-tab>
</van-tabs>
<template is="list_bottom" data="{{...listdata[listIndex],loading:loading,lazy:Form.lazy.add>0,unit:'笔'}}"></template>
<template is="popupform" data="{{Form:popupForm}}"></template>
</block>

View File

@@ -0,0 +1,169 @@
@import "../../../__wuBaseWxss__/0.wxss";
@import "../../../vant/area/index.wxss";
.orderList .item {
overflow: hidden;
margin: 10px 10px 0 10px;
background: #fff;
padding: 0 10px;
border-radius: 2px;
}
.orderList .r {
position: absolute;
right: 0;
top: 0;
}
.orderList .top {
position: relative;
height: 40px;
line-height: 40px;
color: #999;
}
.orderList .top .name {
color: #666;
}
.orderList .top .money {
font-family: Helvetica;
color: red;
}
.orderList .top .money text {
color: #f60;
}
.orderList .top .money text:before {
content: " + ";
color: #ccc;
}
.orderList .top>view {
display: inline-block;
}
.orderList .top .contact view {
padding: 8px 3px;
vertical-align: middle;
margin-top: -2px;
}
.orderList .top .contact view:first-child {
margin-left: 5px;
}
.orderList .ts {
font-size: 12px;
height: 40px;
line-height: 40px;
position: relative;
}
.orderList .ts .time {
color: #999;
}
.orderList .ts .time .van-icon {
font-size: 19px;
line-height: 19px;
vertical-align: middle;
margin-top: -2px;
}
.orderList .action {
padding: 10px 0;
}
.orderList .action .van-button {
margin: 0 0 0 10px;
line-height: 23px;
font-size: 12px;
padding: 0 5px;
border: 1px solid #ededed;
color: #444;
height: 26px;
min-width: auto;
}
.orderList .action .van-button.green {
color: #3a933a;
border-color: #3a933a;
}
.orderList .action .van-button.orange {
color: #f60;
border-color: #f60;
}
.orderList .action .van-button.gray {
color: #999;
}
.orderList .action .van-button .van-icon {
vertical-align: middle;
margin-top: -2px;
margin-right: 2px;
}
.orderList .info {
padding: 12px 0;
width: 100%;
}
.orderList .info .pic {
color: #36c;
border: 1px #eee solid;
width: 96px;
height: 76px;
line-height: 76px;
overflow: hidden;
text-align: center;
}
.orderList .info .pic image {
width: 100%;
}
.orderList .info .attr {
margin-left: 10px;
position: relative;
}
.orderList .info .gicon {
position: absolute;
left: 0;
bottom: 0;
top: auto;
right: auto;
}
.orderList .info .gicon view {
border-radius: 2px;
padding: 3px 8px 4px 8px;
margin: 0 5px 0 0;
width: auto;
height: auto;
}
.orderList .info .attr .title {
line-height: 20px;
color: #333;
max-height: 40px;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.orderList .info .attr navigator {
color: #333;
}
.nav_top {
border-bottom: solid 1px #eee;
}

167
pages/member/login.js Normal file
View File

@@ -0,0 +1,167 @@
var t = function(t) {
return t && t.__esModule ? t : {
default: t
};
}(require("../../vant/dialog/dialog")), e = require("../../common/common.js");
Page({
data: {
username: "",
password: "",
options: {},
switchvalue: !1,
spin: !0,
current: 0,
tabs: [ {
key: 0,
title: "绑定已有帐号"
}, {
key: 1,
title: "新注册并绑定"
} ],
title: {
binding: "账号绑定",
authorize: "登录授权",
forget: "找回密码"
},
userInfo: [],
placeholderStyle: "font-size:12px;color:#ccc",
forgetSteps: [ {
text: "账号信息"
}, {
text: "手机验证"
}, {
text: "重设密码"
} ],
forgetFlow: 0
},
initialize: function() {
var t = this;
wx.getSetting({
success: function(e) {
e.authSetting["scope.userInfo"] && wx.getUserInfo({
success: function(e) {
t.setData({
userInfo: e.userInfo
});
}
});
}
}), t.setData({
spin: !0,
popupSpin: !1,
Form: {
form: {
radio: {},
checkbox: {},
picker: {},
rate: {}
}
},
popupForm: {
form: {
radio: {},
checkbox: {},
picker: {}
}
}
}), e.Http("html/login", function(t) {
e.initializeRefresh(t);
});
},
onLoad: function(t) {
e.init(this), this.initialize(), t.action || (t.action = "authorize"), this.setData({
options: t,
backfun: t.backfun || !1,
spin: !1
}), wx.setNavigationBarTitle({
title: this.data.title[t.action]
});
},
loginTypeChange: function(t) {
t.detail.value = 1 == t.detail.index ? "phone" : "name", e.Lay(t);
},
notBindSubmit: function(n) {
var i = n.detail.target.dataset.title;
t.default.alert({
title: "提示",
message: '<b>您确定<span style="color:red">不绑定</span>微信' + i + "吗?</b><br>绑定微信可以一键快捷登录账号",
closeOnClickOverlay: !1,
showCancelButton: !0,
cancelButtonText: "不绑定" + i,
confirmButtonText: "绑定" + i
}).then(function() {
e.Lay(n);
}).catch(function() {
n.detail.value.notbind = !0, e.Lay(n);
});
},
formSubmit: function(t) {
if ("notbind" == t.detail.target.dataset.method) return this.notBindSubmit(t);
e.Lay(t);
},
Lay: function(t) {
e.Lay(JSON.parse(JSON.stringify(t)));
},
Commom: function(t) {
var n = JSON.parse(JSON.stringify((t.currentTarget, t))), i = t.currentTarget ? n.currentTarget.dataset.action : n.action;
e[i](n);
},
Popup: function(t) {
e.Popup(t.currentTarget.dataset);
},
register: function() {
wx.navigateTo({
url: "register/register"
});
},
backurl: function() {
wx.getStorageSync("loginback");
this.setData({
forgetFlow: 0
}), this.data.backfun ? e.Lay({
action: "backfun",
info: this.data.backfun
}) : wx.reLaunch({
url: "/pages/member/member"
});
},
binding: function() {
this.setData({
"options.action": "binding"
});
},
bindGetUserInfo: function(t) {
var n = this;
t.detail;
e.Wxlogin(function(e) {
n.WxloginCallBack({
state: e
}, t);
});
},
WxloginCallBack: function(t, n) {
var i = this;
"success" == t.state ? i.backurl() : "binding" == t.state ? i.binding() : "authorize" == t.state && (n.detail.userInfo ? (n.detail.value = {
endata: encodeURIComponent(n.detail.encryptedData),
iv: encodeURIComponent(n.detail.iv),
signature: n.detail.signature
}, e.Lay(n)) : wx.showModal({
content: "必须授权才能继续操作,是否重新手动授权?",
confirmText: "授权",
cancelText: "取消",
success: function(t) {
t.confirm ? wx.openSetting({
success: function(t) {
t.authSetting["scope.userInfo"] && i.initialize();
}
}) : wx.reLaunch({
url: "/pages/index/index"
});
}
}));
},
onPullDownRefresh: function() {
this.initialize();
}
});

14
pages/member/login.json Normal file
View File

@@ -0,0 +1,14 @@
{
"usingComponents": {
"van-field": "../../vant/field/index",
"van-steps": "../../vant/steps/index",
"forview": "/utils/forview/index",
"van-loading": "/vant/loading/index",
"van-dialog": "/vant/dialog/index",
"van-button": "/vant/button/index",
"van-icon": "/vant/icon/index",
"van-popup": "/vant/popup/index",
"van-tab": "/vant/tab/index",
"van-tabs": "/vant/tabs/index"
}
}

60
pages/member/login.wxml Normal file
View File

@@ -0,0 +1,60 @@
<import src="/template/template.wxml"></import>
<template is="ly" data="{{popup:popup,popuphtml:popuphtml,spin:spin}}"></template>
<view class="login_wrap">
<view class="portrait">
<image src="{{userInfo.avatarUrl}}" wx:if="{{userInfo.avatarUrl}}"></image>
<van-icon customStyle="font-size:80px;color:#eee;" name="touxiang" wx:else></van-icon>
</view>
<view class="login_content" wx:if="{{options.action=='authorize'}}">
<view style="margin-top:50px;">
<van-button block bind:getuserinfo="bindGetUserInfo" data-action="formSubmit" data-url="get/login/authorize" openType="getUserInfo" size="normal" type="primary">微信{{!userInfo.language?'授权':''}}登录</van-button>
</view>
<view class="login_bottom">
<navigator class="login_back" hoverClass="other-navigator-hover" id="" openType="switchTab" url="/pages/index/index">
返回首页
</navigator>
</view>
</view>
<view class="login_wrap" wx:elif="{{options.action=='binding'}}">
<view class="login_content form">
<van-tabs active="{{current}}" color="#33cd5f" type="card">
<van-tab title="已有帐号">
<form bindsubmit="formSubmit" data-action="formSubmit" data-url="login?islogin=0">
<input hidden maxlength="-1" name="oauthAvatar" value="{{userInfo.avatarUrl}}"></input>
<input hidden maxlength="-1" name="oauthNick" value="{{userInfo.nickName}}"></input>
<input hidden maxlength="-1" name="login" value="{{Form.form.input.login||'name'}}"></input>
<van-tabs animated bind:change="loginTypeChange" data-action="input" data-name="login">
<van-tab title="账号密码登录">
<template is="forview" data="{{list:Form.input.name.list,form:Form.form}}"></template>
</van-tab>
<van-tab title="手机验证登录">
<template is="forview" data="{{list:Form.input.phone.list,form:Form.form}}"></template>
</van-tab>
</van-tabs>
<view style="margin-top:50px;">
<button class="formbutton" data-method="bind" data-title="登录" formType="submit" hoverClass="hover">登录并绑定微信</button>
<button class="notbind" data-method="notbind" data-title="登录" formType="submit">登录但不绑定微信</button>
</view>
</form>
<view class="login_bottom">
<navigator class="gray" hoverClass="hover" id="" openType="switchTab" url="/pages/index/index">
返回首页
</navigator>
<navigator class="gray" hoverClass="hover" url="{{Form.fetchUrl}}">忘记密码</navigator>
</view>
</van-tab>
<van-tab title="新注册">
<form bindsubmit="formSubmit" data-action="formSubmit" data-url="reg?islogin=0" style="margin-top:10px;">
<input hidden maxlength="-1" name="oauthAvatar" value="{{userInfo.avatarUrl}}"></input>
<input hidden maxlength="-1" name="oauthNick" value="{{userInfo.nickName}}"></input>
<template is="forview" data="{{list:Form.input.reg.list,form:Form.form}}"></template>
<view style="margin-top:10px;">
<button class="formbutton" data-method="bind" data-title="注册" formType="submit">注册并绑定微信</button>
<button class="notbind" data-method="notbind" data-title="注册" formType="submit">注册但不绑定微信</button>
</view>
</form>
</van-tab>
</van-tabs>
</view>
</view>
</view>

67
pages/member/login.wxss Normal file
View File

@@ -0,0 +1,67 @@
@import "../../__wuBaseWxss__/0.wxss";
@import "../../__wuBaseWxss__/1.wxss";
page {
background: #fff;
}
.notbind {
background: none;
border: 0;
height: 20px;
line-height: 20px;
font-size: 14px;
color: #666;
margin: 20px 0;
}
.notbind:after {
display: none;
}
.login_wrap {
height: 100%;
display: flex;
flex-direction: column;
}
.portrait {
text-align: center;
padding: 100rpx 0;
flex: 1;
background: #f5f5f5;
}
.portrait image {
overflow: hidden;
border: 3px solid #fff;
border-radius: 50%;
width: 80px;
height: 80px;
}
.login_content {
padding: 20px 20px 0 20px;
}
.login_bottom {
position: fixed;
bottom: 10px;
left: 0;
width: 100%;
text-align: center;
}
.login_bottom view {
display: inline-block;
padding: 5px;
font-size: 14px;
color: #9C9C9C;
color: #D4D4D4;
}
.login_bottom navigator {
display: inline-block;
padding: 5px;
}

72
pages/member/member.js Normal file
View File

@@ -0,0 +1,72 @@
function t(t, i, e) {
return i in t ? Object.defineProperty(t, i, {
value: e,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[i] = e, t;
}
var i = require("../../common/common.js");
Page({
data: {
spin: !0,
CustomNavigation: !0,
timestamp: 0
},
initialize: function() {
this.setData({
spin: !0,
popupSpin: !1,
Form: {
form: {
radio: {},
checkbox: {},
picker: {},
rate: {}
}
},
popupForm: {
form: {
radio: {},
checkbox: {},
picker: {}
}
},
timestamp: i.timestamp()
}), i.HttpMember("get/member/index?islogin=0", function(t) {
i.initializeRefresh(t);
});
},
onShow: function(t) {
i.init(this), i.timestamp() - this.data.timestamp >= 30 && this.initialize();
},
signHide: function() {
var i = this.data.Form.form;
i.radio.sign = !0, this.setData(t({}, "Form.form", i));
},
onLoad: function() {
i.init(this);
},
onPullDownRefresh: function() {
this.initialize();
},
swiperAutoHeight: function(e) {
var n = this, r = e.currentTarget.dataset, a = (n.data.Form.form.swiperHeight || {})[r.name] || {};
a[e.detail.current] || i.querySelect("#swiper-" + r.name + "-" + e.detail.current, function(i) {
a[e.detail.current] = "height:" + i.height + "px;", n.setData(t({}, "Form.form.swiperHeight." + r.name, a));
});
},
Lay: function(t) {
i.Lay(JSON.parse(JSON.stringify("Event" == t.type ? t.detail : t)));
},
Commom: function(t) {
var e = JSON.parse(JSON.stringify((t.currentTarget, t))), n = t.currentTarget ? e.currentTarget.dataset.action : e.action;
i[n](e);
},
Popup: function(t) {
i.Popup(t.currentTarget.dataset);
},
onShareAppMessage: function() {}
});

16
pages/member/member.json Normal file
View File

@@ -0,0 +1,16 @@
{
"usingComponents": {
"van-field": "/vant/field/index",
"van-cell": "/vant/cell/index",
"van-cell-group": "/vant/cell-group/index",
"forview": "/utils/forview/index",
"van-loading": "/vant/loading/index",
"van-dialog": "/vant/dialog/index",
"van-button": "/vant/button/index",
"van-icon": "/vant/icon/index",
"van-popup": "/vant/popup/index",
"van-tab": "/vant/tab/index",
"van-tabs": "/vant/tabs/index"
},
"navigationStyle": "custom"
}

5
pages/member/member.wxml Normal file
View File

@@ -0,0 +1,5 @@
<import src="/template/template.wxml"></import>
<template is="ly" data="{{spin:spin}}"></template>
<view style="height:{{SystemInfo.CustomBar||60}}px"></view>
<template is="form" data="{{Form:Form}}" wx:if="{{!spin}}"></template>
<template is="popupform" data="{{Form:popupForm}}"></template>

361
pages/member/member.wxss Normal file
View File

@@ -0,0 +1,361 @@
@import "../../__wuBaseWxss__/0.wxss";
@import "../../__wuBaseWxss__/1.wxss";
.m-bg {
height: 180px;
background-image: linear-gradient(to right,#8debff,#6cacff);
background-color: #6cacff;
border-radius: 0 0 16px 16px;
z-index: 0;
position: absolute;
top: 0;
left: 0;
width: 100%;
}
.member {
position: relative;
z-index: 1;
padding: 6px 15px 15px 15px;
font-size: 1rem;
}
.m-topicon {
z-index: 999;
height: 28px;
position: absolute;
top: -30px;
left: 15px;
}
.m-topicon .van-icon {
color: #fafafa;
font-size: 28px;
line-height: 28px;
height: 28px;
}
.m-box {
background: #fff;
border-radius: 8px;
padding: 15px;
margin-bottom: 15px;
box-shadow: 0 1px 4px #e0e0e0;
}
.m-box:last-child {
margin: 0;
}
.m-user {
position: relative;
}
.m-user .myid {
font-size: 0.8rem;
position: absolute;
right: -5px;
top: -5px;
color: #c0c0c0;
}
.m-user image {
width: 50px;
height: 50px;
border-radius: 100%;
border: none;
}
.m-user .info {
padding: 3px 0 0 12px;
overflow: hidden;
}
.m-user .name {
font-weight: 700;
margin-bottom: 2px;
padding-right: 2.2rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.m-assets {
text-align: center;
padding: 15px 0 0 0;
font-size: 0.8rem;
}
.m-assets .flex-item {
position: relative;
}
.m-assets .flex-item:not(:last-child):after {
content: " ";
position: absolute;
pointer-events: none;
box-sizing: border-box;
transform-origin: center;
top: -30%;
left: -50%;
right: -50%;
bottom: -30%;
transform: scale(.5);
border: 0 solid #e5e5e5;
border-right-width: 1px;
}
.m-assets .number {
font-size: 1rem;
color: #333;
padding-bottom: 2px;
}
.m-notice {
color: #666;
padding: 10px 0 0 0;
margin-top: 15px;
}
.m-notice .van-icon {
font-size: 1.2rem;
color: #9b9b9b;
vertical-align: middle;
margin-top: -3px;
}
.m-notice .flex-item {
padding: 0 5px;
height: 20px;
color: #666;
}
.m-notice swiper,.m-notice swiper view {
height: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.m-block {
text-align: center;
padding: 12px 0 12px 0;
}
.m-block .row-flex {
padding: 8px 0;
}
.m-block .flex-item {
line-height: 20px;
}
.m-block .flex-item .icon {
display: inline-block;
position: relative;
}
.m-block .flex-item .number {
position: absolute;
top: -5px;
right: -5px;
border-radius: 12px;
font-size: 12px;
line-height: 12px;
background: #fff;
border: 1px #FEA832 solid;
color: #FEA832;
padding: 1px 3px;
min-width: 8px;
text-align: center;
}
.m-block .flex-item .count0 {
display: none;
}
.m-block .flex-item text {
display: block;
padding-top: 3px;
}
.m-block .flex-item .van-icon {
font-size: 1.8rem;
color: #a9a9a9;
}
.m-title {
padding: 3px 0 12px 0;
margin: 0 15px 8px 15px;
line-height: 1.2rem;
}
.m-title .row-flex {
padding: 0;
}
.m-title .van-icon {
margin-top: -2px;
}
.m-title text {
font-weight: 700;
font-size: 1rem;
}
.m-title .flex-item {
padding: 0 3px;
font-size: .9rem;
color: #a9a9a9;
text-align: right;
}
.m-icon .wx-swiper-dots.wx-swiper-dots-horizontal {
bottom: -10px;
}
.m-icon .wx-swiper-dot {
width: 16px;
display: inline-flex;
height: 2px;
opacity: .8;
justify-content: space-between;
}
.m-icon .wx-swiper-dot::before {
content: '';
flex-grow: 1;
background: #ccc;
}
.m-icon .wx-swiper-dot-active::before {
background: #f80;
}
.m-strip .row-flex {
line-height: 20px;
padding: 10px 0;
}
.m-strip .row-flex:first-child {
padding-top: 3px;
}
.m-strip .row-flex:last-child {
padding-bottom: 3px;
}
.m-strip .van-icon {
font-size: 1.3rem;
color: #9b9b9b;
vertical-align: middle;
margin-top: -3px;
}
.m-strip .flex-item {
padding: 0 3px;
font-size: .9rem;
color: #999;
text-align: right;
}
.m-strip text {
padding-left: 8px;
}
.datadiff_top {
position: fixed;
width: 100%;
top: 42px;
border-bottom: 1px solid #e5e5e5;
box-shadow: 0 1px 2px #e6e6e6;
background: #fff;
}
.datadiff .datadiff_top tr td {
text-align: left;
padding: 10px;
color: #999;
}
.datadiff_bottom {
border-top: 2px solid rgb(222,229,237);
position: fixed;
width: 100%;
bottom: 0;
background: #f2f5f8;
}
.datadiff_bottom tr td {
background-color: #f2f5f8;
}
.datadiff_center {
width: 100%;
margin-bottom: 44px;
}
.datadiff_center td {
border-bottom: rgb(222,229,237) solid 1px;
}
.datadiff .datadiff_bottom tr td {
text-align: center;
padding: 10px;
}
.datadiff tr td {
text-align: center;
padding: 15px;
word-wrap: break-word;
word-break: break-all;
}
.datadiff tr td.tcer {
background: #fbfdff;
border-left: rgb(222,229,237) solid 1px;
border-right: rgb(222,229,237) solid 1px;
}
.datadiff .action {
top: 42px;
padding: 10px 0;
position: fixed;
right: 5px;
width: 100%;
text-align: center;
}
.datadiff .action {
top: 42px;
padding: 10px 0;
position: fixed;
right: 5px;
width: 100%;
text-align: center;
}
.datadiff img {
border: #e5e5e5 1px solid;
border-radius: 2px;
box-shadow: 0 2px 3px rgba(0,0,0,.1);
}
.datadiff_txt {
display: block;
text-align: center;
}
.datadiff_img img {
margin: 3px;
}
.datadiff_action {
bottom: 40px;
padding: 10px 0;
position: fixed;
right: 0;
width: 100%;
text-align: center;
}

179
pages/member/myorder.js Normal file
View File

@@ -0,0 +1,179 @@
function t(t, i, e) {
return i in t ? Object.defineProperty(t, i, {
value: e,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[i] = e, t;
}
var i = function(t) {
return t && t.__esModule ? t : {
default: t
};
}(require("../../vant/dialog/dialog")), e = require("../../common/common.js");
Page({
data: {
bh: "",
spin: !0,
popupSpin: !1,
popup: [],
flowShow: !1,
timestamp: 0,
gotop: !1,
row: [],
height: {
ListAction: 0
},
historyDispute: {},
previewList: [],
Form: {
form: {
radio: {},
checkbox: {},
picker: {}
}
},
popupForm: {
form: {
radio: {},
checkbox: {},
picker: {}
}
}
},
onLoad: function(t) {
t.bh && this.setData({
bh: t.bh
}), e.init(this), this.initialize(!1);
},
onShow: function() {
e.init(this), this.data.Form.form.formLoad && this.initialize();
},
initialize: function() {
var t = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0], i = this;
i.setData({
spin: !0
}), e.initialFun(t), e.HttpMember("get/myorder/" + i.data.bh, function(t) {
if (wx.setNavigationBarTitle({
title: "订单详情"
}), wx.setNavigationBarColor({
frontColor: "#ffffff",
backgroundColor: "#FE952B",
animation: {
duration: 0,
timingFunc: "easeIn"
}
}), 0 === t.state) return e.Lay(i, {
info: t.info
});
i.setData({
row: t,
spin: !1,
timestamp: e.timestamp()
}), wx.stopPullDownRefresh();
});
},
flowChange: function() {
this.setData({
flowShow: !this.data.flowShow
});
},
onPageScroll: function(t) {
var i = this, e = t.scrollTop, a = i.data.gotop, o = 2 * i.data.SystemInfo.windowHeight;
if (i.data.height.main >= o) {
var n = Math.ceil((i.data.height.main - i.data.SystemInfo.windowHeight) / 2);
(e <= n && !0 === a || e > n && !0 !== a) && i.setData({
gotop: !0 !== a || i.data.height.bottom
});
}
},
htmlHeight: function() {
var t = this;
wx.createSelectorQuery().selectAll("#main,#ListAction").boundingClientRect(function(i) {
var e = {
bottom: 10
};
for (var a in i) {
var o = i[a];
e[o.id] = Math.ceil(o.height), e.bottom += e[o.id];
}
t.setData({
height: e,
gotop: e.bottom >= 2 * t.data.SystemInfo.windowHeight && e.bottom
});
}).exec();
},
Lay: function(t) {
e.Lay(JSON.parse(JSON.stringify(t)));
},
Commom: function(t) {
var i = JSON.parse(JSON.stringify((t.currentTarget, t))), a = t.currentTarget ? i.currentTarget.dataset.action : i.action;
e[a](i);
},
Popup: function(t) {
e.Popup(t.currentTarget.dataset);
},
confirmHandle: function(t) {
var a = t.currentTarget.dataset;
i.default.alert({
title: "提示",
message: decodeURIComponent(a.info),
overlay: !0,
showCancelButton: !0,
cancelButtonText: "返回",
closable: !1
}).then(function() {
e.HttpMember({
url: "deal/" + a.method,
data: a.data
});
}).catch(function() {});
},
orderHandlePopup: function(t) {
var i = t.currentTarget.dataset;
e.Lay({
action: "pop",
method: "deal/" + i.method,
data: JSON.stringify({
number: this.data.bh,
role: this.data.row.myRole,
action: i.action,
utime: this.data.row.order.utime
})
});
},
orderHide: function() {
this.setData({
Form: {
form: {
radio: {},
checkbox: {},
picker: {}
}
}
}), this.WxValidate = {};
},
disputeChange: function() {
var i = this, a = i.data.historyDispute;
if (i.setData({
popupSpin: !0
}), a.html) {
var o;
i.setData((o = {}, t(o, "historyDispute.show", !a.show), t(o, "popupSpin", !1),
o));
} else e.HttpMember("get/myorder/" + i.data.bh + "/dispute", function(e) {
var a;
i.setData((a = {}, t(a, "initialValue.historyDispute.html", e.html), t(a, "historyDispute", e),
t(a, "popupSpin", !1), a));
});
wx.setNavigationBarTitle({
title: a.show ? "退款历史记录" : "订单详情"
});
},
onPullDownRefresh: function() {
this.initialize();
},
onShareAppMessage: function() {}
});

25
pages/member/myorder.json Normal file
View File

@@ -0,0 +1,25 @@
{
"enablePullDownRefresh": false,
"usingComponents": {
"down": "/utils/count-down/index",
"van-steps": "/vant/steps/index",
"van-field": "/vant/field/index",
"van-radio": "/vant/radio/index",
"van-radio-group": "/vant/radio-group/index",
"van-cell": "/vant/cell/index",
"van-cell-group": "/vant/cell-group/index",
"van-stepper": "/vant/stepper/index",
"van-picker": "/vant/picker/index",
"van-rate": "/vant/rate/index",
"van-checkbox": "/vant/checkbox/index",
"van-checkbox-group": "/vant/checkbox-group/index",
"forview": "/utils/forview/index",
"van-loading": "/vant/loading/index",
"van-dialog": "/vant/dialog/index",
"van-button": "/vant/button/index",
"van-icon": "/vant/icon/index",
"van-popup": "/vant/popup/index",
"van-tab": "/vant/tab/index",
"van-tabs": "/vant/tabs/index"
}
}

111
pages/member/myorder.wxml Normal file
View File

@@ -0,0 +1,111 @@
<import src="/template/template.wxml"></import>
<template is="ly" data="{{popup:popup,popuphtml:popuphtml,spin:spin||popupSpin||false,gotop:gotop,bottom:height.ListAction}}"></template>
<view id="main" wx:if="{{!spin}}">
<view class="ostate" wx:if="{{row.order}}">
<view class="top row-flex">
<view class="icon">
<van-icon name="shalou"></van-icon>
</view>
<view class="state">{{row.order.state}}</view>
<view bindtap="Lay" class="flex-item tright" data-action="copy" data-info="订单号:{{bh}}" data-title="订单号复制成功">订单号:{{bh}}</view>
<view bindtap="flowChange" class="more">
<van-icon name="wap-nav"></van-icon>
</view>
</view>
<view class="ohtml">
<view class="tmain">
<view class="{{hang.class||'p'}}" style="{{hang.style||''}}" wx:for="{{row.prompt.index}}" wx:for-item="hang" wx:key="index">
<block wx:if="{{hang.class!='dispute'}}">
<template is="view" data="{{view:row}}" wx:for="{{hang.list}}" wx:for-item="row" wx:key="index"></template>
</block>
<template is="forview" data="{{list:row.prompt.dispute}}" wx:else></template>
</view>
</view>
</view>
</view>
<view class="ohis van-hairline--top-bottom" wx:if="{{row.prompt.his}}">
<block wx:for="{{row.prompt.his}}" wx:key="index">
<view bindtap="{{data.bind||''}}" class="{{data.class||''}}" data-action="{{data.action||''}}" data-data="{{data.data||''}}" data-info="{{data.info||''}}" data-method="{{data.method||''}}" wx:for="{{item.list}}" wx:for-item="data" wx:key="text">{{data.text}}</view>
</block>
</view>
<view class="oinfo">
<view class="row-flex van-hairline--bottom" wx:if="{{item}}" wx:for="{{row.oinfo}}" wx:key="index">
<view class="tright">{{index}}</view>
<view class="flex-item" wx:if="{{index!='交易内容'}}">
<template is="forview" data="{{list:item}}"></template>
</view>
<view class="flex-item txt" wx:else>
<view class="{{!item[0].main||item[1]?'box '+txt.class:''}}" wx:for="{{item}}" wx:for-index="xh" wx:for-item="txt" wx:key="index">
<view class="top" wx:if="{{!item[0].main||item[1]}}">
<text class="left">{{txt.title}}</text>
<text class="right">{{txt.time}}</text>
</view>
<view class="bottom">
<text class="text">{{txt.text}}</text>
<block wx:if="{{txt.filelist}}">
<block wx:if="{{txt.filelist.image}}">
<view class="filetit">图片附件</view>
<view class="bfile">
<view wx:for="{{txt.filelist.image}}" wx:for-item="url" wx:key="url">
<image hidden bindload="Lay" data-action="intoPreview" data-field="Txt{{xh}}" data-src="{{url}}" src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg=="></image>
<view>
<view>
<image bindtap="Lay" data-action="allPreview" data-field="Txt{{xh}}" data-src="{{url}}" mode="widthFix" src="{{url}}" webp="{{true}}"></image>
</view>
</view>
</view>
</view>
</block>
<block wx:if="{{txt.filelist.other}}">
<view class="filetit">非图片附件仅能在PC端查看内容</view>
<view class="other">
<view wx:for="{{txt.filelist.other}}" wx:for-index="i" wx:for-item="data" wx:key="index">
{{data}}
</view>
</view>
</block>
</block>
</view>
</view>
</view>
</view>
</view>
<view style="height:{{height.ListAction+10}}px;overflow:hidden;">
<image bindload="htmlHeight" src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" style="width:0;height:0;"></image>
</view>
<view class="ListAction fixed" id="ListAction">
<view>
<view bindtap="onPullDownRefresh" class="shuaxin">
<van-icon name="shuaxin1"></van-icon>
</view>
<van-button bindtap="{{btn.bind||''}}" customClass="{{btn.class}}" data-action="{{btn.action}}" data-data="{{btn.data||''}}" data-info="{{btn.info}}" data-method="{{btn.method||''}}" icon="{{btn.icon}}" iconstyle="{{btn.iconstyle}}" plain="true" size="small" type="{{btn.type||'default'}}" wx:for="{{row.button}}" wx:for-item="btn" wx:key="value">{{btn.value}}</van-button>
</view>
</view>
<van-popup heightFull bind:close="flowChange" customStyle="width:88%;" overlay="{{true}}" position="right" show="{{flowShow}}" title="交易记录" titleStyle="text-align: center" zIndex="10000">
<view class="lyTop">
<view class="good">
<image mode="widthFix" src="{{row.order.goodpic}}!/fh/74/canvas/74x74a0a0" wx:if="{{row.order.goodpic&&flowShow}}"></image>
<block wx:else>{{row.order.typename}}</block>
</view>
<view class="info">
<view action="url" bind="Lay" class="tit" info="{{row.order.goodurl}}">{{row.order.tit}}</view>
<view>金额:<text class="money">{{row.order.money}}</text>元</view>
<view>订单号:{{bh}}</view>
</view>
</view>
<view class="oflow">
<view class="row {{index==row.flow.curr?'cur':''}}" wx:for="{{row.flow.list}}" wx:key="text">
<view class="info">
<view class="text">{{item.text}}</view>
<rich-text class="desc" nodes="{{item.desc}}" wx:if="{{item.desc}}"></rich-text>
</view>
</view>
</view>
</van-popup>
<van-popup heightFull widthFull bind:close="disputeChange" closeOnClickOverlay="{{false}}" overlay="{{true}}" position="right" show="{{historyDispute.show}}" title="订单号:{{bh}}" titleStyle="text-align: center" zIndex="10000">
<view class="history dispute" wx:if="{{historyDispute.html}}">
<template is="forview" data="{{list:historyDispute.html}}"></template>
</view>
</van-popup>
<template is="popupform" data="{{Form:popupForm}}"></template>
</view>

652
pages/member/myorder.wxss Normal file
View File

@@ -0,0 +1,652 @@
@import "../../__wuBaseWxss__/0.wxss";
@import "../../vant/area/index.wxss";
.oinfo {
overflow: hidden;
width: 100%;
background: #fff;
}
.oinfo .row-flex {
margin: 0 10px;
}
.oinfo .tright {
padding: 12px 10px 12px 0;
line-height: 20px;
color: #000;
border-right: 1px #f1f1f1 solid;
width: 65px;
}
.oinfo .flex-item {
padding: 12px 0 12px 10px;
line-height: 20px;
position: relative;
}
.oinfo navigator,.oinfo text,.oinfo view {
word-break: break-all;
}
.oinfo .flex-item .contact {
position: absolute;
right: 0;
top: 50%;
height: 40px;
margin-top: -20px;
}
.oinfo .flex-item .contact view {
padding: 10px 3px;
}
.oinfo .flex-item .but {
margin: 5px 5px 0 0;
height: 20px;
line-height: 20px;
padding: 0 5px;
border: 1px solid #6a4;
background: #eff;
color: #6a4;
display: inline-block;
border-radius: 2px;
}
.oinfo .flex-item .but.buy_install {
margin-right: 100px;
border-color: #c9c9c9;
background: #fff;
color: #666;
}
.oinfo .txt .top {
overflow: hidden;
background: #f9f9f9;
color: #666;
padding: 5px 10px;
border-bottom: #eee solid 1px;
line-height: 20px;
}
.oinfo .txt .top .left {
color: #000;
}
.oinfo .no .bottom,.oinfo .ok .bottom {
padding: 8px 10px;
}
.oinfo .txt .top:before {
content: '有效';
color: #090;
margin-left: 10px;
float: right;
}
.oinfo .txt .no .top:before {
content: '无效';
color: red;
}
.oinfo .txt .box {
border: #eee solid 1px;
margin-top: 10px;
border-radius: 3px;
}
.oinfo .txt .box:first-child {
margin: 0;
}
.oinfo .txt .text {
line-height: 18px;
}
.oinfo .txt .filetit {
border: 1px solid #f1f1f1;
background: #f9f9f9;
padding: 5px 10px;
line-height: 20px;
margin-top: 8px;
}
.oinfo .txt .other {
border: 1px solid #eee;
border-top: 0;
}
.oinfo .txt .other view {
line-height: 18px;
margin: 0 5px;
padding: 2px 0;
border-bottom: 1px solid #f1f1f1;
}
.ostate {
overflow: hidden;
background: #fff;
border-bottom: 1px solid #f6f6f6;
}
.ostate .top {
position: relative;
font-size: 14px;
padding: 0 5px;
line-height: 32px;
height: 32px;
border-bottom: 2px solid #fe952b;
border-left: 0;
border-right: 0;
}
.ostate .top .icon {
width: 34px;
}
.ostate .top .icon .van-icon {
color: #fe952b;
margin-bottom: -1.5px;
font-size: 34px;
line-height: 34px;
}
.ostate .top .more {
width: 22px;
padding-left: 5px;
}
.ostate .top .more .van-icon {
font-size: 22px;
line-height: 31px;
}
.ostate .top .state {
color: #fe952b;
padding-left: 5px;
width: 110px;
font-size: 14px;
}
.ostate .top .tright {
color: #666;
}
.ohtml {
position: relative;
overflow: hidden;
background: #fff7eb;
text-align: left;
color: #666;
}
.ohtml .tmain {
padding: 5px 15px;
font-size: 12px;
}
.ohtml .p {
border-top: 1px dotted #ccc;
padding: 10px 0;
}
.ohtml .p:first-child {
border-top: 0;
}
.ohtml .p:after {
content: "";
}
.ohtml .p:last-child:after {
content: "。";
}
.ohtml .p>view {
display: inline;
}
.ohtml .u {
text-decoration: underline;
}
.ostate_tips div.ostate_ico {
margin-top: 5px;
height: 35px;
float: left;
width: 2.5rem;
background: url(//static.huzhan.com/img/claims_ico.png) no-repeat;
}
.ostate_suc div.ostate_ico {
background-position: .8rem -80px;
}
.ostate_suc .p {
color: #51863c;
}
.ostate_ing div.ostate_ico {
background-position: .8rem -1px;
}
.ostate_ing .p {
color: #f60;
}
.ostate_no div.ostate_ico {
background-position: .8rem -40px;
}
.ostate_no .p {
color: #97731f;
}
.appeal {
position: relative;
margin: 8px 0 -2px 0;
border: #a6c5ef solid 1px;
background: #edf7ff;
padding: 8px 10px;
border-radius: 4px;
box-shadow: 0 1px 3px #e6ecf3;
}
.dispute {
position: relative;
margin: 0 0 -2px 0;
overflow: hidden;
border: 1px solid #e5e5e5;
background: #fff;
border-radius: 5px;
padding: 10px;
}
.dispute.history {
margin: 0;
border-radius: 0;
border: 0;
}
.dispute .dl {
margin-bottom: 10px;
padding: 5px 0 5px 42px;
overflow: hidden;
position: relative;
}
.dispute .dl.mine {
padding: 5px 42px 5px 0;
text-align: right;
}
.dispute .avatar {
position: absolute;
left: 0;
width: 32px;
height: 32px;
border-radius: 50%;
top: 5px;
overflow: hidden;
}
.dispute .avatar image {
width: 100%;
border-radius: 50%;
}
.dispute .mine .avatar {
left: auto;
right: 0;
}
.dispute .head {
overflow: hidden;
}
.dispute .head view {
display: inline-block;
line-height: 22px;
font-size: 12px;
white-space: nowrap;
color: #999;
padding-right: 10px;
font-style: normal;
}
.dispute .body {
margin: 3px 0 0 0;
position: relative;
padding: 10px;
background: #f0f0f0;
border-radius: 3px;
color: #333;
word-break: break-all;
margin-right: 35px;
}
.dispute .body:after {
content: '';
position: absolute;
left: -6px;
top: 15px;
width: 0;
height: 0;
border-style: solid dashed dashed;
border-color: #f0f0f0 transparent transparent;
overflow: hidden;
border-width: 6px;
}
.dispute .mine .head view {
float: right;
padding-left: 10px;
padding-right: 0;
}
.dispute .mine .body {
line-height: 1.5;
margin: 0 0 0 35px;
}
.dispute .mine .body:after {
left: auto;
right: -6px;
}
.dispute .fortips {
padding: 10px 0;
text-align: center;
}
.dispute .fortips .body {
float: none;
background: #fafafa;
border: #ddd solid 1px;
padding: 8px 10px;
margin: 0;
border-radius: 5px;
display: inline-block;
box-shadow: 1px 1px 8px rgba(0,0,0,.2);
}
.dispute .fortips .body:after {
display: none;
}
.dispute .moneyInfo view {
padding: 4px 3px 5px 8px;
border: 1px solid #e0e0e0;
border-bottom: 1px solid #c5c5c5;
box-shadow: 0 1px 1px #dbdbdb;
background: #fafafa;
border-radius: 3px;
margin-bottom: 5px;
color: #555;
display: inline-block;
}
.dispute .notMoney .moneyInfo view,.dispute .notUpquote .txt {
text-decoration: line-through;
}
.ohis {
text-align: right;
background: #f6f7f6;
}
.ohis view {
display: inline-block;
font-size: 12px;
color: #999;
margin: 8px 8px 8px 0;
padding: 2px 6px;
background: #f5faff;
border: #d4e7f6 solid 1px;
}
.oflow {
background: #fff;
overflow: hidden;
padding: 10px 0 10px 19px;
}
.oflow .row {
position: relative;
padding: 0 0 0 19px;
border-left: 1px solid #cecece;
color: #999;
}
.oflow .row:before {
content: "";
position: absolute;
left: -6px;
top: 50%;
margin-top: -5px;
border-radius: 100%;
width: 10px;
height: 10px;
background: #cecece;
}
.oflow .info {
border-bottom: 1px solid #f1f1f1;
padding: 15px 0;
font-size: 14px;
}
.oflow .info .text {
line-height: 25px;
}
.oflow .info .desc {
font-size: 12px;
color: #999;
}
.oflow .row:last-child .info {
border: 0;
}
.oflow .row.cur .text {
color: #333;
}
.oflow .row.cur:before {
background: #f55b5b;
border: 2px solid #fbc1c1;
left: -8px;
margin-top: -7px;
width: 12px;
height: 12px;
}
.ListAction {
bottom: 0;
top: auto;
text-align: right;
overflow: hidden;
padding-top: 0;
border-top: 1px #eee solid;
background: #fff;
width: 100%;
}
.ListAction>view {
padding-left: 42px;
position: relative;
}
.ListAction .shuaxin {
position: absolute;
left: 10px;
top: 50%;
margin-top: -7px;
width: 22px;
height: 22px;
line-height: 22px;
}
.ListAction .shuaxin .van-icon {
font-size: 22px;
color: #ccc;
}
.ListAction .van-button {
margin: 10px 10px 0 0;
}
.myInfo {
overflow: hidden;
margin: 10px 0 0 0;
border: #ffe0cc solid 2px;
background: #fff8f4;
}
.myInfo .row-flex {
padding: 5px;
border-top: #ffe0cc solid 1px;
line-height: 18px;
}
.myInfo .label {
font-weight: 700;
width: 40px;
}
.myInfo .update {
text-align: right;
width: 50px;
}
.myInfo .tit {
background: #ffe0cc;
font-weight: 700;
font-size: 14px;
}
.hisInfo {
background: #fafafa;
margin: 0 10px 10px 10px;
padding: 1px 10px;
border-radius: 2px;
line-height: 20px;
border: 1px solid #e5e5e5;
}
.hisInfo .label {
color: #222;
font-weight: 700;
display: inline;
}
.hisInfo .label:after {
content: '';
}
.hisInfo .row {
padding: 5px 0;
border-bottom: 1px solid #f2f2f2;
}
.hisInfo .row:last-child {
border: 0;
}
.hisInfo:first-child {
margin-top: 10px;
}
.appendSee {
margin: 10px;
background: #fff;
}
.appendSee .row-flex {
border: #a6c5ef solid 3px;
border-top: 0;
line-height: 20px;
}
.appendSee .head {
background: #a6c5ef;
padding: 5px 0 2px 0;
color: #fff;
text-align: center;
}
.appendSee .head .flex-item {
padding: 0;
}
.appendSee .state .flex-item>view>view {
display: inline;
}
.appendSee .f3div {
position: relative;
height: 100%;
}
.appendSee .f3wx {
text-align: center;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.appendSee .f3wx view {
position: absolute;
width: 100%;
top: 0;
left: 0;
height: 100%;
background: #fff;
opacity: .9;
}
.appendSee .f3wx view view {
line-height: 35px;
font-weight: 700;
height: 35px;
left: 0;
top: 70px;
color: red;
background: 0 0;
-khtml-opacity: 1;
opacity: 1;
font-family: serif;
}
.appendSee .row-flex.state {
background: #edf7ff;
color: #222;
border-top: #a6c5ef solid 3px;
}
.appendSee .flex-item {
border-left: #a6c5ef solid 1px;
padding: 10px;
}
.appendSee .label {
font-size: 14px;
text-align: right;
width: 40px;
padding: 10px 10px 10px 0;
font-weight: 700;
}
.appendSee .info {
padding-top: 5px;
margin-top: 5px;
overflow: hidden;
position: relative;
word-break: break-all;
border-top: #a6c5ef dashed 1px;
}