Browse Source

feat: bug修复;

pull/9/head
fox 2 weeks ago
parent
commit
fefdfebf47
13 changed files with 115 additions and 120 deletions
  1. +1
    -1
      components/order/orderCard.vue
  2. +6
    -16
      pages/index/category.vue
  3. +20
    -70
      pages/index/center.vue
  4. +3
    -2
      pages/index/index.vue
  5. +24
    -0
      pages_order/auth/wxUserInfo.vue
  6. +0
    -0
      pages_order/components/memberProgress.vue
  7. +4
    -7
      pages_order/mine/cooperation.vue
  8. +3
    -3
      pages_order/mine/memberCenter.vue
  9. +43
    -4
      pages_order/mine/promotionH5.vue
  10. +7
    -11
      pages_order/mine/voucher.vue
  11. +4
    -4
      pages_order/order/verifyOrder.vue
  12. BIN
      pages_order/static/center/member-bg.png
  13. +0
    -2
      uni.scss

+ 1
- 1
components/order/orderCard.vue View File

@ -20,7 +20,7 @@
</view>
<view class="btns">
<template v-if="!readonly">
<template v-if="data.status != 1">
<template v-if="data.status != 1 && data.status != 3">
<button plain class="btn btn-plain" @click="onDelete">删除订单</button>
</template>
<!-- 待付款 -->


+ 6
- 16
pages/index/category.vue View File

