|
|
@@ -41,13 +41,14 @@
|
|
|
/>
|
|
|
<img v-else src="/native/imgs/normal_user.png" class="icon" mode="heightFix" />
|
|
|
</div>
|
|
|
- <img src="../static/imgs/icon_code.png" class="icon-code" @click="showQrCode = true" />
|
|
|
+ <img src="../static/imgs/icon_code.png" class="icon-code" @click="onShare" />
|
|
|
</div>
|
|
|
<img
|
|
|
v-if="userInfo && userInfo.vip"
|
|
|
class="vip-img"
|
|
|
src="../static/imgs/btn_vip.png"
|
|
|
mode="widthFix"
|
|
|
+ @click="navigateTo('/pages/vipCenter')"
|
|
|
/>
|
|
|
<img
|
|
|
v-else
|
|
|
@@ -65,21 +66,21 @@
|
|
|
</div>
|
|
|
<img class="bg-mask" src="../static/imgs/bg_mask.png" mode="widthFix" />
|
|
|
</div>
|
|
|
- <div class="icon-menus">
|
|
|
+ <div class="icon-menus" @click="navigateTo('/pages/order')">
|
|
|
<div class="item">
|
|
|
<img src="../static/imgs/icon_order_not_paid.png" class="icon" />
|
|
|
<div class="name">待付款</div>
|
|
|
</div>
|
|
|
- <div class="item">
|
|
|
+ <div class="item" @click="navigateTo('/pages/order')">
|
|
|
<img src="../static/imgs/icon_order_paid.png" class="icon" />
|
|
|
<div class="name">待使用</div>
|
|
|
</div>
|
|
|
- <div class="item">
|
|
|
+ <div class="item" @click="navigateTo('/pages/order')">
|
|
|
<img src="../static/imgs/icon_order_finish.png" class="icon" />
|
|
|
<div class="name">已完成</div>
|
|
|
</div>
|
|
|
<div class="divider"></div>
|
|
|
- <div class="item">
|
|
|
+ <div class="item" @click="navigateTo('/pages/order')">
|
|
|
<img src="../static/imgs/icon_order.png" class="icon" />
|
|
|
<div class="name">我的订单</div>
|
|
|
</div>
|
|
|
@@ -95,7 +96,7 @@
|
|
|
<div class="title">联系客服</div>
|
|
|
<img src="../static/imgs/icon_into.png" class="into" />
|
|
|
</div>
|
|
|
- <div class="menu">
|
|
|
+ <div class="menu" @click="navigateTo('/pages/profile')">
|
|
|
<img src="../static/imgs/icon_setting.png" class="icon" />
|
|
|
<div class="title">资料设置</div>
|
|
|
<img src="../static/imgs/icon_into.png" class="into" />
|
|
|
@@ -103,16 +104,23 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <van-overlay :show="showQrCode">
|
|
|
- <div class="qr-code-dialog">
|
|
|
- <div class="body">
|
|
|
- <div class="avatar-wrapper">
|
|
|
- <img :src="(userInfo || {}).avatar || '/native/imgs/avatar.jpg'" class="avatar" />
|
|
|
+ <van-overlay :show="showQrCode" duration="150">
|
|
|
+ <div class="pop-menu">
|
|
|
+ <div class="title">分享到</div>
|
|
|
+ <div class="share">
|
|
|
+ <div class="item" @click="saveImg">
|
|
|
+ <img class="icon" src="../static/imgs/icon_share_friend.png" />
|
|
|
+ <div class="label">微信好友</div>
|
|
|
+ </div>
|
|
|
+ <div class="item" @click="saveImg">
|
|
|
+ <img class="icon" src="../static/imgs/icon_share_timeline.png" />
|
|
|
+ <div class="label">朋友圈海报</div>
|
|
|
</div>
|
|
|
- <div class="name">{{ (userInfo || {}).nickname }} 的核销码</div>
|
|
|
- <img class="qrcode" :src="qrCode" />
|
|
|
</div>
|
|
|
- <img src="../static/imgs/icon_close.png" class="icon-close" @click="showQrCode = false" />
|
|
|
+ <div class="btn-cancel" @click="cancelShare">取消</div>
|
|
|
+ </div>
|
|
|
+ <div class="share-img-container">
|
|
|
+ <img class="share-img" mode="widthFix" :src="url" />
|
|
|
</div>
|
|
|
</van-overlay>
|
|
|
</scroll-view>
|
|
|
@@ -146,7 +154,8 @@ export default {
|
|
|
promote: 0
|
|
|
},
|
|
|
packages: [],
|
|
|
- transparent: true
|
|
|
+ transparent: true,
|
|
|
+ url: 'https://jiashanxia.oss-cn-hangzhou.aliyuncs.com/img_fenxiangye%402x.png'
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -204,6 +213,89 @@ export default {
|
|
|
} else {
|
|
|
this.transparent = true;
|
|
|
}
|
|
|
+ },
|
|
|
+ onShare() {
|
|
|
+ this.$mp.page.getTabBar().setData({ show: false });
|
|
|
+ this.showQrCode = true;
|
|
|
+ },
|
|
|
+ cancelShare() {
|
|
|
+ this.$mp.page.getTabBar().setData({ show: true });
|
|
|
+ this.showQrCode = false;
|
|
|
+ },
|
|
|
+ saveImg() {
|
|
|
+ let tempFilePath = '';
|
|
|
+ Promise.resolve()
|
|
|
+ .then(() => {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ wx.getImageInfo({
|
|
|
+ src: this.url,
|
|
|
+ success(res) {
|
|
|
+ tempFilePath = res.path;
|
|
|
+ resolve(res.path);
|
|
|
+ },
|
|
|
+ fail(e) {
|
|
|
+ console.log(e);
|
|
|
+ reject();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ wx.getSetting({
|
|
|
+ success(res) {
|
|
|
+ if (res.authSetting['scope.writePhotosAlbum']) {
|
|
|
+ resolve();
|
|
|
+ } else {
|
|
|
+ wx.authorize({
|
|
|
+ scope: 'scope.writePhotosAlbum',
|
|
|
+ success() {
|
|
|
+ resolve();
|
|
|
+ },
|
|
|
+ fail(e) {
|
|
|
+ reject('auth fail');
|
|
|
+ console.log(e);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail() {
|
|
|
+ reject('auth fail');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ wx.saveImageToPhotosAlbum({
|
|
|
+ filePath: tempFilePath,
|
|
|
+ success() {
|
|
|
+ resolve();
|
|
|
+ },
|
|
|
+ fail(e) {
|
|
|
+ console.log(e);
|
|
|
+ reject();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ wx.showToast({
|
|
|
+ icon: 'success',
|
|
|
+ title: '保存成功'
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ if ('auth fail' === e) {
|
|
|
+ this.showSettingDialog = true;
|
|
|
+ } else {
|
|
|
+ wx.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '保存失败'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -377,4 +469,66 @@ page {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.pop-menu {
|
|
|
+ height: 206px;
|
|
|
+ height: calc(206px + env(safe-area-inset-bottom));
|
|
|
+ background: #f5f7fa;
|
|
|
+ padding-top: 40px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ .flex-col();
|
|
|
+ .title {
|
|
|
+ color: @text4;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 13px;
|
|
|
+ }
|
|
|
+ .share {
|
|
|
+ .flex();
|
|
|
+ margin-top: 14px;
|
|
|
+ flex-grow: 1;
|
|
|
+ .item {
|
|
|
+ flex-basis: 0;
|
|
|
+ flex-grow: 1;
|
|
|
+ .flex-col();
|
|
|
+ align-items: center;
|
|
|
+ .icon {
|
|
|
+ width: 38px;
|
|
|
+ height: 38px;
|
|
|
+ }
|
|
|
+ .label {
|
|
|
+ margin-top: 4px;
|
|
|
+ color: black;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .btn-cancel {
|
|
|
+ height: 44px;
|
|
|
+ padding-bottom: env(safe-area-inset-bottom);
|
|
|
+ background: white;
|
|
|
+ font-size: 15px;
|
|
|
+ color: black;
|
|
|
+ .flex();
|
|
|
+ justify-content: center;
|
|
|
+ &:active {
|
|
|
+ background: shade(white, 10%);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.share-img {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 186px;
|
|
|
+ bottom: calc(186px + env(safe-area-inset-bottom));
|
|
|
+ // height: calc(100vh - 298px);
|
|
|
+ // height: calc(100vh - 298px - env(safe-area-inset-bottom));
|
|
|
+ // width: auto;
|
|
|
+ width: calc(100vw - 100px);
|
|
|
+ height: auto;
|
|
|
+ margin: auto;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+}
|
|
|
</style>
|