This commit is contained in:
pplokijuhyg 2019-12-24 15:02:17 +08:00
commit 68a7aea72c
365 changed files with 9339 additions and 9254 deletions

76
app.js
View File

@ -1,39 +1,39 @@
//app.js //app.js
App({ App({
onLaunch: function () { onLaunch: function () {
// 展示本地存储能力 // 展示本地存储能力
var logs = wx.getStorageSync('logs') || [] var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now()) logs.unshift(Date.now())
wx.setStorageSync('logs', logs) wx.setStorageSync('logs', logs)
// 登录 // 登录
wx.login({ wx.login({
success: res => { success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId // 发送 res.code 到后台换取 openId, sessionKey, unionId
} }
}) })
// 获取用户信息 // 获取用户信息
wx.getSetting({ wx.getSetting({
success: res => { success: res => {
if (res.authSetting['scope.userInfo']) { if (res.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
wx.getUserInfo({ wx.getUserInfo({
success: res => { success: res => {
// 可以将 res 发送给后台解码出 unionId // 可以将 res 发送给后台解码出 unionId
this.globalData.userInfo = res.userInfo this.globalData.userInfo = res.userInfo
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况 // 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) { if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res) this.userInfoReadyCallback(res)
} }
} }
}) })
} }
} }
}) })
}, },
globalData: { globalData: {
userInfo: null userInfo: null
} }
}) })

View File