@ -14,7 +14,6 @@
v-model="queryParams.title"
placeholder="搜索项目名称"
bgColor="#F5F5F5"
inputAlign="center"
:showAction="false"
@search="search"
@change="search"
@ -111,28 +110,18 @@
onShow() {
},
onLoad({
search,
cid
}) {
onLoad() {
let search = uni.getStorageSync('search')
console.log('onLoad', search)
if (search) {
this.queryParams.title = search
uni.setStorageSync('search', '')
}
this.initList()
return
if(this.category.length > 0 && cid){
this.category.forEach((n, i) => {
if(n.id == cid){
this.current = i
}
})
// this.queryParams.classId = cid
}else if (this.category.length > 0) {
// this.queryParams.classId = this.category[0].id
}
},
methods: {
async fetchCategoryList() {
@ -190,6 +179,7 @@
align-items: center;
}
$body-height: calc(100vh - #{$tabbar-height} - env(safe-area-inset-bottom));
$search-height: 108rpx;
$list-height: calc(#{$body-height} - #{$search-height});


+ 20
- 70
pages/index/center.vue View File

@ -9,11 +9,12 @@
</view>
<!-- 登录后显示用户信息 -->
<view v-else class="flex flex-column user">
<view v-else class="flex flex-column user" @click="$utils.navigateTo('/pages_order/auth/wxUserInfo')">
<image class="user-avatar" :src="userInfo.headImage" mode="aspectFill"></image>
<view class="user-name">{{ userInfo.nickName }}</view>
</view>
<view class="member">
<image class="member-bg" src="@/pages_order/static/center/member-bg.png" mode="widthFix" ></image>
<view class="flex member-overview" :class="[role ? 'is-member' : '']">
<template v-if="role">
<!-- todo: 缺切图 "皇冠" -->
@ -32,35 +33,6 @@
<button plain class="btn member-btn" @click="$utils.navigateTo('/pages_order/mine/memberCenter')">立即开通</button>
</template>
</view>
<view class="member-rights">
<image class="member-rights-bg" src="@/pages_order/static/center/member-bg.png" mode="top" ></image>
<view class="flex member-rights-content">
<view class="flex">
<image class="icon icon-rights" src="@/static/image/center/icon-member-weal.png" mode="widthFix"></image>
<view>
<view class="member-rights-label">会员福利</view>
<view class="member-rights-value">会员折扣</view>
</view>
</view>
<view class="flex">
<!-- todo: 缺切图 -->
<image class="icon icon-rights" src="@/static/image/center/icon-member-weal.png" mode="widthFix"></image>
<view>
<view class="member-rights-label">会员积分</view>
<view class="member-rights-value">兑换礼品</view>
</view>
</view>
<!-- todo: 缺切图 -->
<view class="flex">
<image class="icon icon-rights" src="@/static/image/center/icon-member-weal.png" mode="widthFix"></image>
<view>
<view class="member-rights-label">会员优惠券</view>
<view class="member-rights-value">满减折扣</view>
</view>
</view>
</view>
</view>
</view>
</view>
@ -147,7 +119,6 @@
</view>
</view>
<!-- todo -->
<view class="right" @click="onScan">
<image class="right-bg" src="@/static/image/center/bg-scan.png"></image>
</view>
@ -342,7 +313,7 @@
.header {
height: 550rpx;
background-image: linear-gradient(#84A73F, #D8FF8F);
justify-content: flex-start;
justify-content: flex-end;
position: relative;
}
}
@ -391,19 +362,31 @@
}
.member {
width: calc(724rpx);
position: absolute;
bottom: 0;
left: 13rpx;
width: calc(100vw - 8rpx);
height: 241rpx;
// position: absolute;
// bottom: 0;
// left: 13rpx;
position: relative;
margin-top: 37rpx;
transform: translateY(10rpx);
color: #F5F5F5;
font-size: 22rpx;
background-color: #2B2C30;
// background-color: #2B2C30;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
&-bg {
width: 100%;
height: 100%;
}
&-overview {
position: absolute;
top: 10rpx;
left: 30rpx;
min-height: 81rpx;
justify-content: space-between;
@ -448,39 +431,6 @@
&-tips {
margin-left: 6rpx;
}
&-rights {
background-color: #37393D;
position: relative;
width: 100%;
height: 142rpx;
box-sizing: border-box;
&-bg {
width: 100%;
height: 100%;
}
&-content {
position: absolute;
bottom: 0;
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 0 35rpx 6rpx 35rpx;
justify-content: space-between;
}
&-label {
color: #CBAD8F;
font-size: 22rpx;
font-weight: 700;
}
&-value {
color: #F5F5F5;
font-size: 18rpx;
}
}
}
.card {


+ 3
- 2
pages/index/index.vue View File

@ -97,8 +97,9 @@
methods: {
//
search() {
uni.navigateTo({
url: '/pages/index/category?search=' + this.keyword
uni.setStorageSync('search', this.keyword)
uni.switchTab({
url: '/pages/index/category'
})
this.keyword = ''
},


+ 24
- 0
pages_order/auth/wxUserInfo.vue View File

@ -129,6 +129,26 @@
}
})
},
validatePhone(phone) {
// let fixedLindReg = /(\d{3,4}-)?\d{7,8}$/g //
let mobileReg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/g //
// if (fixedLindReg.test(phone)) {
// return true
// }
if (mobileReg.test(phone)) {
return true
}
uni.showToast({
title: '请填写正确手机号',
icon: "none"
})
return false
},
submit() {
let self = this
@ -149,6 +169,10 @@
return
}
if (!this.validatePhone(self.userInfoForm.phone)) {
return
}
self.$api('updateInfo', {
headImage : self.userInfoForm.headImage,
nickName : self.userInfoForm.nickName,


pages_order/components/progress.vue → pages_order/components/memberProgress.vue View File


+ 4
- 7
pages_order/mine/cooperation.vue View File

@ -13,13 +13,10 @@
<view class="form-title">门头照片</view>
<view class="card upload">
<formUpload v-model="form.image">
<template v-slot="{ value }">
<view class="flex">
<image v-if="value" class="upload-img" :src="value" mode="aspectFill" />
<image v-else class="upload-img" src="../static/cooperation/icon-upload.png"
mode="aspectFill" />
</view>
</template>
<view class="flex">
<image v-if="form.image" class="upload-img" :src="form.image" mode="aspectFill" />
<image v-else class="upload-img" src="../static/cooperation/icon-upload.png" mode="aspectFill" />
</view>
</formUpload>
</view>
</view>


+ 3
- 3
pages_order/mine/memberCenter.vue View File

@ -28,7 +28,7 @@
</view>
<view class="consumption" v-if="!role">
<!-- todo: 对接接口 -->
<progress :current="1000" :total="3800"></progress>
<memberProgress :current="1000" :total="3800"></memberProgress>
<text class="consumption-desc">{{ `累积消费达到${3800}元或直接充值即可成为会员` }}</text>
</view>
<view class="charge">
@ -76,7 +76,7 @@
</template>
<script>
import progress from '../components/progress.vue'
import memberProgress from '../components/memberProgress.vue'
import mixinsConfigList from '@/mixins/configList.js'
import {
@ -88,7 +88,7 @@
name: "MemberCenter",
mixins: [mixinsConfigList],
components: {
progress,
memberProgress,
},
data() {
return {


+ 43
- 4
pages_order/mine/promotionH5.vue View File

@ -133,8 +133,8 @@
//
initCanvas() {
// H5使便
this.canvasW = 299
this.canvasH = 403
this.canvasW = 349
this.canvasH = 389
this.qrCodeSize = 180
this._center = this.canvasW / 2
@ -197,6 +197,45 @@
//
ctx.setFillStyle('#ffffff')
ctx.fillRect(0, 0, this.canvasW, this.canvasH)
ctx.setFillStyle('#000000')
ctx.setFontSize(16)
let text = '邀请好友'
//
let metrics = ctx.measureText(text);
ctx.fillText(text, this._center - metrics.width / 2, 53);
text = `邀请码:${this.userId}`
//
metrics = ctx.measureText(text);
// todo: check code
ctx.fillText(text, this._center - metrics.width / 2, 342);
//
try {
const qrCodeImagePath = await this.getQRCodeImage()
if (qrCodeImagePath) {
const qrSize = 192
const qrX = (this.canvasW - qrSize) / 2
const qrY = 94
ctx.drawImage(qrCodeImagePath, qrX, qrY, qrSize, qrSize)
}
} catch (e) {
console.log('二维码绘制失败', e)
}
//
ctx.draw(false, () => {
//
setTimeout(() => {
this.canvasToTempFilePath()
}, 1000)
})
return
//
ctx.setFillStyle('#333333')
@ -455,11 +494,11 @@
<style lang="scss" scoped>
.placard {
display: flex;
align-items: center;
align-items: start;
justify-content: center;
min-height: 100vh;
background-color: #f5f5f5;
padding: 20px;
padding: 48rpx 26rpx;
.placard-content {
display: flex;


+ 7
- 11
pages_order/mine/voucher.vue View File

@ -33,20 +33,16 @@
<template v-if="current == 0" >
<view class="list voucher">
<!-- todo: check only show status == 0? -->
<voucherCard class="list-item"
v-for="item in list"
:key="item.id"
:data="item"
></voucherCard>
<view class="list-item" v-for="item in list" :key="item.id">
<voucherCard :data="item" ></voucherCard>
</view>
</view>
</template>
<template v-else-if="current == 1" >
<view class="list store">
<storeCard class="list-item"
v-for="item in list"
:key="item.id"
:data="item"
></storeCard>
<view class="list-item" v-for="item in list" :key="item.id">
<storeCard :data="item" ></storeCard>
</view>
</view>
</template>
</view>
@ -108,7 +104,7 @@
this.list = []
this.getData()
}
},
},
}
</script>


+ 4
- 4
pages_order/order/verifyOrder.vue View File

@ -23,8 +23,8 @@
<view class="card info">
<view class="info-header">核销信息</view>
<view class="flex flex-column info-content">
<view class="" style="margin: 20rpx;">
<uv-qrcode ref="qrcode" size="300px" :value="`${orderDetail.id},0`"></uv-qrcode>
<view class="info-qr">
<uv-qrcode ref="qrcode" size="279rpx" :value="`${orderDetail.id},0`"></uv-qrcode>
</view>
<view class="info-no">{{ `订单号:${orderDetail.id}` }}</view>
@ -184,8 +184,8 @@
}
&-qr {
width: 279rpx;
height: auto;
// width: 279rpx;
// height: auto;
margin-top: 57rpx;
}


BIN
pages_order/static/center/member-bg.png View File

Before After
Width: 690  |  Height: 1227  |  Size: 573 KiB Width: 742  |  Height: 241  |  Size: 74 KiB

+ 0
- 2
uni.scss View File

@ -106,5 +106,3 @@ $uni-font-size-paragraph:15px;
$navbar-height: 100rpx;
$tabbar-height: 120rpx;
$body-height: calc(100vh - #{$tabbar-height} - env(safe-area-inset-bottom) - #{$navbar-height} - var(--status-bar-height) - 20rpx);

Loading…
Cancel
Save