Commit 6d602742 by jscat

nyx weapp: 页面优化

1. 给my-orders页面添加qrcode功能
parent 3c5763ac
// pages/my/my-order/my-order.js // pages/my/my-order/my-order.js
...@@ -13,6 +13,14 @@ Page({ ...@@ -13,6 +13,14 @@ Page({
authStatus: "", authStatus: "",
userInfo: {}, userInfo: {},
//选中barcode的qrcode和url
qrcode : "",
qrcode_url : "",
/* 模态框 */
showModalPoints: false,
showModalBarcode : false,
//活动列表 //活动列表
orders : [], orders : [],
//活动信息 //活动信息
...@@ -225,24 +233,13 @@ Page({ ...@@ -225,24 +233,13 @@ Page({
// 用户自定义函数 // 用户自定义函数
/* /*
*/ */
/* 点击好友助力 */
onClickPoints: function(e){
var _this = this;
var indexId = e.currentTarget.dataset.id
var match_id = _this.__data__.points[indexId].match_id
_this.getBonus(match_id)
    _this.setData({
      showModalPoints: true
    })
},
/* 点击barcode */ /* 点击barcode */
onClickBarcode: function(e){ onClickBarcode: function(e){
var _this = this; var _this = this;
//指明具体是list的哪一个item //指明具体是list的哪一个item
var indexId = e.currentTarget.dataset.id var indexId = e.currentTarget.dataset.id
var qrcode_url = _this.__data__.points[indexId].qrcode_url var qrcode_url = _this.__data__.orders[indexId].order_qrcode
var qrcode = _this.__data__.points[indexId].match_id var qrcode = _this.__data__.orders[indexId].order_id
    this.setData({     this.setData({
      showModalBarcode : true,       showModalBarcode : true,
qrcode : qrcode, qrcode : qrcode,
......
<view class="page"> <view class="page">
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
<view class="item stamp stamp01" style="height:{{item.item_height}}rpx;"> <view class="item stamp stamp01" style="height:{{item.item_height}}rpx;">
<!-- 商家信息 --> <!-- 商家信息 -->
<view class="note-info"> <view class="note-info">
<view class="note-title" style="font-weight: bold"> <view class="note-member" style="font-weight: bold">
<view class="title-left">{{item.member_name}}</view> <view class="member-left">{{item.member_name}}</view>
<view class="title-right" bindtap="onClickBarcode" data-id='{{index}}'> <view class="member-right" bindtap="onClickBarcode" data-id='{{index}}'>
<image src="../../../icon/my/logo-barcode.png"></image> <image src="../../../icon/my/logo-barcode.png"></image>
</view> </view>
</view> </view>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<span>{{sub_item.product_desc}}</span> <span>{{sub_item.product_desc}}</span>
<span> <span>
<view class="price-row"> <view class="price-row">
<view class="sub-price">{{sub_item.unit_price}}</view> <view class="sub-price">{{sub_item.unit_price}}</view>
<view class="sub-quantity"> x{{sub_item.quantity}}</view> <view class="sub-quantity"> x{{sub_item.quantity}}</view>
</view> </view>
</span> </span>
...@@ -59,29 +59,6 @@ ...@@ -59,29 +59,6 @@
<view class="weui-loadmore__tips">没有更多啦 {{'>'}}_{{'<'}} </view> <view class="weui-loadmore__tips">没有更多啦 {{'>'}}_{{'<'}} </view>
</view> </view>
<!-- 查看好友助力-->
<!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85104827 -->
<!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85320926 -->
<!-- start 遮罩层 -->
<view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModalPoints}}"></view>
<!-- 弹出层 -->
<view class="modalDlg" wx:if="{{showModalPoints}}">
<!-- 二维码或其他图片 -->
<view class="title">
<text style="color:#666666">助力清单</text>
</view>
<view class="title-close" bindtap="ok">
<image src="../../../icon/close.png"></image>
</view>
<view class="list-point">
<view class="text" wx:for="{{bonus_info}}" wx:for-item="item" wx:key="{{index}}" >
{{item.user_name}}助力{{item.bonus_point}}积分
</view>
</view>
</view>
<!-- end 遮罩层 -->
<!-- 查看优惠券码--> <!-- 查看优惠券码-->
<!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85104827 --> <!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85104827 -->
<!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85320926 --> <!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85320926 -->
......
.page{ .page{
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.title-close{ .title-right{
display: flex; display: flex;
height: 80rpx; height: 80rpx;
position: absolute; position: absolute;
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.note-title{ .note-member{
display: flex; display: flex;
font-size: 32rpx; font-size: 32rpx;
margin-left: 5%; margin-left: 5%;
...@@ -255,9 +255,9 @@ ...@@ -255,9 +255,9 @@
vertical-align: center; vertical-align: center;
} }
.note-title .title-left{width: 520rpx; flex:1} .note-member .member-left{width: 520rpx; flex:1}
.note-title .title-right{width: 160rpx;justify-content: flex-end;display: flex;} .note-member .member-right{width: 160rpx;justify-content: flex-end;display: flex;}
.note-title .title-right image{ .note-member .member-right image{
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;
font-size: 0; font-size: 0;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论