@ -21,6 +21,9 @@
color: #999999; color: #999999;
font-size: 28rpx; font-size: 28rpx;
} }
.shurupla1{
color: #333333;
}
.arrow { .arrow {
width: 14rpx; width: 14rpx;
height: 25rpx; height: 25rpx;

View File

@ -1,11 +1,11 @@
<view class="shuru"> <view class="shuru">
<view class="left">{{left}}</view> <view class="left">{{left}}</view>
<view class="right"wx:if="{{ifarrow}}" bindtap="choose"> <view class="right"wx:if="{{ifarrow}}" bindtap="choose">
<text class="shurupla">{{right}}</text> <text class="shurupla1">{{right}}</text>
<view class="arrow"></view> <view class="arrow"></view>
</view> </view>
<view class="right" wx:else> <view class="right" wx:else>
<input type="text" placeholder-class="shurupla" class="shuru1" placeholder="{{right}}" value="" bindinput="get" no="0" data-left="{{left}}"/> <input type="text" placeholder-class="shurupla" class="shuru1" placeholder="{{right}}" value="" bindinput="get" no="0" data-left="{{left}}"/>
</view> </view>
</view> </view>

View File

@ -1,37 +1 @@
.shuru { .shuru{width:670rpx;height:100rpx;border-bottom:2rpx solid #E8E8E8;margin:0 auto;display:flex;justify-content:space-between;line-height:100rpx;font-size:28rpx}.shuru .left{color:#333333}.shuru .right{margin:auto 0;display:flex}.shuru .right .shuru1{width:280rpx;text-align:right}.shuru .right .shurupla{color:#999999;font-size:28rpx}.shuru .right .shurupla1{color:#333333}.shuru .right .arrow{width:14rpx;height:25rpx;background-color:#999999;margin:auto 0;margin-left:27rpx}
width: 670rpx;
height: 100rpx;
border-bottom: 2rpx solid #E8E8E8;
margin: 0 auto;
display: flex;
justify-content: space-between;
line-height: 100rpx;
font-size: 28rpx;
}
.shuru .left {
color: #333333;
}
.shuru .right {
margin: auto 0;
display: flex;
}
.shuru .right .shuru1 {
width: 280rpx;
text-align: right;
}
.shuru .right .shurupla {
color: #999999;
font-size: 28rpx;
}
.shuru .right .arrow {
width: 14rpx;
height: 25rpx;
background-color: #999999;
margin: auto 0;
margin-left: 27rpx;
}

View File

@ -1 +1 @@
.list{padding-left:20rpx;width:572rpx;box-sizing:border-box;height:100vh}.list .commodity{width:552rpx;display:flex;align-items:center}.list .commodity .content{width:552rpx;height:100%;display:flex;align-items:center;border-bottom:2rpx solid #eaeaea;padding:30rpx 0}.list .commodity .content .imgthumb{width:105rpx;height:105rpx;margin-left:40rpx;background-color:#333}.list .commodity .content .introduce{width:336rpx;margin-left:40rpx;display:flex;flex-direction:column}.list .commodity .content .introduce .towline{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.list .commodity .content .introduce>text{font-size:22rpx;color:#333;margin-bottom:22rpx}.list .commodity .content .introduce>view{display:flex;align-items:center;justify-content:space-between}.list .commodity .content .introduce>view>text:first-child{font-size:30rpx;color:#dec499}.list .commodity .content .introduce>view>text:last-child{font-size:22rpx;color:#999} .list{padding-left:20rpx;width:572rpx;box-sizing:border-box;height:100vh}.list .commodity{width:552rpx;display:flex;align-items:center}.list .commodity .content{width:552rpx;height:100%;display:flex;align-items:center;border-bottom:2rpx solid #eaeaea;padding:30rpx 0}.list .commodity .content .imgthumb{width:105rpx;height:105rpx;margin-left:40rpx;background-color:#333}.list .commodity .content .introduce{width:336rpx;margin-left:40rpx;display:flex;flex-direction:column}.list .commodity .content .introduce .towline{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.list .commodity .content .introduce>text{font-size:22rpx;color:#333;margin-bottom:22rpx}.list .commodity .content .introduce>view{display:flex;align-items:center;justify-content:space-between}.list .commodity .content .introduce>view>text:first-child{font-size:30rpx;color:#dec499}.list .commodity .content .introduce>view>text:last-child{font-size:22rpx;color:#999}

View File

@ -1 +1 @@
.navigation{width:188rpx;border-right:2rpx solid #eaeaea;max-height:100vh}.navigation view{height:97rpx;font-size:28rpx;color:#333;border-bottom:2rpx solid #eaeaea;line-height:97rpx;font-weight:bold;text-align:center;box-sizing:border-box}.navigation .on{border-left:5rpx solid #56CC84;color:#56CC84} .navigation{width:188rpx;border-right:2rpx solid #eaeaea;max-height:100vh}.navigation view{height:97rpx;font-size:28rpx;color:#333;border-bottom:2rpx solid #eaeaea;line-height:97rpx;font-weight:bold;text-align:center;box-sizing:border-box}.navigation .on{border-left:5rpx solid #56CC84;color:#56CC84}

View File

@ -1 +1 @@
.commodity{width:623rpx;height:143rpx;margin-top:32rpx;display:flex;align-items:center}.commodity .content{width:614rpx;height:100%;display:flex;align-items:center;box-shadow:0 0 24rpx 0 rgba(227,227,227,0.4)}.commodity .content .imgthumb{width:105rpx;height:105rpx;margin-left:40rpx;background-color:#333}.commodity .content .introduce{width:410rpx;margin-left:40rpx;display:flex;flex-direction:column}.commodity .content .introduce>text{font-size:26rpx;color:#333;margin-bottom:22rpx;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.commodity .content .introduce>view{display:flex;align-items:center;justify-content:space-between}.commodity .content .introduce>view>text:first-child{font-size:30rpx;color:#dec499}.commodity .content .introduce>view>text:last-child{font-size:22rpx;color:#999}.commodity .decorate{width:9rpx;height:102rpx;background-color:#3fb66e} .commodity{width:623rpx;height:143rpx;margin-top:32rpx;display:flex;align-items:center}.commodity .content{width:614rpx;height:100%;display:flex;align-items:center;box-shadow:0 0 24rpx 0 rgba(227,227,227,0.4)}.commodity .content .imgthumb{width:105rpx;height:105rpx;margin-left:40rpx;background-color:#333}.commodity .content .introduce{width:410rpx;margin-left:40rpx;display:flex;flex-direction:column}.commodity .content .introduce>text{font-size:26rpx;color:#333;margin-bottom:22rpx;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.commodity .content .introduce>view{display:flex;align-items:center;justify-content:space-between}.commodity .content .introduce>view>text:first-child{font-size:30rpx;color:#dec499}.commodity .content .introduce>view>text:last-child{font-size:22rpx;color:#999}.commodity .decorate{width:9rpx;height:102rpx;background-color:#3fb66e}

View File

@ -1 +1 @@
.list{width:623rpx;margin-top:36rpx}.list .title{font-size:30rpx;color:#333;font-weight:bold;margin-left:32rpx} .list{width:623rpx;margin-top:36rpx}.list .title{font-size:30rpx;color:#333;font-weight:bold;margin-left:32rpx}

View File

@ -1 +1 @@
.search{width:613rpx;height:76rpx;margin-top:30rpx;box-sizing:border-box;border-radius:15rpx;display:flex;border:1rpx solid #c6c6c6}.search>image{width:42rpx;height:42rpx;background-color:#000;margin-left:40rpx;margin-top:17rpx}.search>input{height:30rpx;width:480rpx;margin-top:20rpx;margin-left:17rpx;font-size:30rpx} .search{width:613rpx;height:76rpx;margin-top:30rpx;box-sizing:border-box;border-radius:15rpx;display:flex;border:1rpx solid #c6c6c6}.search>image{width:42rpx;height:42rpx;background-color:#000;margin-left:40rpx;margin-top:17rpx}.search>input{height:30rpx;width:480rpx;margin-top:20rpx;margin-left:17rpx;font-size:30rpx}

View File

@ -13,4 +13,4 @@
<!-- <view class="button" catch:tap="cancel">取消订单</view> --> <!-- <view class="button" catch:tap="cancel">取消订单</view> -->
<view class="button hlight" catch:tap="shouhuo">确认收货</view> <view class="button hlight" catch:tap="shouhuo">确认收货</view>
</view> </view>
</view> </view>

View File

@ -1 +1 @@
.commodity{margin-top:20rpx;background-color:#fff}.commodity .message{padding:35rpx;display:flex;align-items:center;border-bottom:1rpx solid #F2F2F2}.commodity .message .image{width:141rpx;height:150rpx;background-color:#000;margin-left:34rpx}.commodity .message .introduce{margin-left:32rpx;height:120rpx;display:flex;flex-direction:column;justify-content:space-between;width:362rpx}.commodity .message .introduce .title{font-size:28rpx;color:#333}.commodity .message .introduce .count{font-size:24rpx;color:#999;display:flex}.commodity .message .introduce .count>view{margin-right:27rpx}.commodity .message .parameter{width:150rpx;height:120rpx;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end}.commodity .aggregate{display:flex;box-sizing:border-box;padding:30rpx;justify-content:flex-end;font-size:22rpx;color:#999;height:78rpx;border-bottom:1rpx solid #F2F2F2}.commodity .aggregate>text{color:#333;margin:0 5rpx}.commodity .operation{height:84rpx;display:flex;justify-content:flex-end;padding:0 30rpx;align-items:center}.commodity .operation .button{width:133rpx;height:51rpx;border:2rpx solid #999999;border-radius:26rpx;text-align:center;font-size:22rpx;color:#999999;line-height:51rpx;margin-right:8rpx}.commodity .operation .hlight{border:2rpx solid #47c877;color:#47C877} .commodity{margin-top:20rpx;background-color:#fff}.commodity .message{padding:35rpx;display:flex;align-items:center;border-bottom:1rpx solid #F2F2F2}.commodity .message .image{width:141rpx;height:150rpx;background-color:#000;margin-left:34rpx}.commodity .message .introduce{margin-left:32rpx;height:120rpx;display:flex;flex-direction:column;justify-content:space-between;width:362rpx}.commodity .message .introduce .title{font-size:28rpx;color:#333}.commodity .message .introduce .count{font-size:24rpx;color:#999;display:flex}.commodity .message .introduce .count>view{margin-right:27rpx}.commodity .message .parameter{width:150rpx;height:120rpx;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end}.commodity .aggregate{display:flex;box-sizing:border-box;padding:30rpx;justify-content:flex-end;font-size:22rpx;color:#999;height:78rpx;border-bottom:1rpx solid #F2F2F2}.commodity .aggregate>text{color:#333;margin:0 5rpx}.commodity .operation{height:84rpx;display:flex;justify-content:flex-end;padding:0 30rpx;align-items:center}.commodity .operation .button{width:133rpx;height:51rpx;border:2rpx solid #999999;border-radius:26rpx;text-align:center;font-size:22rpx;color:#999999;line-height:51rpx;margin-right:8rpx}.commodity .operation .hlight{border:2rpx solid #47c877;color:#47C877}

View File

@ -14,4 +14,4 @@
<van-tab title="售后"> <van-tab title="售后">
<commodity wx:for="{{AFTERSALE}}" wx:for-index="j" wx:key="{{j}}" data-id="{{item.order_id}}" num="{{item.goods_num}}" cprice="{{item.goods_price}}" freight="{{item.integral_money}}" goods="{{item.goods_list}}"></commodity> <commodity wx:for="{{AFTERSALE}}" wx:for-index="j" wx:key="{{j}}" data-id="{{item.order_id}}" num="{{item.goods_num}}" cprice="{{item.goods_price}}" freight="{{item.integral_money}}" goods="{{item.goods_list}}"></commodity>
</van-tab> </van-tab>
</van-tabs> </van-tabs>

View File

@ -1 +1 @@
.content{background-color:#fff;width:750rpx;padding-bottom:33rpx}.content .aggregate{display:flex;box-sizing:border-box;padding:30rpx;justify-content:flex-end;font-size:22rpx;color:#999;height:78rpx;border-bottom:1rpx solid #f2f2f2}.content .aggregate>text{color:#333;margin:0 5rpx}.content .message{display:flex;padding:0 30rpx;justify-content:space-between;font-size:26rpx;color:#333;align-items:center;height:77rpx;border-bottom:1rpx solid #f2f2f2}.content .leave{display:flex;height:77rpx;padding:0 30rpx;align-items:center} .content{background-color:#fff;width:750rpx;padding-bottom:33rpx}.content .aggregate{display:flex;box-sizing:border-box;padding:30rpx;justify-content:flex-end;font-size:22rpx;color:#999;height:78rpx;border-bottom:1rpx solid #f2f2f2}.content .aggregate>text{color:#333;margin:0 5rpx}.content .message{display:flex;padding:0 30rpx;justify-content:space-between;font-size:26rpx;color:#333;align-items:center;height:77rpx;border-bottom:1rpx solid #f2f2f2}.content .leave{display:flex;height:77rpx;padding:0 30rpx;align-items:center}

View File

@ -1 +1 @@
.logistics{margin-top:20rpx;background-color:#fff}.logistics .title{height:84rpx;font-size:28rpx;color:#333;line-height:84rpx;border-bottom:2rpx solid #e5e5e5;padding-left:29rpx;box-sizing:border-box}.logistics .schedule{width:650rpx;margin-left:50rpx} .logistics{margin-top:20rpx;background-color:#fff}.logistics .title{height:84rpx;font-size:28rpx;color:#333;line-height:84rpx;border-bottom:2rpx solid #e5e5e5;padding-left:29rpx;box-sizing:border-box}.logistics .schedule{width:650rpx;margin-left:50rpx}

View File

@ -1 +1 @@
.orderchooseaddr{background-color:#fff;width:750rpx;height:148rpx;margin:0 auto;border-bottom:20rpx solid #fbfbfb;display:flex;justify-content:space-between}.orderchooseaddr .left{width:572rpx;height:80rpx}.orderchooseaddr .left .userinfo{color:#333333;font-size:26rpx;text-indent:30rpx;margin-top:41rpx;display:flex;justify-content:space-between}.orderchooseaddr .left .addr{color:#999999;font-size:24rpx;text-indent:30rpx;margin-top:32rpx}.orderchooseaddr .right{width:17rpx;height:30rpx;background-color:#d3d3d3;margin:auto 0;margin-right:19rpx} .orderchooseaddr{background-color:#fff;width:750rpx;height:148rpx;margin:0 auto;border-bottom:20rpx solid #fbfbfb;display:flex;justify-content:space-between}.orderchooseaddr .left{width:572rpx;height:80rpx}.orderchooseaddr .left .userinfo{color:#333333;font-size:26rpx;text-indent:30rpx;margin-top:41rpx;display:flex;justify-content:space-between}.orderchooseaddr .left .addr{color:#999999;font-size:24rpx;text-indent:30rpx;margin-top:32rpx}.orderchooseaddr .right{width:17rpx;height:30rpx;background-color:#d3d3d3;margin:auto 0;margin-right:19rpx}

View File

@ -1 +1 @@
.payment{width:750rpx;height:98rpx;position:fixed;bottom:0;display:flex;justify-content:space-between;background-color:#fff;align-items:center}.payment .price{font-size:34rpx;margin-left:74rpx}.payment .price .title{color:#333}.payment .price .counts{color:#ff3838}.payment .submit{width:250rpx;height:98rpx;background-color:#47c877;font-size:30rpx;color:#fff;line-height:98rpx;text-align:center} .payment{width:750rpx;height:98rpx;position:fixed;bottom:0;display:flex;justify-content:space-between;background-color:#fff;align-items:center}.payment .price{font-size:34rpx;margin-left:74rpx}.payment .price .title{color:#333}.payment .price .counts{color:#ff3838}.payment .submit{width:250rpx;height:98rpx;background-color:#47c877;font-size:30rpx;color:#fff;line-height:98rpx;text-align:center}

View File

@ -1 +1 @@
.merchandise{padding:46rpx 32rpx;display:flex;border-bottom:20rpx solid #fbfbfb}.merchandise .image{width:171rpx;height:168rpx;background-color:#000}.merchandise .message{margin-left:24rpx}.merchandise .message .title{font-size:26rpx;color:#333;width:491rpx;margin-bottom:9rpx}.merchandise .message .brief{font-size:22rpx;color:#999;margin-bottom:26rpx}.merchandise .message .price{font-size:28rpx;color:#ff4e6c} .merchandise{padding:46rpx 32rpx;display:flex;border-bottom:20rpx solid #fbfbfb}.merchandise .image{width:171rpx;height:168rpx;background-color:#000}.merchandise .message{margin-left:24rpx}.merchandise .message .title{font-size:26rpx;color:#333;width:491rpx;margin-bottom:9rpx}.merchandise .message .brief{font-size:22rpx;color:#999;margin-bottom:26rpx}.merchandise .message .price{font-size:28rpx;color:#ff4e6c}

View File

@ -1,66 +1,66 @@
// pages/accomplish/accomplish.js // pages/accomplish/accomplish.js
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function () {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
} }
}) })

View File

@ -1,7 +1,7 @@
{ {
"usingComponents": { "usingComponents": {
"content":"../components/particulars/content/index", "content":"../components/particulars/content/index",
"orderchooseaddr":"../components/particulars/orderchooseaddr/index", "orderchooseaddr":"../components/particulars/orderchooseaddr/index",
"logistics": "../components/particulars/logistics/index" "logistics": "../components/particulars/logistics/index"
} }
} }

View File

@ -1,5 +1,5 @@
<view class="box"> <view class="box">
<orderchooseaddr></orderchooseaddr> <orderchooseaddr></orderchooseaddr>
<content></content> <content></content>
<logistics></logistics> <logistics></logistics>
</view> </view>

View File

@ -1 +1 @@
page{background-color:#fbfbfb} page{background-color:#fbfbfb}

View File

@ -1,170 +1,282 @@
// pages/addaddress/addaddress.js // pages/addaddress/addaddress.js
import { request } from "../../utils/bin" import { request } from "../../utils/bin"
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
canshu: [], canshu: [],
no: 0, no: 0,
userid:"", userid:"",
show: false, show: false,
arealist:[], arealist1:[],
area:["请选择","请选择","请选择"] arealist2:[],
}, arealist3:[],
area:["请选择","请选择","请选择"],
/** tagDis:[false,true,true],
* 生命周期函数--监听页面加载 active:0,
*/ addressCity:"请选择 请选择 请选择",
onLoad: function (options) { countrys:[],
request({ countryid:44,
url: "User/getArea", nowcountry:"中国",
urldata:{ areaid:[]
parent_id:0 },
},
}).then((res)=>{ /**
console.log(res) * 生命周期函数--监听页面加载
this.setData({ */
arealist:res.data.result onLoad: function (options) {
}) request({
console.log(this.data.arealist) url: "User/getArea",
}) urldata:{
parent_id:0
}, },
bindPickerChange(e) {
console.log(e) }).then((res)=>{
}, // console.log(res)
showPopup() { this.setData({
this.setData({ show: true }); arealist1:res.data.result
}, })
console.log(this.data.arealist)
onClose() { })
this.setData({ show: false });
}, request({
onMyEvent(e) { url: "User/getCountry",
console.log(e) }).then((res)=>{
for (let i = 0; i < 8; i++) { let country=[]
if (i == e.currentTarget.dataset.no) { console.log(res,10000)
this.data.canshu[i] = e.detail for(let i=0;i<res.data.result.length;i++){
} country[i]=res.data.result[i].name
}
} this.setData({
countrys:country
console.log(this.data.canshu) })
}, })
choose(e){
console.log(e.currentTarget.dataset.id,e.currentTarget.dataset.name,e.currentTarget.dataset) },
let type=parseInt(e.currentTarget.dataset.type) bindPickerChange(e) {
request({ console.log(e.detail.value)
url: "User/getArea", let nowcountry=this.data.countrys[e.detail.value]
urldata:{ this.setData({
parent_id:e.currentTarget.dataset.id countryid:e.detail.value+1,
}, nowcountry:nowcountry
}).then((res)=>{ })
console.log(res) console.log(nowcountry,"zxc")
if(res.data.result.length){ },
this.setData({ showPopup() {
arealist1:res.data.result this.setData({ show: true });
}) },
// this.data.area[type]=e.currentTarget.dataset.name
onClose() {
console.log(this.data.area,123) this.setData({ show: false });
},
} onMyEvent(e) {
// for(let i in this.data.area){ // console.log(e)
// if(i==type){ for (let i = 0; i < 8; i++) {
// this.data.area[i]=e.currentTarget.dataset.name if (i == e.currentTarget.dataset.no) {
// } this.data.canshu[i] = e.detail
// } }
this.data.area[0]=e.currentTarget.dataset.name
}
console.log(this.data.area,this.data.arealist)
}) // console.log(this.data.canshu)
}, },
save() { choose1(e){
// wx.navigateTo({ // console.log(e.currentTarget.dataset.id,e.currentTarget.dataset.name,e.currentTarget.dataset)
// url: "/pages/chooseaddr/chooseaddr" let type=parseInt(e.currentTarget.dataset.type)
// }) request({
request({ url: "User/getArea",
url: "User/validateOpenid", urldata:{
}).then((res)=>{ parent_id:e.currentTarget.dataset.id
console.log(res,1452) },
this.setData({ }).then((res)=>{
userid:res.data.data.user_id // console.log(res)
}) this.setData({
request({ arealist2:res.data.result,
url: "User/addAddress", active:1
urldata:{ })
user_id:this.data.userid // this.data.area[type]=e.currentTarget.dataset.name
}, this.setData({
method:"POST", tagDis:[false,false,true]
data: { })
address: "Wesrdtfyguhijkl", // console.log(this.data.area,123)
city: "339", this.data.area[0]=e.currentTarget.dataset.name
consignee: "srdtfyguhijokl", this.data.areaid[0]=e.currentTarget.dataset.id
country: 1, // for(let i in this.data.area){
district: "361", // if(i==type){
is_default: 0, // this.data.area[i]=e.currentTarget.dataset.name
mobile: "19953879035", // }
province: "338", // }
twon: 0, this.setData({
user_id: "9", area:this.data.area
zipcode: "271103", })
}
}).then((res)=>{ // console.log(this.data.area,this.data.arealist)
console.log(res) })
}) },
}) choose2(e){
// console.log(e.currentTarget.dataset.id,e.currentTarget.dataset.name,e.currentTarget.dataset)
let type=parseInt(e.currentTarget.dataset.type)
}, request({
/** url: "User/getArea",
* 生命周期函数--监听页面初次渲染完成 urldata:{
*/ parent_id:e.currentTarget.dataset.id
onReady: function () { },
}).then((res)=>{
},
this.setData({
/** arealist3:res.data.result,
* 生命周期函数--监听页面显示 active:2,
*/ tagDis:[false,false,false]
onShow: function () { })
}, // this.data.area[type]=e.currentTarget.dataset.name
/** // console.log(this.data.area,123)
* 生命周期函数--监听页面隐藏
*/ this.data.area[1]=e.currentTarget.dataset.name
onHide: function () { this.data.areaid[1]=e.currentTarget.dataset.id
// for(let i in this.data.area){
}, // if(i==type){
// this.data.area[i]=e.currentTarget.dataset.name
/** // }
* 生命周期函数--监听页面卸载 // }
*/
onUnload: function () { this.setData({
area:this.data.area
}, })
/** // console.log(this.data.area,this.data.arealist)
* 页面相关事件处理函数--监听用户下拉动作 console.log(this.data.arealist3+"001",this.data.active+"002",this.data.tagDis+"003")
*/ })
onPullDownRefresh: function () {
}, },
choose3(e){
/** // console.log(e.currentTarget.dataset.id,e.currentTarget.dataset.name,e.currentTarget.dataset)
* 页面上拉触底事件的处理函数 let type=parseInt(e.currentTarget.dataset.type)
*/ request({
onReachBottom: function () { url: "User/getArea",
urldata:{
}, parent_id:e.currentTarget.dataset.id
},
/** }).then((res)=>{
* 用户点击右上角分享 // console.log(res)
*/ this.setData({
onShareAppMessage: function () { arealist1:res.data.result,
tagDis:[false,false,false],
} active:1
})
// this.data.area[type]=e.currentTarget.dataset.name
// console.log(this.data.area,123)
this.data.area[2]=e.currentTarget.dataset.name
this.data.areaid[2]=e.currentTarget.dataset.id
// for(let i in this.data.area){
// if(i==type){
// this.data.area[i]=e.currentTarget.dataset.name
// }
// }}
console.log(93)
this.setData({
area:this.data.area,
show: false,
addressCity:this.data.area[0]+this.data.area[1]+this.data.area[2]
})
console.log(this.data.active,94)
// console.log(this.data.area,this.data.arealist)
})
},
save() {
// wx.navigateTo({
// url: "/pages/chooseaddr/chooseaddr"
// })
console.log(this.data.canshu)
console.log(this.data.countryid)
console.log(this.data.area)
console.log(this.data.areaid)
request({
url: "User/validateOpenid",
}).then((res)=>{
console.log(res,1452)
this.setData({
userid:res.data.data.user_id
})
request({
url: "User/addAddress",
urldata:{
user_id:this.data.userid
},
method:"POST",
data: {
// address: this.data.canshu[4],
city: this.data.areaid[1],
consignee: this.data.canshu[0],
country: this.data.countryid,
address: this.data.canshu[4],
is_default: 0,
mobile: this.data.canshu[1],
province: this.data.areaid[0],
twon: this.data.areaid[2],
user_id:this.data.userid,
zipcode: this.data.canshu[5],
idcard: this.data.canshu[6],
}
}).then((res)=>{
console.log(res)
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
}) })

View File

@ -1,42 +1,42 @@
<view class="addaddress"> <view class="addaddress">
<shuru left="收件人" right="姓名需和身份证一致" bindmyevent="onMyEvent" data-no="0"></shuru> <shuru left="收件人" right="姓名需和身份证一致" bindmyevent="onMyEvent" data-no="0"></shuru>
<shuru left="手机号" right="请填入常用的手机号码" bindmyevent="onMyEvent" data-no="1"></shuru> <shuru left="手机号" right="请填入常用的手机号码" bindmyevent="onMyEvent" data-no="1"></shuru>
<picker bindchange="bindPickerChange" value="{{item.item_id?item.item_id:0}}" range="{{info.goods.goods_spec_list?info.goods.goods_spec_list:['默认规格']}}"> <picker bindchange="bindPickerChange" value="{{index}}" range="{{countrys}}">
<shuru left="国家" right="CN中国大陆" ifarrow="{{true}}" data-no="2"></shuru> <shuru left="国家" right="{{nowcountry}}" ifarrow="{{true}}" data-no="2"></shuru>
</picker> </picker>
<!-- <picker bindchange="bindPickerChange" value="{{item.item_id?item.item_id:0}}" range="{{info.goods.goods_spec_list?info.goods.goods_spec_list:['默认规格']}}"> <!-- <picker bindchange="bindPickerChange" value="{{item.item_id?item.item_id:0}}" range="{{info.goods.goods_spec_list?info.goods.goods_spec_list:['默认规格']}}">
<shuru left="城市信息" right="北京市 北京市 东城区" ifarrow="{{true}}" data-no="3"></shuru> <shuru left="城市信息" right="北京市 北京市 东城区" ifarrow="{{true}}" data-no="3"></shuru>
</picker> --> </picker> -->
<view bindtap="showPopup"> <view bindtap="showPopup">
<shuru left="城市信息" right="北京市 北京市 东城区" ifarrow="{{true}}" data-no="3"></shuru> <shuru left="城市信息" right="{{addressCity}}" ifarrow="{{true}}" data-no="3"></shuru>
</view> </view>
<van-popup show="{{ show }}" position="bottom" bind:close="onClose"> <van-popup show="{{ show }}" position="bottom" bind:close="onClose" >
<van-tabs class="tab" swipe-threshold="5"> <van-tabs class="tab" swipe-threshold="5" active="{{active}}">
<van-tab title="{{area[0]}}"> <van-tab title="{{area[0]}}" disabled="{{tagDis[0]}}">
<view class="choose"> <view class="choose">
<view class="item" wx:for="{{arealist}}" bindtap="choose" data-type="0" data-id="{{item.id}}" data-name="{{item.name}}"> <view class="item" wx:for="{{arealist1}}" bindtap="choose1" data-type="0" data-id="{{item.id}}" data-name="{{item.name}}">
{{item.name}} {{item.name}}
</view> </view>
</view> </view>
</van-tab> </van-tab>
<van-tab title="{{area[1]}}"> <van-tab title="{{area[1]}}" disabled="{{tagDis[1]}}" bingtap="choose2">
<view class="choose"> <view class="choose">
<view class="item" wx:for="{{arealist1}}" data-type="1" data-id="{{item.id}}" data-name="{{item.name}}"> <view class="item" wx:for="{{arealist2}}" bindtap="choose2" data-type="1" data-id="{{item.id}}" data-name="{{item.name}}">
{{item.name}} {{item.name}}
</view> </view>
</view> </view>
</van-tab> </van-tab>
<van-tab title="{{area[2]}}"> <van-tab title="{{area[2]}}" disabled="{{tagDis[2]}}">
<view class="choose"> <view class="choose">
<view class="item" wx:for="{{arealist2}}" data-type="2" data-id="{{item.id}}" data-name="{{item.name}}"> <view class="item" wx:for="{{arealist3}}" bindtap="choose3" data-type="2" data-id="{{item.id}}" data-name="{{item.name}}">
{{item.name}} {{item.name}}
</view> </view>
</view> </view>
</van-tab> </van-tab>
</van-tabs> </van-tabs>
</van-popup> </van-popup>
<shuru left="街道地址" right="街道地址" bindmyevent="onMyEvent" data-no="4"></shuru> <shuru left="街道地址" right="街道地址" bindmyevent="onMyEvent" data-no="4"></shuru>
<shuru left="邮政编码" right="邮政编码" bindmyevent="onMyEvent" data-no="5"></shuru> <shuru left="邮政编码" right="邮政编码" bindmyevent="onMyEvent" data-no="5"></shuru>
<shuru left="身份证号" right="可为空,部分商品需要" bindmyevent="onMyEvent" data-no="6"></shuru> <shuru left="身份证号" right="可为空,部分商品需要" bindmyevent="onMyEvent" data-no="6"></shuru>
<addradd text="保存地址" class="btn1" bindtap="save"></addradd> <addradd text="保存地址" class="btn1" bindtap="save"></addradd>
</view> </view>

View File

@ -1,159 +1,164 @@
// pages/chooseaddr/chooseaddr.js // pages/chooseaddr/chooseaddr.js
import { request } from "../../utils/bin" import { request } from "../../utils/bin"
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
addresslist:[], addresslist:[],
userid:"" userid:""
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function(options) { onLoad: function(options) {
request({ request({
url: "User/validateOpenid", url: "User/validateOpenid",
}).then((res)=>{ }).then((res)=>{
this.setData({ this.setData({
userid:res.data.data.user_id userid:res.data.data.user_id
}) })
request({ request({
url: "User/getAddressList", url: "User/getAddressList",
urldata:{ urldata:{
user_id:this.data.userid user_id:this.data.userid
}, },
}).then((res)=>{ }).then((res)=>{
console.log(res) console.log(res)
this.setData({ this.setData({
addresslist:res.data.result addresslist:res.data.result
}) })
}) })
}) })
}, },
add() { add() {
wx.navigateTo({ wx.navigateTo({
url: "/pages/addaddress/addaddress" url: "/pages/addaddress/addaddress"
}) })
}, },
// user_id/8/id/215 // user_id/8/id/215
delete(e){ delete(e){
let t=this let t=this
wx.showModal({ wx.showModal({
title: '确认', title: '确认',
content: '要删除这个地址吗?', content: '要删除这个地址吗?',
success(){ success(res){
if (res.confirm) {
console.log(e.currentTarget.dataset.id) console.log('用户点击确定')
request({
request({ url: "User/validateOpenid",
url: "User/validateOpenid", }).then((res)=>{
}).then((res)=>{ t.setData({
t.setData({ userid:res.data.data.user_id
userid:res.data.data.user_id })
}) request({
request({ url: "User/del_address",
url: "User/del_address", urldata:{
urldata:{ user_id:res.data.data.user_id,
user_id:res.data.data.user_id, id:e.currentTarget.dataset.id
id:e.currentTarget.dataset.id },
}, }).then((res)=>{
}).then((res)=>{ console.log(res)
console.log(res) request({
request({ url: "User/getAddressList",
url: "User/getAddressList", urldata:{
urldata:{ user_id:t.data.userid
user_id:t.data.userid },
}, }).then((res)=>{
}).then((res)=>{ console.log(res)
console.log(res) t.setData({
t.setData({ addresslist:res.data.result
addresslist:res.data.result })
}) })
}) })
}) })
}) } else if (res.cancel) {
console.log('用户点击取消')
console.log("不能动啊")
}
}
})
},
setdefault(e){
console.log(e.currentTarget.dataset.id)
request({ }
url: "User/setDefaultAddress", })
urldata:{ },
user_id:this.data.userid, setdefault(e){
address_id:e.currentTarget.dataset.id console.log(e.currentTarget.dataset.id)
}, request({
}).then((res)=>{ url: "User/setDefaultAddress",
console.log(res) urldata:{
request({ user_id:this.data.userid,
url: "User/getAddressList", address_id:e.currentTarget.dataset.id
urldata:{ },
user_id:this.data.userid }).then((res)=>{
}, console.log(res)
}).then((res)=>{ request({
console.log(res) url: "User/getAddressList",
this.setData({ urldata:{
addresslist:res.data.result user_id:this.data.userid
}) },
}) }).then((res)=>{
}) console.log(res)
}, this.setData({
/** addresslist:res.data.result
* 生命周期函数--监听页面初次渲染完成 })
*/ })
onReady: function() { })
},
}, /**
* 生命周期函数--监听页面初次渲染完成
/** */
* 生命周期函数--监听页面显示 onReady: function() {
*/
onShow: function() { },
}, /**
* 生命周期函数--监听页面显示
/** */
* 生命周期函数--监听页面隐藏 onShow: function() {
*/
onHide: function() { },
}, /**
* 生命周期函数--监听页面隐藏
/** */
* 生命周期函数--监听页面卸载 onHide: function() {
*/
onUnload: function() { },
}, /**
* 生命周期函数--监听页面卸载
/** */
* 页面相关事件处理函数--监听用户下拉动作 onUnload: function() {
*/
onPullDownRefresh: function() { },
}, /**
* 页面相关事件处理函数--监听用户下拉动作
/** */
* 页面上拉触底事件的处理函数 onPullDownRefresh: function() {
*/
onReachBottom: function() { },
}, /**
* 页面上拉触底事件的处理函数
/** */
* 用户点击右上角分享 onReachBottom: function() {
*/
onShareAppMessage: function() { },
} /**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
}) })

View File

@ -1,4 +1,7 @@
.chooseaddress { .chooseaddress {
.box{
height: 910rpx
}
.addr { .addr {
margin-left: 30rpx; margin-left: 30rpx;
} }

View File

@ -1,14 +1,17 @@
<view class="chooseaddress"> <view class="chooseaddress">
<view class="addr" wx:for="{{addresslist}}"> <scroll-view class="box" scroll-y="{{true}}">
<address binddelete="delete" binddefault="setdefault"data-id="{{item.address_id}}" username="{{item.consignee}}" address="{{item.address}}" tel="{{item.mobile}}" youzheng="{{item.zipcode}}" isdefault="{{item.is_default}}"></address> <view class="addr" wx:for="{{addresslist}}">
</view> <address binddelete="delete" binddefault="setdefault"data-id="{{item.address_id}}" username="{{item.consignee}}" address="{{item.address}}" tel="{{item.mobile}}" youzheng="{{item.zipcode}}" isdefault="{{item.is_default}}"></address>
<!-- <view class="addr"> </view>
<address></address> </scroll-view>
</view>
<view class="addr"> <!-- <view class="addr">
<address></address> <address></address>
</view> --> </view>
<view class="btn1" bindtap="add"> <view class="addr">
<addradd text="添加地址"></addradd> <address></address>
</view> </view> -->
<view class="btn1" bindtap="add">
<addradd text="添加地址"></addradd>
</view>
</view> </view>

View File

@ -1,9 +1 @@
.chooseaddress .addr { .chooseaddress .box{height:910rpx}.chooseaddress .addr{margin-left:30rpx}.chooseaddress .btn1{position:fixed;bottom:149rpx;left:50rpx}
margin-left: 30rpx;
}
.chooseaddress .btn1 {
position: fixed;
bottom: 149rpx;
left: 50rpx;
}

View File

@ -1 +1 @@
.box{width:750rpx;display:flex;border-top:1rpx solid #eaeaea} .box{width:750rpx;display:flex;border-top:1rpx solid #eaeaea}

View File

@ -1,22 +1,22 @@
import {request} from "../../utils/bin" import {request} from "../../utils/bin"
Page({ Page({
data:{ data:{
list:[] list:[]
}, },
onLoad(){ onLoad(){
request({ request({
url:"Goods/hotGoodsList", url:"Goods/hotGoodsList",
data:{ data:{
page:0 page:0
} }
}).then((res)=>{ }).then((res)=>{
console.log(res.data.result) console.log(res.data.result)
this.setData({ this.setData({
list:res.data.result list:res.data.result
}) })
}) })
}, },
searchs(){ searchs(){
console.log(10) console.log(10)
} }
}) })

View File

@ -1,4 +1,4 @@
<view class="box"> <view class="box">
<search bind:tap="searchs"></search> <search bind:tap="searchs"></search>
<list list="{{list}}"></list> <list list="{{list}}"></list>
</view> </view>

View File

@ -1 +1 @@
.box{border-top:#eaeaea solid 1rpx;width:750rpx;display:flex;align-items:center;flex-direction:column} .box{border-top:#eaeaea solid 1rpx;width:750rpx;display:flex;align-items:center;flex-direction:column}

View File

@ -1,123 +1,123 @@
// pages/login/login.js // pages/login/login.js
import {request} from "../../utils/bin" import {request} from "../../utils/bin"
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
}, },
getinfo(a){ getinfo(a){
request({ request({
url:"User/validateOpenid" url:"User/validateOpenid"
}).then((res)=>{ }).then((res)=>{
if(res.data.code == 400){ if(res.data.code == 400){
request({ request({
url:"User/register", url:"User/register",
data:{ data:{
country:"", country:"",
gender:0, gender:0,
nick_name:a.detail.userInfo.nickName, nick_name:a.detail.userInfo.nickName,
province:"", province:"",
city:"", city:"",
head_pic:a.detail.userInfo.avatarUrl, head_pic:a.detail.userInfo.avatarUrl,
open_id: wx.getStorageSync("openid"), open_id: wx.getStorageSync("openid"),
} }
}).then((res)=>{ }).then((res)=>{
if(res.data.code == 200){ if(res.data.code == 200){
wx.switchTab({ wx.switchTab({
url:"/pages/index/index" url:"/pages/index/index"
}) })
} }
}) })
}else{ }else{
wx.switchTab({ wx.switchTab({
url:"/pages/index/index" url:"/pages/index/index"
}) })
} }
}) })
}, },
login(a){ login(a){
console.log(a) console.log(a)
let i = this let i = this
wx.login({ wx.login({
success (res) { success (res) {
if (res.code) { if (res.code) {
//发起网络请求 //发起网络请求
request({ request({
url:"User/getopenId", url:"User/getopenId",
data:{ data:{
js_code:res.code js_code:res.code
} }
}).then((res)=>{ }).then((res)=>{
console.log(res) console.log(res)
wx.setStorageSync("openid",res.data.openid) wx.setStorageSync("openid",res.data.openid)
i.getinfo(a) i.getinfo(a)
wx.switchTab({ wx.switchTab({
url:"/pages/index/index" url:"/pages/index/index"
}) })
}) })
} else { } else {
console.log('登录失败!' + res.errMsg) console.log('登录失败!' + res.errMsg)
} }
} }
}) })
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function () {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
} }
}) })

View File

@ -1,3 +1,3 @@
{ {
"usingComponents": {} "usingComponents": {}
} }

View File

@ -1,3 +1,3 @@
<view> <view>
<button open-type="getUserInfo" bindgetuserinfo="login">登录</button> <button open-type="getUserInfo" bindgetuserinfo="login">登录</button>
</view> </view>

View File

@ -1,66 +1,66 @@
// pages/message/message.js // pages/message/message.js
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function () {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
} }
}) })

View File

@ -1,3 +1,3 @@
{ {
"usingComponents": {} "usingComponents": {}
} }

View File

@ -1,29 +1,29 @@
<view class="box"> <view class="box">
<view class="list"> <view class="list">
<view class="information"> <view class="information">
<text>姓名</text> <text>姓名</text>
<input type="text" /> <input type="text" />
</view> </view>
<view class="information"> <view class="information">
<text>联系电话</text> <text>联系电话</text>
<input type="text" /> <input type="text" />
</view> </view>
<view class="information"> <view class="information">
<text>邮箱</text> <text>邮箱</text>
<input type="text" /> <input type="text" />
</view> </view>
<view class="information"> <view class="information">
<text>护照奥马</text> <text>护照奥马</text>
<input type="text" /> <input type="text" />
</view> </view>
</view> </view>
<view class="upload"> <view class="upload">
<text class="title">护照正反面照片</text> <text class="title">护照正反面照片</text>
<view class="files"> <view class="files">
<image></image> <image></image>
</view> </view>
</view> </view>
<view class="submit"> <view class="submit">
保存 保存
</view> </view>
</view> </view>

View File

@ -1 +1 @@
.box{display:flex;flex-direction:column;align-items:center}.box .list{width:650rpx}.box .list .information{margin-top:43rpx;display:flex;flex-direction:column;font-size:28rpx;color:#333;border-bottom:1rpx solid #eaeaea;justify-content:space-between}.box .list .information>input{height:28rpx;font-size:28rpx;color:#333}.box .upload{width:650rpx;margin-top:42rpx}.box .upload .title{font-size:26rpx;color:#999}.box .upload .files{margin-top:42rpx;width:195rpx;height:195rpx;box-shadow:2rpx 3rpx 16rpx 1rpx rgba(51,51,51,0.1)}.box .upload .files>image{width:50rpx;height:41rpx;background-color:#000;margin:77rpx 73rpx}.box .submit{margin-top:295rpx;width:650rpx;height:98rpx;background-color:#47C877;border-radius:49rpx;font-size:36rpx;line-height:98rpx;text-align:center;color:#fff} .box{display:flex;flex-direction:column;align-items:center}.box .list{width:650rpx}.box .list .information{margin-top:43rpx;display:flex;flex-direction:column;font-size:28rpx;color:#333;border-bottom:1rpx solid #eaeaea;justify-content:space-between}.box .list .information>input{height:28rpx;font-size:28rpx;color:#333}.box .upload{width:650rpx;margin-top:42rpx}.box .upload .title{font-size:26rpx;color:#999}.box .upload .files{margin-top:42rpx;width:195rpx;height:195rpx;box-shadow:2rpx 3rpx 16rpx 1rpx rgba(51,51,51,0.1)}.box .upload .files>image{width:50rpx;height:41rpx;background-color:#000;margin:77rpx 73rpx}.box .submit{margin-top:295rpx;width:650rpx;height:98rpx;background-color:#47C877;border-radius:49rpx;font-size:36rpx;line-height:98rpx;text-align:center;color:#fff}

View File

@ -1,66 +1,66 @@
// pages/order/order.js // pages/order/order.js
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function () {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
} }
}) })

View File

@ -1,3 +1,3 @@
<view class="box"> <view class="box">
<tab style="width:100%"></tab> <tab style="width:100%"></tab>
</view> </view>

View File

@ -1 +1 @@
.box{display:flex;flex-direction:column;align-items:center;width:100%}page{background-color:#efefef} .box{display:flex;flex-direction:column;align-items:center;width:100%}page{background-color:#efefef}

View File

@ -1,8 +1,8 @@
{ {
"usingComponents": { "usingComponents": {
"content":"../components/particulars/content/index", "content":"../components/particulars/content/index",
"orderchooseaddr":"../components/particulars/orderchooseaddr/index", "orderchooseaddr":"../components/particulars/orderchooseaddr/index",
"submit":"../components/particulars/submit/index" "submit":"../components/particulars/submit/index"
} }
} }

View File

@ -1 +1 @@
page{background-color:#fbfbfb} page{background-color:#fbfbfb}

View File

@ -1 +1 @@
.box{display:flex;flex-direction:column;align-items:center}.box .card{width:690rpx;height:313rpx;background-color:#47C877;display:flex;box-sizing:border-box;padding:50rpx;font-size:30rpx;flex-direction:column;color:#fff;margin-top:20rpx}.box .card .user{display:flex;align-items:center}.box .card .user .head{width:80rpx;height:80rpx;margin-right:32rpx;border-radius:50%;background-color:#fff}.box .card .balance{display:flex;flex-direction:column;margin-top:52rpx}.box .list{display:flex;width:690rpx;margin-top:33rpx;flex-direction:column}.box .list .option{width:100%;height:80rpx;margin-bottom:15rpx;box-sizing:border-box;padding:0 30rpx;box-shadow:2rpx 3rpx 16rpx 1rpx rgba(51,51,51,0.1);display:flex;align-items:center;justify-content:space-between} .box{display:flex;flex-direction:column;align-items:center}.box .card{width:690rpx;height:313rpx;background-color:#47C877;display:flex;box-sizing:border-box;padding:50rpx;font-size:30rpx;flex-direction:column;color:#fff;margin-top:20rpx}.box .card .user{display:flex;align-items:center}.box .card .user .head{width:80rpx;height:80rpx;margin-right:32rpx;border-radius:50%;background-color:#fff}.box .card .balance{display:flex;flex-direction:column;margin-top:52rpx}.box .list{display:flex;width:690rpx;margin-top:33rpx;flex-direction:column}.box .list .option{width:100%;height:80rpx;margin-bottom:15rpx;box-sizing:border-box;padding:0 30rpx;box-shadow:2rpx 3rpx 16rpx 1rpx rgba(51,51,51,0.1);display:flex;align-items:center;justify-content:space-between}

View File

@ -1,6 +1,6 @@
{ {
"usingComponents": { "usingComponents": {
"content":"../components/particulars/content/index", "content":"../components/particulars/content/index",
"orderchooseaddr":"../components/particulars/orderchooseaddr/index" "orderchooseaddr":"../components/particulars/orderchooseaddr/index"
} }
} }

View File

@ -1 +1 @@
page{background-color:#fbfbfb} page{background-color:#fbfbfb}

View File

@ -1,66 +1,66 @@
// pages/sales1/sales1.js // pages/sales1/sales1.js
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function () {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
} }
}) })

View File

@ -1,5 +1,5 @@
{ {
"usingComponents": { "usingComponents": {
"merchandise":"../components/seles/merchandises/index" "merchandise":"../components/seles/merchandises/index"
} }
} }

View File

@ -1,16 +1,16 @@
<view class="box"> <view class="box">
<merchandise></merchandise> <merchandise></merchandise>
<view class="fill"> <view class="fill">
<view class="cause"> <view class="cause">
<view class="title">退货原因</view> <view class="title">退货原因</view>
<view class="select">请选择 ></view> <view class="select">请选择 ></view>
</view> </view>
<view class="upload"> <view class="upload">
<view class="title">添加照片(选填)</view> <view class="title">添加照片(选填)</view>
<view class="img"> <view class="img">
</view> </view>
</view> </view>
</view> </view>
<view class="submit">提交</view> <view class="submit">提交</view>
</view> </view>

View File

@ -1 +1 @@
.box{border-top:1rpx solid #eee}.box .fill{padding:42rpx 30rpx;box-sizing:border-box}.box .fill .cause{display:flex;justify-content:space-between;align-items:center;margin-bottom:45rpx}.box .fill .cause .title{font-size:26rpx;color:#333}.box .fill .cause .select{font-size:26rpx;color:#999}.box .fill .upload .title{font-size:26rpx;color:#333;margin-bottom:45rpx}.box .fill .upload .img{width:187rpx;height:187rpx;border:1rpx solid #e5e5e5;border-radius:6rpx}.box .submit{width:650rpx;height:98rpx;border-radius:49rpx;background-color:#47C877;line-height:98rpx;text-align:center;color:#fff;font-size:36rpx;margin-top:67rpx;margin-left:50rpx} .box{border-top:1rpx solid #eee}.box .fill{padding:42rpx 30rpx;box-sizing:border-box}.box .fill .cause{display:flex;justify-content:space-between;align-items:center;margin-bottom:45rpx}.box .fill .cause .title{font-size:26rpx;color:#333}.box .fill .cause .select{font-size:26rpx;color:#999}.box .fill .upload .title{font-size:26rpx;color:#333;margin-bottom:45rpx}.box .fill .upload .img{width:187rpx;height:187rpx;border:1rpx solid #e5e5e5;border-radius:6rpx}.box .submit{width:650rpx;height:98rpx;border-radius:49rpx;background-color:#47C877;line-height:98rpx;text-align:center;color:#fff;font-size:36rpx;margin-top:67rpx;margin-left:50rpx}

View File

@ -1,66 +1,66 @@
// pages/sales2/sales2.js // pages/sales2/sales2.js
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function () {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
} }
}) })

View File

@ -1,3 +1,3 @@
{ {
"usingComponents": { "merchandise":"../components/seles/merchandises/index"} "usingComponents": { "merchandise":"../components/seles/merchandises/index"}
} }

View File

@ -1,15 +1,15 @@
<view class="box"> <view class="box">
<view class="info"> <view class="info">
<view class="title">等待商家处理</view> <view class="title">等待商家处理</view>
<view class="msg">请耐心等待</view> <view class="msg">请耐心等待</view>
</view> </view>
<merchandise></merchandise> <merchandise></merchandise>
<view class="info"> <view class="info">
<view class="title">退货原因: 拍多/多拍/不想要</view> <view class="title">退货原因: 拍多/多拍/不想要</view>
<view class="title">申请时间2019-07-21 11:23:21</view> <view class="title">申请时间2019-07-21 11:23:21</view>
</view> </view>
<view class="submit"> <view class="submit">
<view class="button">修改申请</view> <view class="button">修改申请</view>
<view class="button">取消申请</view> <view class="button">取消申请</view>
</view> </view>
</view> </view>

View File

@ -1 +1 @@
.box{border-top:1rpx solid #efefef}.box .info{border-bottom:1rpx solid #efefef;padding:29rpx;box-sizing:border-box}.box .info .title{font-size:26rpx;color:#333;margin-bottom:22rpx}.box .info .msg{font-size:24rpx;color:#999}.box .submit{display:flex;margin-top:36rpx;padding:0 30rpx;justify-content:flex-end}.box .submit .button{width:133rpx;height:51rpx;border:1rpx solid #47C877;border-radius:25rpx;color:#47C877;font-size:22rpx;line-height:51rpx;text-align:center;margin-left:8rpx} .box{border-top:1rpx solid #efefef}.box .info{border-bottom:1rpx solid #efefef;padding:29rpx;box-sizing:border-box}.box .info .title{font-size:26rpx;color:#333;margin-bottom:22rpx}.box .info .msg{font-size:24rpx;color:#999}.box .submit{display:flex;margin-top:36rpx;padding:0 30rpx;justify-content:flex-end}.box .submit .button{width:133rpx;height:51rpx;border:1rpx solid #47C877;border-radius:25rpx;color:#47C877;font-size:22rpx;line-height:51rpx;text-align:center;margin-left:8rpx}

View File

@ -1,66 +1,66 @@
// pages/search/search.js // pages/search/search.js
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function () {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
} }
}) })

View File

@ -1,6 +1,6 @@
{ {
"usingComponents": { "usingComponents": {
"search":"../components/index/search/index", "search":"../components/index/search/index",
"hot":"../components/search/hot/index" "hot":"../components/search/hot/index"
} }
} }

View File

@ -1,4 +1,4 @@
<view class="box"> <view class="box">
<search></search> <search></search>
<hot></hot> <hot></hot>
</view> </view>

View File

@ -1 +1 @@
.box{border-top:#eaeaea solid 1rpx;width:750rpx;display:flex;align-items:center;flex-direction:column} .box{border-top:#eaeaea solid 1rpx;width:750rpx;display:flex;align-items:center;flex-direction:column}

View File

@ -1,66 +1,66 @@
// pages/status/status.js // pages/status/status.js
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function () {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
} }
}) })

View File

@ -1,6 +1,6 @@
{ {
"usingComponents": { "usingComponents": {
"logistics": "../components/particulars/logistics/index", "logistics": "../components/particulars/logistics/index",
"message":"../components/order/message/index" "message":"../components/order/message/index"
} }
} }

View File

@ -1,7 +1,7 @@
<view class="box"> <view class="box">
<view class="reference"> <view class="reference">
订单编号1234567812345789 订单编号1234567812345789
<message></message> <message></message>
</view> </view>
<logistics></logistics> <logistics></logistics>
</view> </view>

View File

@ -1 +1 @@
.box .reference{font-size:24rpx;color:#999;padding:32rpx 20rpx;background-color:#fff}page{background-color:#fbfbfb} .box .reference{font-size:24rpx;color:#999;padding:32rpx 20rpx;background-color:#fff}page{background-color:#fbfbfb}

View File

@ -1,5 +1,8 @@
// pages/undetermined/undetermined.js // pages/undetermined/undetermined.js
<<<<<<< HEAD
import bin from "../../utils/bin" import bin from "../../utils/bin"
=======
>>>>>>> 260785c6fe0a4997462040f4f8890f1da9a0deb6
Page({ Page({
/** /**

View File

@ -1,6 +1,6 @@
{ {
"usingComponents": { "usingComponents": {
"content":"../components/particulars/content/index", "content":"../components/particulars/content/index",
"orderchooseaddr":"../components/particulars/orderchooseaddr/index" "orderchooseaddr":"../components/particulars/orderchooseaddr/index"
} }
} }

View File

@ -1 +1 @@
page{background-color:#FBFBFB} page{background-color:#FBFBFB}

View File

@ -1,7 +1,7 @@
{ {
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{ "rules": [{
"action": "allow", "action": "allow",
"page": "*" "page": "*"
}] }]
} }

View File

@ -1 +1 @@
export {}; export {};

View File

@ -1,59 +1,59 @@
import { VantComponent } from '../common/component'; import { VantComponent } from '../common/component';
VantComponent({ VantComponent({
props: { props: {
show: Boolean, show: Boolean,
title: String, title: String,
cancelText: String, cancelText: String,
description: String, description: String,
round: { round: {
type: Boolean, type: Boolean,
value: true value: true
}, },
zIndex: { zIndex: {
type: Number, type: Number,
value: 100 value: 100
}, },
actions: { actions: {
type: Array, type: Array,
value: [] value: []
}, },
overlay: { overlay: {
type: Boolean, type: Boolean,
value: true value: true
}, },
closeOnClickOverlay: { closeOnClickOverlay: {
type: Boolean, type: Boolean,
value: true value: true
}, },
closeOnClickAction: { closeOnClickAction: {
type: Boolean, type: Boolean,
value: true value: true
}, },
safeAreaInsetBottom: { safeAreaInsetBottom: {
type: Boolean, type: Boolean,
value: true value: true
} }
}, },
methods: { methods: {
onSelect(event) { onSelect(event) {
const { index } = event.currentTarget.dataset; const { index } = event.currentTarget.dataset;
const item = this.data.actions[index]; const item = this.data.actions[index];
if (item && !item.disabled && !item.loading) { if (item && !item.disabled && !item.loading) {
this.$emit('select', item); this.$emit('select', item);
if (this.data.closeOnClickAction) { if (this.data.closeOnClickAction) {
this.onClose(); this.onClose();
} }
} }
}, },
onCancel() { onCancel() {
this.$emit('cancel'); this.$emit('cancel');
}, },
onClose() { onClose() {
this.$emit('close'); this.$emit('close');
}, },
onClickOverlay() { onClickOverlay() {
this.$emit('click-overlay'); this.$emit('click-overlay');
this.onClose(); this.onClose();
} }
} }
}); });

View File

@ -1,8 +1,8 @@
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"van-icon": "../icon/index", "van-icon": "../icon/index",
"van-popup": "../popup/index", "van-popup": "../popup/index",
"van-loading": "../loading/index" "van-loading": "../loading/index"
} }
} }

View File

@ -1,54 +1,54 @@
<wxs src="../wxs/utils.wxs" module="utils" /> <wxs src="../wxs/utils.wxs" module="utils" />
<van-popup <van-popup
show="{{ show }}" show="{{ show }}"
position="bottom" position="bottom"
round="{{ round }}" round="{{ round }}"
z-index="{{ zIndex }}" z-index="{{ zIndex }}"
overlay="{{ overlay }}" overlay="{{ overlay }}"
custom-class="van-action-sheet" custom-class="van-action-sheet"
safe-area-inset-bottom="{{ safeAreaInsetBottom }}" safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
close-on-click-overlay="{{ closeOnClickOverlay }}" close-on-click-overlay="{{ closeOnClickOverlay }}"
bind:close="onClickOverlay" bind:close="onClickOverlay"
> >
<view wx:if="{{ title }}" class="van-hairline--bottom van-action-sheet__header"> <view wx:if="{{ title }}" class="van-hairline--bottom van-action-sheet__header">
{{ title }} {{ title }}
<van-icon <van-icon
name="close" name="close"
custom-class="van-action-sheet__close" custom-class="van-action-sheet__close"
bind:click="onClose" bind:click="onClose"
/> />
</view> </view>
<view wx:if="{{ description }}" class="van-action-sheet__description"> <view wx:if="{{ description }}" class="van-action-sheet__description">
{{ description }} {{ description }}
</view> </view>
<view wx:if="{{ actions && actions.length }}"> <view wx:if="{{ actions && actions.length }}">
<!-- button外包一层view防止actions动态变化导致渲染时button被打散 --> <!-- button外包一层view防止actions动态变化导致渲染时button被打散 -->
<button <button
wx:for="{{ actions }}" wx:for="{{ actions }}"
wx:key="index" wx:key="index"
open-type="{{ item.openType }}" open-type="{{ item.openType }}"
style="{{ item.color ? 'color: ' + item.color : '' }}" style="{{ item.color ? 'color: ' + item.color : '' }}"
class="{{ utils.bem('action-sheet__item', { disabled: item.disabled || item.loading }) }} van-hairline--top {{ item.className || '' }}" class="{{ utils.bem('action-sheet__item', { disabled: item.disabled || item.loading }) }} van-hairline--top {{ item.className || '' }}"
hover-class="van-action-sheet__item--hover" hover-class="van-action-sheet__item--hover"
data-index="{{ index }}" data-index="{{ index }}"
bind:tap="onSelect" bind:tap="onSelect"
> >
<block wx:if="{{ !item.loading }}"> <block wx:if="{{ !item.loading }}">
{{ item.name }} {{ item.name }}
<text wx:if="{{ item.subname }}" class="van-action-sheet__subname" >{{ item.subname }}</text> <text wx:if="{{ item.subname }}" class="van-action-sheet__subname" >{{ item.subname }}</text>
</block> </block>
<van-loading wx:else custom-class="van-action-sheet__loading" size="20px" /> <van-loading wx:else custom-class="van-action-sheet__loading" size="20px" />
</button> </button>
</view> </view>
<slot /> <slot />
<view <view
wx:if="{{ cancelText }}" wx:if="{{ cancelText }}"
class="van-action-sheet__cancel" class="van-action-sheet__cancel"
hover-class="van-action-sheet__cancel--hover" hover-class="van-action-sheet__cancel--hover"
hover-stay-time="70" hover-stay-time="70"
bind:tap="onCancel" bind:tap="onCancel"
> >
{{ cancelText }} {{ cancelText }}
</view> </view>
</van-popup> </van-popup>

View File

@ -1 +1 @@
export {}; export {};

View File

@ -1,210 +1,210 @@
import { VantComponent } from '../common/component'; import { VantComponent } from '../common/component';
import { pickerProps } from '../picker/shared'; import { pickerProps } from '../picker/shared';
const COLUMNSPLACEHOLDERCODE = '000000'; const COLUMNSPLACEHOLDERCODE = '000000';
VantComponent({ VantComponent({
classes: ['active-class', 'toolbar-class', 'column-class'], classes: ['active-class', 'toolbar-class', 'column-class'],
props: Object.assign(Object.assign({}, pickerProps), { value: String, areaList: { props: Object.assign(Object.assign({}, pickerProps), { value: String, areaList: {
type: Object, type: Object,
value: {} value: {}
}, columnsNum: { }, columnsNum: {
type: null, type: null,
value: 3 value: 3
}, columnsPlaceholder: { }, columnsPlaceholder: {
type: Array, type: Array,
observer(val) { observer(val) {
this.setData({ this.setData({
typeToColumnsPlaceholder: { typeToColumnsPlaceholder: {
province: val[0] || '', province: val[0] || '',
city: val[1] || '', city: val[1] || '',
county: val[2] || '', county: val[2] || '',
} }
}); });
} }
} }), } }),
data: { data: {
columns: [{ values: [] }, { values: [] }, { values: [] }], columns: [{ values: [] }, { values: [] }, { values: [] }],
displayColumns: [{ values: [] }, { values: [] }, { values: [] }], displayColumns: [{ values: [] }, { values: [] }, { values: [] }],
typeToColumnsPlaceholder: {} typeToColumnsPlaceholder: {}
}, },
watch: { watch: {
value(value) { value(value) {
this.code = value; this.code = value;
this.setValues(); this.setValues();
}, },
areaList: 'setValues', areaList: 'setValues',
columnsNum(value) { columnsNum(value) {
this.setData({ this.setData({
displayColumns: this.data.columns.slice(0, +value) displayColumns: this.data.columns.slice(0, +value)
}); });
} }
}, },
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {
this.setValues(); this.setValues();
}, 0); }, 0);
}, },
methods: { methods: {
getPicker() { getPicker() {
if (this.picker == null) { if (this.picker == null) {
this.picker = this.selectComponent('.van-area__picker'); this.picker = this.selectComponent('.van-area__picker');
} }
return this.picker; return this.picker;
}, },
onCancel(event) { onCancel(event) {
this.emit('cancel', event.detail); this.emit('cancel', event.detail);
}, },
onConfirm(event) { onConfirm(event) {
const { index } = event.detail; const { index } = event.detail;
let { value } = event.detail; let { value } = event.detail;
value = this.parseOutputValues(value); value = this.parseOutputValues(value);
this.emit('confirm', { value, index }); this.emit('confirm', { value, index });
}, },
emit(type, detail) { emit(type, detail) {
detail.values = detail.value; detail.values = detail.value;
delete detail.value; delete detail.value;
this.$emit(type, detail); this.$emit(type, detail);
}, },
// parse output columns data // parse output columns data
parseOutputValues(values) { parseOutputValues(values) {
const { columnsPlaceholder } = this.data; const { columnsPlaceholder } = this.data;
return values.map((value, index) => { return values.map((value, index) => {
// save undefined value // save undefined value
if (!value) if (!value)
return value; return value;
value = JSON.parse(JSON.stringify(value)); value = JSON.parse(JSON.stringify(value));
if (!value.code || value.name === columnsPlaceholder[index]) { if (!value.code || value.name === columnsPlaceholder[index]) {
value.code = ''; value.code = '';
value.name = ''; value.name = '';
} }
return value; return value;
}); });
}, },
onChange(event) { onChange(event) {
const { index, picker, value } = event.detail; const { index, picker, value } = event.detail;
this.code = value[index].code; this.code = value[index].code;
this.setValues().then(() => { this.setValues().then(() => {
this.$emit('change', { this.$emit('change', {
picker, picker,
values: this.parseOutputValues(picker.getValues()), values: this.parseOutputValues(picker.getValues()),
index index
}); });
}); });
}, },
getConfig(type) { getConfig(type) {
const { areaList } = this.data; const { areaList } = this.data;
return (areaList && areaList[`${type}_list`]) || {}; return (areaList && areaList[`${type}_list`]) || {};
}, },
getList(type, code) { getList(type, code) {
const { typeToColumnsPlaceholder } = this.data; const { typeToColumnsPlaceholder } = this.data;
let result = []; let result = [];
if (type !== 'province' && !code) { if (type !== 'province' && !code) {
return result; return result;
} }
const list = this.getConfig(type); const list = this.getConfig(type);
result = Object.keys(list).map(code => ({ result = Object.keys(list).map(code => ({
code, code,
name: list[code] name: list[code]
})); }));
if (code) { if (code) {
// oversea code // oversea code
if (code[0] === '9' && type === 'city') { if (code[0] === '9' && type === 'city') {
code = '9'; code = '9';
} }
result = result.filter(item => item.code.indexOf(code) === 0); result = result.filter(item => item.code.indexOf(code) === 0);
} }
if (typeToColumnsPlaceholder[type] && result.length) { if (typeToColumnsPlaceholder[type] && result.length) {
// set columns placeholder // set columns placeholder
const codeFill = type === 'province' ? '' : type === 'city' ? COLUMNSPLACEHOLDERCODE.slice(2, 4) : COLUMNSPLACEHOLDERCODE.slice(4, 6); const codeFill = type === 'province' ? '' : type === 'city' ? COLUMNSPLACEHOLDERCODE.slice(2, 4) : COLUMNSPLACEHOLDERCODE.slice(4, 6);
result.unshift({ result.unshift({
code: `${code}${codeFill}`, code: `${code}${codeFill}`,
name: typeToColumnsPlaceholder[type] name: typeToColumnsPlaceholder[type]
}); });
} }
return result; return result;
}, },
getIndex(type, code) { getIndex(type, code) {
let compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6; let compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6;
const list = this.getList(type, code.slice(0, compareNum - 2)); const list = this.getList(type, code.slice(0, compareNum - 2));
// oversea code // oversea code
if (code[0] === '9' && type === 'province') { if (code[0] === '9' && type === 'province') {
compareNum = 1; compareNum = 1;
} }
code = code.slice(0, compareNum); code = code.slice(0, compareNum);
for (let i = 0; i < list.length; i++) { for (let i = 0; i < list.length; i++) {
if (list[i].code.slice(0, compareNum) === code) { if (list[i].code.slice(0, compareNum) === code) {
return i; return i;
} }
} }
return 0; return 0;
}, },
setValues() { setValues() {
const county = this.getConfig('county'); const county = this.getConfig('county');
let { code } = this; let { code } = this;
if (!code) { if (!code) {
if (this.data.columnsPlaceholder.length) { if (this.data.columnsPlaceholder.length) {
code = COLUMNSPLACEHOLDERCODE; code = COLUMNSPLACEHOLDERCODE;
} }
else if (Object.keys(county)[0]) { else if (Object.keys(county)[0]) {
code = Object.keys(county)[0]; code = Object.keys(county)[0];
} }
else { else {
code = ''; code = '';
} }
} }
const province = this.getList('province'); const province = this.getList('province');
const city = this.getList('city', code.slice(0, 2)); const city = this.getList('city', code.slice(0, 2));
const picker = this.getPicker(); const picker = this.getPicker();
if (!picker) { if (!picker) {
return; return;
} }
const stack = []; const stack = [];
stack.push(picker.setColumnValues(0, province, false)); stack.push(picker.setColumnValues(0, province, false));
stack.push(picker.setColumnValues(1, city, false)); stack.push(picker.setColumnValues(1, city, false));
if (city.length && code.slice(2, 4) === '00') { if (city.length && code.slice(2, 4) === '00') {
[{ code }] = city; [{ code }] = city;
} }
stack.push(picker.setColumnValues(2, this.getList('county', code.slice(0, 4)), false)); stack.push(picker.setColumnValues(2, this.getList('county', code.slice(0, 4)), false));
return Promise.all(stack) return Promise.all(stack)
.catch(() => { }) .catch(() => { })
.then(() => picker.setIndexes([ .then(() => picker.setIndexes([
this.getIndex('province', code), this.getIndex('province', code),
this.getIndex('city', code), this.getIndex('city', code),
this.getIndex('county', code) this.getIndex('county', code)
])) ]))
.catch(() => { }); .catch(() => { });
}, },
getValues() { getValues() {
const picker = this.getPicker(); const picker = this.getPicker();
return picker ? picker.getValues().filter(value => !!value) : []; return picker ? picker.getValues().filter(value => !!value) : [];
}, },
getDetail() { getDetail() {
const values = this.getValues(); const values = this.getValues();
const area = { const area = {
code: '', code: '',
country: '', country: '',
province: '', province: '',
city: '', city: '',
county: '' county: ''
}; };
if (!values.length) { if (!values.length) {
return area; return area;
} }
const names = values.map((item) => item.name); const names = values.map((item) => item.name);
area.code = values[values.length - 1].code; area.code = values[values.length - 1].code;
if (area.code[0] === '9') { if (area.code[0] === '9') {
area.country = names[1] || ''; area.country = names[1] || '';
area.province = names[2] || ''; area.province = names[2] || '';
} }
else { else {
area.province = names[0] || ''; area.province = names[0] || '';
area.city = names[1] || ''; area.city = names[1] || '';
area.county = names[2] || ''; area.county = names[2] || '';
} }
return area; return area;
}, },
reset(code) { reset(code) {
this.code = code || ''; this.code = code || '';
return this.setValues(); return this.setValues();
} }
} }
}); });

View File

@ -1,6 +1,6 @@
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"van-picker": "../picker/index" "van-picker": "../picker/index"
} }
} }

View File

@ -1,18 +1,18 @@
<van-picker <van-picker
class="van-area__picker" class="van-area__picker"
active-class="active-class" active-class="active-class"
toolbar-class="toolbar-class" toolbar-class="toolbar-class"
column-class="column-class" column-class="column-class"
show-toolbar show-toolbar
value-key="name" value-key="name"
title="{{ title }}" title="{{ title }}"
loading="{{ loading }}" loading="{{ loading }}"
columns="{{ displayColumns }}" columns="{{ displayColumns }}"
item-height="{{ itemHeight }}" item-height="{{ itemHeight }}"
visible-item-count="{{ visibleItemCount }}" visible-item-count="{{ visibleItemCount }}"
cancel-button-text="{{ cancelButtonText }}" cancel-button-text="{{ cancelButtonText }}"
confirm-button-text="{{ confirmButtonText }}" confirm-button-text="{{ confirmButtonText }}"
bind:change="onChange" bind:change="onChange"
bind:confirm="onConfirm" bind:confirm="onConfirm"
bind:cancel="onCancel" bind:cancel="onCancel"
/> />

View File

@ -1 +1 @@
export {}; export {};

View File

@ -1,68 +1,68 @@
import { VantComponent } from '../common/component'; import { VantComponent } from '../common/component';
import { button } from '../mixins/button'; import { button } from '../mixins/button';
import { openType } from '../mixins/open-type'; import { openType } from '../mixins/open-type';
VantComponent({ VantComponent({
mixins: [button, openType], mixins: [button, openType],
classes: ['hover-class', 'loading-class'], classes: ['hover-class', 'loading-class'],
data: { data: {
style: '' style: ''
}, },
props: { props: {
icon: String, icon: String,
plain: Boolean, plain: Boolean,
block: Boolean, block: Boolean,
round: Boolean, round: Boolean,
square: Boolean, square: Boolean,
loading: Boolean, loading: Boolean,
hairline: Boolean, hairline: Boolean,
disabled: Boolean, disabled: Boolean,
loadingText: String, loadingText: String,
customStyle: String, customStyle: String,
loadingType: { loadingType: {
type: String, type: String,
value: 'circular' value: 'circular'
}, },
type: { type: {
type: String, type: String,
value: 'default' value: 'default'
}, },
size: { size: {
type: String, type: String,
value: 'normal' value: 'normal'
}, },
loadingSize: { loadingSize: {
type: String, type: String,
value: '20px' value: '20px'
}, },
color: { color: {
type: String, type: String,
observer(color) { observer(color) {
let style = ''; let style = '';
if (color) { if (color) {
style += `color: ${this.data.plain ? color : 'white'};`; style += `color: ${this.data.plain ? color : 'white'};`;
if (!this.data.plain) { if (!this.data.plain) {
// Use background instead of backgroundColor to make linear-gradient work // Use background instead of backgroundColor to make linear-gradient work
style += `background: ${color};`; style += `background: ${color};`;
} }
// hide border when color is linear-gradient // hide border when color is linear-gradient
if (color.indexOf('gradient') !== -1) { if (color.indexOf('gradient') !== -1) {
style += 'border: 0;'; style += 'border: 0;';
} }
else { else {
style += `border-color: ${color};`; style += `border-color: ${color};`;
} }
} }
if (style !== this.data.style) { if (style !== this.data.style) {
this.setData({ style }); this.setData({ style });
} }
} }
} }
}, },
methods: { methods: {
onClick() { onClick() {
if (!this.data.disabled && !this.data.loading) { if (!this.data.disabled && !this.data.loading) {
this.$emit('click'); this.$emit('click');
} }
} }
} }
}); });

View File

@ -1,7 +1,7 @@
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"van-icon": "../icon/index", "van-icon": "../icon/index",
"van-loading": "../loading/index" "van-loading": "../loading/index"
} }
} }

View File

@ -1,52 +1,52 @@
<wxs src="../wxs/utils.wxs" module="utils" /> <wxs src="../wxs/utils.wxs" module="utils" />
<button <button
id="{{ id }}" id="{{ id }}"
class="custom-class {{ utils.bem('button', [type, size, { block, round, plain, square, loading, disabled, hairline, unclickable: disabled || loading }]) }} {{ hairline ? 'van-hairline--surround' : '' }}" class="custom-class {{ utils.bem('button', [type, size, { block, round, plain, square, loading, disabled, hairline, unclickable: disabled || loading }]) }} {{ hairline ? 'van-hairline--surround' : '' }}"
hover-class="van-button--active hover-class" hover-class="van-button--active hover-class"
lang="{{ lang }}" lang="{{ lang }}"
style="{{ style }} {{ customStyle }}" style="{{ style }} {{ customStyle }}"
open-type="{{ openType }}" open-type="{{ openType }}"
business-id="{{ businessId }}" business-id="{{ businessId }}"
session-from="{{ sessionFrom }}" session-from="{{ sessionFrom }}"
send-message-title="{{ sendMessageTitle }}" send-message-title="{{ sendMessageTitle }}"
send-message-path="{{ sendMessagePath }}" send-message-path="{{ sendMessagePath }}"
send-message-img="{{ sendMessageImg }}" send-message-img="{{ sendMessageImg }}"
show-message-card="{{ showMessageCard }}" show-message-card="{{ showMessageCard }}"
app-parameter="{{ appParameter }}" app-parameter="{{ appParameter }}"
aria-label="{{ ariaLabel }}" aria-label="{{ ariaLabel }}"
bindtap="onClick" bindtap="onClick"
bindgetuserinfo="bindGetUserInfo" bindgetuserinfo="bindGetUserInfo"
bindcontact="bindContact" bindcontact="bindContact"
bindgetphonenumber="bindGetPhoneNumber" bindgetphonenumber="bindGetPhoneNumber"
binderror="bindError" binderror="bindError"
bindlaunchapp="bindLaunchApp" bindlaunchapp="bindLaunchApp"
bindopensetting="bindOpenSetting" bindopensetting="bindOpenSetting"
> >
<block wx:if="{{ loading }}"> <block wx:if="{{ loading }}">
<van-loading <van-loading
custom-class="loading-class" custom-class="loading-class"
size="{{ loadingSize }}" size="{{ loadingSize }}"
type="{{ loadingType }}" type="{{ loadingType }}"
color="{{ type === 'default' ? '#c9c9c9' : 'white' }}" color="{{ type === 'default' ? '#c9c9c9' : 'white' }}"
/> />
<view <view
wx:if="{{ loadingText }}" wx:if="{{ loadingText }}"
class="van-button__loading-text" class="van-button__loading-text"
> >
{{ loadingText }} {{ loadingText }}
</view> </view>
</block> </block>
<block wx:else> <block wx:else>
<van-icon <van-icon
wx:if="{{ icon }}" wx:if="{{ icon }}"
size="1.2em" size="1.2em"
name="{{ icon }}" name="{{ icon }}"
class="van-button__icon" class="van-button__icon"
custom-style="line-height: inherit;" custom-style="line-height: inherit;"
/> />
<view class="van-button__text"> <view class="van-button__text">
<slot /> <slot />
</view> </view>
</block> </block>
</button> </button>

View File

@ -1 +1 @@
export {}; export {};

View File

@ -1,38 +1,38 @@
import { link } from '../mixins/link'; import { link } from '../mixins/link';
import { VantComponent } from '../common/component'; import { VantComponent } from '../common/component';
VantComponent({ VantComponent({
classes: [ classes: [
'num-class', 'num-class',
'desc-class', 'desc-class',
'thumb-class', 'thumb-class',
'title-class', 'title-class',
'price-class', 'price-class',
'origin-price-class', 'origin-price-class',
], ],
mixins: [link], mixins: [link],
props: { props: {
tag: String, tag: String,
num: String, num: String,
desc: String, desc: String,
thumb: String, thumb: String,
title: String, title: String,
price: String, price: String,
centered: Boolean, centered: Boolean,
lazyLoad: Boolean, lazyLoad: Boolean,
thumbLink: String, thumbLink: String,
originPrice: String, originPrice: String,
thumbMode: { thumbMode: {
type: String, type: String,
value: 'aspectFit' value: 'aspectFit'
}, },
currency: { currency: {
type: String, type: String,
value: '¥' value: '¥'
} }
}, },
methods: { methods: {
onClickThumb() { onClickThumb() {
this.jumpLink('thumbLink'); this.jumpLink('thumbLink');
} }
} }
}); });

View File

@ -1,6 +1,6 @@
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"van-tag": "../tag/index" "van-tag": "../tag/index"
} }
} }

View File

@ -1,45 +1,45 @@
<wxs src="../wxs/utils.wxs" module="utils" /> <wxs src="../wxs/utils.wxs" module="utils" />
<view class="custom-class van-card"> <view class="custom-class van-card">
<view class="{{ utils.bem('card__header', { center: centered }) }}"> <view class="{{ utils.bem('card__header', { center: centered }) }}">
<view class="van-card__thumb" bind:tap="onClickThumb"> <view class="van-card__thumb" bind:tap="onClickThumb">
<image <image
wx:if="{{ thumb }}" wx:if="{{ thumb }}"
src="{{ thumb }}" src="{{ thumb }}"
mode="{{ thumbMode }}" mode="{{ thumbMode }}"
lazy-load="{{ lazyLoad }}" lazy-load="{{ lazyLoad }}"
class="van-card__img thumb-class" class="van-card__img thumb-class"
/> />
<slot name="thumb" /> <slot name="thumb" />
<van-tag <van-tag
wx:if="{{ tag }}" wx:if="{{ tag }}"
mark mark
type="danger" type="danger"
custom-class="van-card__tag" custom-class="van-card__tag"
> >
{{ tag }} {{ tag }}
</van-tag> </van-tag>
</view> </view>
<view class="van-card__content"> <view class="van-card__content">
<view wx:if="{{ title }}" class="van-card__title title-class">{{ title }}</view> <view wx:if="{{ title }}" class="van-card__title title-class">{{ title }}</view>
<slot wx:else name="title" /> <slot wx:else name="title" />
<view wx:if="{{ desc }}" class="van-card__desc desc-class">{{ desc }}</view> <view wx:if="{{ desc }}" class="van-card__desc desc-class">{{ desc }}</view>
<slot wx:else name="desc" /> <slot wx:else name="desc" />
<slot name="tags" /> <slot name="tags" />
<view class="van-card__bottom"> <view class="van-card__bottom">
<view wx:if="{{ price || price === 0 }}" class="van-card__price price-class">{{ currency }} {{ price }}</view> <view wx:if="{{ price || price === 0 }}" class="van-card__price price-class">{{ currency }} {{ price }}</view>
<view wx:if="{{ originPrice || originPrice === 0 }}" class="van-card__origin-price origin-price-class">{{ currency }} {{ originPrice }}</view> <view wx:if="{{ originPrice || originPrice === 0 }}" class="van-card__origin-price origin-price-class">{{ currency }} {{ originPrice }}</view>
<view wx:if="{{ num }}" class="van-card__num num-class">x {{ num }}</view> <view wx:if="{{ num }}" class="van-card__num num-class">x {{ num }}</view>
<slot name="bottom" /> <slot name="bottom" />
</view> </view>
</view> </view>
</view> </view>
<view class="van-card__footer"> <view class="van-card__footer">
<slot name="footer" /> <slot name="footer" />
</view> </view>
</view> </view>

View File

@ -1 +1 @@
export {}; export {};

View File

@ -1,10 +1,10 @@
import { VantComponent } from '../common/component'; import { VantComponent } from '../common/component';
VantComponent({ VantComponent({
props: { props: {
title: String, title: String,
border: { border: {
type: Boolean, type: Boolean,
value: true value: true
} }
} }
}); });

View File

@ -1,3 +1,3 @@
{ {
"component": true "component": true
} }

View File

@ -1,9 +1,9 @@
<view <view
wx:if="{{ title }}" wx:if="{{ title }}"
class="van-cell-group__title" class="van-cell-group__title"
> >
{{ title }} {{ title }}
</view> </view>
<view class="custom-class van-cell-group {{ border ? 'van-hairline--top-bottom' : '' }}"> <view class="custom-class van-cell-group {{ border ? 'van-hairline--top-bottom' : '' }}">
<slot /> <slot />
</view> </view>

View File

@ -1 +1 @@
export {}; export {};

View File

@ -1,37 +1,37 @@
import { link } from '../mixins/link'; import { link } from '../mixins/link';
import { VantComponent } from '../common/component'; import { VantComponent } from '../common/component';
VantComponent({ VantComponent({
classes: [ classes: [
'title-class', 'title-class',
'label-class', 'label-class',
'value-class', 'value-class',
'right-icon-class', 'right-icon-class',
'hover-class' 'hover-class'
], ],
mixins: [link], mixins: [link],
props: { props: {
title: null, title: null,
value: null, value: null,
icon: String, icon: String,
size: String, size: String,
label: String, label: String,
center: Boolean, center: Boolean,
isLink: Boolean, isLink: Boolean,
required: Boolean, required: Boolean,
clickable: Boolean, clickable: Boolean,
titleWidth: String, titleWidth: String,
customStyle: String, customStyle: String,
arrowDirection: String, arrowDirection: String,
useLabelSlot: Boolean, useLabelSlot: Boolean,
border: { border: {
type: Boolean, type: Boolean,
value: true value: true
} }
}, },
methods: { methods: {
onClick(event) { onClick(event) {
this.$emit('click', event.detail); this.$emit('click', event.detail);
this.jumpLink(); this.jumpLink();
} }
} }
}); });

View File

@ -1,6 +1,6 @@
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"van-icon": "../icon/index" "van-icon": "../icon/index"
} }
} }

View File

@ -1,45 +1,45 @@
<wxs src="../wxs/utils.wxs" module="utils" /> <wxs src="../wxs/utils.wxs" module="utils" />
<view <view
class="custom-class {{ utils.bem('cell', [size, { center, required, borderless: !border, clickable: isLink || clickable }]) }}" class="custom-class {{ utils.bem('cell', [size, { center, required, borderless: !border, clickable: isLink || clickable }]) }}"
hover-class="van-cell--hover hover-class" hover-class="van-cell--hover hover-class"
hover-stay-time="70" hover-stay-time="70"
style="{{ customStyle }}" style="{{ customStyle }}"
bind:tap="onClick" bind:tap="onClick"
> >
<van-icon <van-icon
wx:if="{{ icon }}" wx:if="{{ icon }}"
name="{{ icon }}" name="{{ icon }}"
class="van-cell__left-icon-wrap" class="van-cell__left-icon-wrap"
custom-class="van-cell__left-icon" custom-class="van-cell__left-icon"
/> />
<slot wx:else name="icon" /> <slot wx:else name="icon" />
<view <view
style="{{ titleWidth ? 'max-width:' + titleWidth + ';min-width:' + titleWidth : '' }}" style="{{ titleWidth ? 'max-width:' + titleWidth + ';min-width:' + titleWidth : '' }}"
class="van-cell__title title-class" class="van-cell__title title-class"
> >
<block wx:if="{{ title }}">{{ title }}</block> <block wx:if="{{ title }}">{{ title }}</block>
<slot wx:else name="title" /> <slot wx:else name="title" />
<view wx:if="{{ label || useLabelSlot }}" class="van-cell__label label-class"> <view wx:if="{{ label || useLabelSlot }}" class="van-cell__label label-class">
<slot wx:if="{{ useLabelSlot }}" name="label" /> <slot wx:if="{{ useLabelSlot }}" name="label" />
<block wx:elif="{{ label }}">{{ label }}</block> <block wx:elif="{{ label }}">{{ label }}</block>
</view> </view>
</view> </view>
<view class="van-cell__value value-class"> <view class="van-cell__value value-class">
<block wx:if="{{ value || value === 0 }}">{{ value }}</block> <block wx:if="{{ value || value === 0 }}">{{ value }}</block>
<slot wx:else /> <slot wx:else />
</view> </view>
<van-icon <van-icon
wx:if="{{ isLink }}" wx:if="{{ isLink }}"
name="{{ arrowDirection ? 'arrow' + '-' + arrowDirection : 'arrow' }}" name="{{ arrowDirection ? 'arrow' + '-' + arrowDirection : 'arrow' }}"
class="van-cell__right-icon-wrap right-icon-class" class="van-cell__right-icon-wrap right-icon-class"
custom-class="van-cell__right-icon" custom-class="van-cell__right-icon"
/> />
<slot wx:else name="right-icon" /> <slot wx:else name="right-icon" />
<slot name="extra" /> <slot name="extra" />
</view> </view>

View File

@ -1 +1 @@
export {}; export {};

View File

@ -1,39 +1,39 @@
import { VantComponent } from '../common/component'; import { VantComponent } from '../common/component';
VantComponent({ VantComponent({
field: true, field: true,
relation: { relation: {
name: 'checkbox', name: 'checkbox',
type: 'descendant', type: 'descendant',
linked(target) { linked(target) {
this.children = this.children || []; this.children = this.children || [];
this.children.push(target); this.children.push(target);
this.updateChild(target); this.updateChild(target);
}, },
unlinked(target) { unlinked(target) {
this.children = this.children.filter((child) => child !== target); this.children = this.children.filter((child) => child !== target);
} }
}, },
props: { props: {
max: Number, max: Number,
value: { value: {
type: Array, type: Array,
observer: 'updateChildren' observer: 'updateChildren'
}, },
disabled: { disabled: {
type: Boolean, type: Boolean,
observer: 'updateChildren' observer: 'updateChildren'
} }
}, },
methods: { methods: {
updateChildren() { updateChildren() {
(this.children || []).forEach((child) => this.updateChild(child)); (this.children || []).forEach((child) => this.updateChild(child));
}, },
updateChild(child) { updateChild(child) {
const { value, disabled } = this.data; const { value, disabled } = this.data;
child.setData({ child.setData({
value: value.indexOf(child.data.name) !== -1, value: value.indexOf(child.data.name) !== -1,
disabled: disabled || child.data.disabled disabled: disabled || child.data.disabled
}); });
} }
} }
}); });

View File

@ -1,3 +1,3 @@
{ {
"component": true "component": true
} }

View File

@ -1 +1 @@
<slot /> <slot />

View File

@ -1 +1 @@
export {}; export {};

View File

@ -1,87 +1,87 @@
import { VantComponent } from '../common/component'; import { VantComponent } from '../common/component';
import { addUnit } from '../common/utils'; import { addUnit } from '../common/utils';
function emit(target, value) { function emit(target, value) {
target.$emit('input', value); target.$emit('input', value);
target.$emit('change', value); target.$emit('change', value);
} }
VantComponent({ VantComponent({
field: true, field: true,
relation: { relation: {
name: 'checkbox-group', name: 'checkbox-group',
type: 'ancestor', type: 'ancestor',
linked(target) { linked(target) {
this.parent = target; this.parent = target;
}, },
unlinked() { unlinked() {
this.parent = null; this.parent = null;
} }
}, },
classes: ['icon-class', 'label-class'], classes: ['icon-class', 'label-class'],
props: { props: {
value: Boolean, value: Boolean,
disabled: Boolean, disabled: Boolean,
useIconSlot: Boolean, useIconSlot: Boolean,
checkedColor: String, checkedColor: String,
labelPosition: String, labelPosition: String,
labelDisabled: Boolean, labelDisabled: Boolean,
shape: { shape: {
type: String, type: String,
value: 'round' value: 'round'
}, },
iconSize: { iconSize: {
type: null, type: null,
observer: 'setSizeWithUnit' observer: 'setSizeWithUnit'
} }
}, },
data: { data: {
sizeWithUnit: '20px' sizeWithUnit: '20px'
}, },
methods: { methods: {
emitChange(value) { emitChange(value) {
if (this.parent) { if (this.parent) {
this.setParentValue(this.parent, value); this.setParentValue(this.parent, value);
} }
else { else {
emit(this, value); emit(this, value);
} }
}, },
toggle() { toggle() {
const { disabled, value } = this.data; const { disabled, value } = this.data;
if (!disabled) { if (!disabled) {
this.emitChange(!value); this.emitChange(!value);
} }
}, },
onClickLabel() { onClickLabel() {
const { labelDisabled, disabled, value } = this.data; const { labelDisabled, disabled, value } = this.data;
if (!disabled && !labelDisabled) { if (!disabled && !labelDisabled) {
this.emitChange(!value); this.emitChange(!value);
} }
}, },
setParentValue(parent, value) { setParentValue(parent, value) {
const parentValue = parent.data.value.slice(); const parentValue = parent.data.value.slice();
const { name } = this.data; const { name } = this.data;
const { max } = parent.data; const { max } = parent.data;
if (value) { if (value) {
if (max && parentValue.length >= max) { if (max && parentValue.length >= max) {
return; return;
} }
if (parentValue.indexOf(name) === -1) { if (parentValue.indexOf(name) === -1) {
parentValue.push(name); parentValue.push(name);
emit(parent, parentValue); emit(parent, parentValue);
} }
} }
else { else {
const index = parentValue.indexOf(name); const index = parentValue.indexOf(name);
if (index !== -1) { if (index !== -1) {
parentValue.splice(index, 1); parentValue.splice(index, 1);
emit(parent, parentValue); emit(parent, parentValue);
} }
} }
}, },
setSizeWithUnit(size) { setSizeWithUnit(size) {
this.set({ this.set({
sizeWithUnit: addUnit(size) sizeWithUnit: addUnit(size)
}); });
}, },
} }
}); });

View File

@ -1,6 +1,6 @@
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"van-icon": "../icon/index" "van-icon": "../icon/index"
} }
} }

View File

@ -1,19 +1,19 @@
<wxs src="../wxs/utils.wxs" module="utils" /> <wxs src="../wxs/utils.wxs" module="utils" />
<view class="van-checkbox custom-class"> <view class="van-checkbox custom-class">
<view class="van-checkbox__icon-wrap" bindtap="toggle"> <view class="van-checkbox__icon-wrap" bindtap="toggle">
<slot wx:if="{{ useIconSlot }}" name="icon" /> <slot wx:if="{{ useIconSlot }}" name="icon" />
<van-icon <van-icon
wx:else wx:else
name="success" name="success"
size="0.8em" size="0.8em"
class="{{ utils.bem('checkbox__icon', [shape, { disabled, checked: value }]) }}" class="{{ utils.bem('checkbox__icon', [shape, { disabled, checked: value }]) }}"
style="font-size: {{ sizeWithUnit }};{{ checkedColor && value && !disabled ? 'border-color:' + checkedColor + '; background-color:' + checkedColor : '' }}" style="font-size: {{ sizeWithUnit }};{{ checkedColor && value && !disabled ? 'border-color:' + checkedColor + '; background-color:' + checkedColor : '' }}"
custom-class="icon-class" custom-class="icon-class"
custom-style="line-height: 1.25em;" custom-style="line-height: 1.25em;"
/> />
</view> </view>
<view class="label-class {{ utils.bem('checkbox__label', [labelPosition, { disabled }]) }}" bindtap="onClickLabel"> <view class="label-class {{ utils.bem('checkbox__label', [labelPosition, { disabled }]) }}" bindtap="onClickLabel">
<slot /> <slot />
</view> </view>
</view> </view>

View File

@ -1 +1 @@
export {}; export {};

View File

@ -1,158 +1,158 @@
import { VantComponent } from '../common/component'; import { VantComponent } from '../common/component';
import { isObj } from '../common/utils'; import { isObj } from '../common/utils';
import { BLUE, WHITE } from '../common/color'; import { BLUE, WHITE } from '../common/color';
function format(rate) { function format(rate) {
return Math.min(Math.max(rate, 0), 100); return Math.min(Math.max(rate, 0), 100);
} }
const PERIMETER = 2 * Math.PI; const PERIMETER = 2 * Math.PI;
const BEGIN_ANGLE = -Math.PI / 2; const BEGIN_ANGLE = -Math.PI / 2;
const STEP = 1; const STEP = 1;
VantComponent({ VantComponent({
props: { props: {
text: String, text: String,
lineCap: { lineCap: {
type: String, type: String,
value: 'round' value: 'round'
}, },
value: { value: {
type: Number, type: Number,
value: 0, value: 0,
observer: 'reRender' observer: 'reRender'
}, },
speed: { speed: {
type: Number, type: Number,
value: 50 value: 50
}, },
size: { size: {
type: Number, type: Number,
value: 100, value: 100,
observer: 'setStyle' observer: 'setStyle'
}, },
fill: String, fill: String,
layerColor: { layerColor: {
type: String, type: String,
value: WHITE value: WHITE
}, },
color: { color: {
type: [String, Object], type: [String, Object],
value: BLUE, value: BLUE,
observer: 'setHoverColor' observer: 'setHoverColor'
}, },
strokeWidth: { strokeWidth: {
type: Number, type: Number,
value: 4 value: 4
}, },
clockwise: { clockwise: {
type: Boolean, type: Boolean,
value: true value: true
} }
}, },
data: { data: {
style: 'width: 100px; height: 100px;', style: 'width: 100px; height: 100px;',
hoverColor: BLUE hoverColor: BLUE
}, },
methods: { methods: {
getContext() { getContext() {
if (!this.ctx) { if (!this.ctx) {
this.ctx = wx.createCanvasContext('van-circle', this); this.ctx = wx.createCanvasContext('van-circle', this);
} }
return this.ctx; return this.ctx;
}, },
setHoverColor() { setHoverColor() {
const context = this.getContext(); const context = this.getContext();
const { color, size } = this.data; const { color, size } = this.data;
let hoverColor = color; let hoverColor = color;
if (isObj(color)) { if (isObj(color)) {
const LinearColor = context.createLinearGradient(size, 0, 0, 0); const LinearColor = context.createLinearGradient(size, 0, 0, 0);
Object.keys(color) Object.keys(color)
.sort((a, b) => parseFloat(a) - parseFloat(b)) .sort((a, b) => parseFloat(a) - parseFloat(b))
.map(key => LinearColor.addColorStop(parseFloat(key) / 100, color[key])); .map(key => LinearColor.addColorStop(parseFloat(key) / 100, color[key]));
hoverColor = LinearColor; hoverColor = LinearColor;
} }
this.setData({ hoverColor }); this.setData({ hoverColor });
}, },
setStyle() { setStyle() {
const { size } = this.data; const { size } = this.data;
const style = `width: ${size}px; height: ${size}px;`; const style = `width: ${size}px; height: ${size}px;`;
this.setData({ style }); this.setData({ style });
}, },
presetCanvas(context, strokeStyle, beginAngle, endAngle, fill) { presetCanvas(context, strokeStyle, beginAngle, endAngle, fill) {
const { strokeWidth, lineCap, clockwise, size } = this.data; const { strokeWidth, lineCap, clockwise, size } = this.data;
const position = size / 2; const position = size / 2;
const radius = position - strokeWidth / 2; const radius = position - strokeWidth / 2;
context.setStrokeStyle(strokeStyle); context.setStrokeStyle(strokeStyle);
context.setLineWidth(strokeWidth); context.setLineWidth(strokeWidth);
context.setLineCap(lineCap); context.setLineCap(lineCap);
context.beginPath(); context.beginPath();
context.arc(position, position, radius, beginAngle, endAngle, !clockwise); context.arc(position, position, radius, beginAngle, endAngle, !clockwise);
context.stroke(); context.stroke();
if (fill) { if (fill) {
context.setFillStyle(fill); context.setFillStyle(fill);
context.fill(); context.fill();
} }
}, },
renderLayerCircle(context) { renderLayerCircle(context) {
const { layerColor, fill } = this.data; const { layerColor, fill } = this.data;
this.presetCanvas(context, layerColor, 0, PERIMETER, fill); this.presetCanvas(context, layerColor, 0, PERIMETER, fill);
}, },
renderHoverCircle(context, formatValue) { renderHoverCircle(context, formatValue) {
const { clockwise, hoverColor } = this.data; const { clockwise, hoverColor } = this.data;
// 结束角度 // 结束角度
const progress = PERIMETER * (formatValue / 100); const progress = PERIMETER * (formatValue / 100);
const endAngle = clockwise const endAngle = clockwise
? BEGIN_ANGLE + progress ? BEGIN_ANGLE + progress
: 3 * Math.PI - (BEGIN_ANGLE + progress); : 3 * Math.PI - (BEGIN_ANGLE + progress);
this.presetCanvas(context, hoverColor, BEGIN_ANGLE, endAngle); this.presetCanvas(context, hoverColor, BEGIN_ANGLE, endAngle);
}, },
drawCircle(currentValue) { drawCircle(currentValue) {
const context = this.getContext(); const context = this.getContext();
const { size } = this.data; const { size } = this.data;
context.clearRect(0, 0, size, size); context.clearRect(0, 0, size, size);
this.renderLayerCircle(context); this.renderLayerCircle(context);
const formatValue = format(currentValue); const formatValue = format(currentValue);
if (formatValue !== 0) { if (formatValue !== 0) {
this.renderHoverCircle(context, formatValue); this.renderHoverCircle(context, formatValue);
} }
context.draw(); context.draw();
}, },
reRender() { reRender() {
// tofector 动画暂时没有想到好的解决方案 // tofector 动画暂时没有想到好的解决方案
const { value, speed } = this.data; const { value, speed } = this.data;
if (speed <= 0 || speed > 1000) { if (speed <= 0 || speed > 1000) {
this.drawCircle(value); this.drawCircle(value);
return; return;
} }
this.clearInterval(); this.clearInterval();
this.currentValue = this.currentValue || 0; this.currentValue = this.currentValue || 0;
this.interval = setInterval(() => { this.interval = setInterval(() => {
if (this.currentValue !== value) { if (this.currentValue !== value) {
if (this.currentValue < value) { if (this.currentValue < value) {
this.currentValue += STEP; this.currentValue += STEP;
} }
else { else {
this.currentValue -= STEP; this.currentValue -= STEP;
} }
this.drawCircle(this.currentValue); this.drawCircle(this.currentValue);
} }
else { else {
this.clearInterval(); this.clearInterval();
} }
}, 1000 / speed); }, 1000 / speed);
}, },
clearInterval() { clearInterval() {
if (this.interval) { if (this.interval) {
clearInterval(this.interval); clearInterval(this.interval);
this.interval = null; this.interval = null;
} }
} }
}, },
created() { created() {
const { value } = this.data; const { value } = this.data;
this.currentValue = value; this.currentValue = value;
this.drawCircle(value); this.drawCircle(value);
}, },
destroyed() { destroyed() {
this.ctx = null; this.ctx = null;
this.clearInterval(); this.clearInterval();
} }
}); });

Some files were not shown because too many files have changed in this diff Show More