Compare commits

..

1 Commits

Author SHA1 Message Date
qiushanhe 3d6252d5cb Merge pull request '抽奖' (#34) from dev-qsh into jwl-gift 8 months ago
  1. 4
      .env.development
  2. 3
      .env.production
  3. 3
      package.json
  4. 28
      project.config.json
  5. 7
      project.private.config.json
  6. 118
      src/jtools/api/activity.js
  7. 2
      src/jtools/request/index.js
  8. 8
      src/manifest.json
  9. 9
      src/pages.json
  10. 120
      src/pages/index/components/ggl/index.vue
  11. 494
      src/pages/index/components/ggl/scraping.vue
  12. 264
      src/pages/index/index.vue
  13. 14
      src/pages/login/login.vue
  14. 254
      src/pages/me/help.vue
  15. 37
      src/pages/me/index.vue
  16. 65
      src/pages/me/myGift.vue
  17. 7
      src/pages/me/qrCode.vue
  18. BIN
      src/static/image/mine/outtime.png

@ -7,6 +7,4 @@ VITE_APP_ENV = 'development'
# 金武联驾校/开发环境 # 金武联驾校/开发环境
VITE_APP_BASE_API = 'https://jwl.ahduima.com/' VITE_APP_BASE_API = 'https://jwl.ahduima.com/'
# #
VITE_WEB_BASE_URL = 'https://jwl.ahduima.com' VITE_WEB_BASE_URL = 'https://jwl.ahduima.com'
# 资源地址
VITE_RESOURSE_URL = 'http://huodong.ahduima.com'

@ -9,6 +9,3 @@ VITE_APP_BASE_API = 'https://jwl.ahduima.com/'
# #
VITE_WEB_BASE_URL = 'https://jwl.ahduima.com' VITE_WEB_BASE_URL = 'https://jwl.ahduima.com'
# 资源地址
VITE_RESOURSE_URL = 'http://huodong.ahduima.com'

@ -4,10 +4,8 @@
"scripts": { "scripts": {
"dev:h5": "uni", "dev:h5": "uni",
"dev": "uni -p mp-weixin", "dev": "uni -p mp-weixin",
"dev:dy": "uni -p mp-toutiao",
"build:h5": "uni build", "build:h5": "uni build",
"build": "uni build -p mp-weixin", "build": "uni build -p mp-weixin",
"build:dy": "uni build -p mp-toutiao",
"build-test:mp-weixin": "uni --mode test -p mp-weixin" "build-test:mp-weixin": "uni --mode test -p mp-weixin"
}, },
"dependencies": { "dependencies": {
@ -16,7 +14,6 @@
"@dcloudio/uni-components": "3.0.0-alpha-3060420220922001", "@dcloudio/uni-components": "3.0.0-alpha-3060420220922001",
"@dcloudio/uni-h5": "3.0.0-alpha-3060420220922001", "@dcloudio/uni-h5": "3.0.0-alpha-3060420220922001",
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3060420220922001", "@dcloudio/uni-mp-weixin": "3.0.0-alpha-3060420220922001",
"@dcloudio/uni-mp-toutiao": "3.0.0-alpha-3060420220922001",
"jsencrypt-plus": "^0.1.0", "jsencrypt-plus": "^0.1.0",
"pinia": "2.0.36", "pinia": "2.0.36",
"pinia-plugin-persist-uni": "^1.2.0", "pinia-plugin-persist-uni": "^1.2.0",

@ -1,28 +0,0 @@
{
"appid": "wx24c1b58020a5ce66",
"compileType": "miniprogram",
"libVersion": "3.3.3",
"packOptions": {
"ignore": [],
"include": []
},
"setting": {
"coverView": true,
"es6": true,
"postcss": true,
"minified": true,
"enhance": true,
"showShadowRootInWxmlPanel": true,
"packNpmRelationList": [],
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
}
}

@ -1,7 +0,0 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "jwl-applet",
"setting": {
"compileHotReLoad": true
}
}

@ -1,118 +0,0 @@
import request from '../request/index.js';
//查询活动列表
export function queryActivityList(data) {
return request({
url: 'activity/applet/activity/list',
method: 'get',
data,
noToken: true
});
}
//查询活动详情
export function queryActivityDetail(data) {
return request({
url: 'activity/applet/activity/detail',
method: 'get',
data,
noToken: true
});
}
//查询抽奖次数
export function queryLuckyNum(data) {
return request({
url: 'activity/applet/activity/lucky/num',
method: 'get',
data,
noToken: true
});
}
//查询中奖结果
export function queryLuckyResult(data) {
return request({
url: 'activity/applet/activity/lucky/result',
method: 'get',
data,
noToken: true
});
}
//录入中奖结果
export function saveWinner(data) {
return request({
url: 'activity/applet/activity/winner/save',
method: 'POST',
data,
noToken: true
});
}
//核销
export function receiveWinner(data) {
return request({
url: 'activity/applet/activity/winner/receive',
method: 'POST',
data,
noToken: true
});
}
//查询中奖记录
export function getLuckyRecord(data) {
return request({
url: 'activity/applet/activity/lucky/record',
method: 'get',
data,
noToken: true
});
}
//查询中奖记录
export function canRecieveGift(data) {
return request({
url: 'activity/applet/activity/receive/user',
method: 'get',
data,
noToken: true
});
}
//查询中奖信息
export function queryWinnerInfo(data) {
return request({
url: 'activity/applet/activity/winner/info',
method: 'get',
data,
noToken: true
});
}
//查询助力信息
export function queryHelpInfo(data) {
return request({
url: 'activity/applet/activity/help/info',
method: 'get',
data,
noToken: true
});
}
//保存助力信息
export function saveHelpInfo(data) {
return request({
url: 'activity/applet/activity/help/save',
method: 'post',
data,
noToken: true
});
}
//微信登录获取手机号
export function wxLogin(data) {
return request({
url: 'activity/applet/activity/wx/login',
method: 'post',
data,
noToken: true
});
}

@ -32,7 +32,7 @@ function service(options = {}) {
useUserStore().logoutWithoutToken() useUserStore().logoutWithoutToken()
//请求成功 //请求成功
resolved(res.data); resolved(res.data);
} else if(res.data.code != '0000'&&res.data.code !='4001'&&res.data.code != 200) { } else if(res.data.code != '0000'&&res.data.code !='4001') {
uni.showToast({ uni.showToast({
title: res?.data?.message || '访问出错', title: res?.data?.message || '访问出错',
icon: 'none' icon: 'none'

@ -66,13 +66,7 @@
"usingComponents" : true "usingComponents" : true
}, },
"mp-toutiao" : { "mp-toutiao" : {
"usingComponents" : true, "usingComponents" : true
"appid" : "ttbbd1cd6c24e1c00801",
"setting" : {
"es6" : true,
"postcss" : true,
"minified" : true
}
}, },
"uniStatistics" : { "uniStatistics" : {
"enable" : false "enable" : false

@ -8,7 +8,7 @@
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "金武联驾考", "navigationStyle": "custom",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
@ -197,13 +197,6 @@
"navigationBarTitleText" : "核销二维码", "navigationBarTitleText" : "核销二维码",
"enablePullDownRefresh" : false "enablePullDownRefresh" : false
} }
},
{
"path": "pages/me/help",
"style": {
"navigationBarTitleText": "好友助力",
"enablePullDownRefresh": true
}
} }
], ],

@ -1,23 +1,22 @@
<template> <template>
<view style="padding-bottom: 50px;background-color: #9e0f00;"> <view style="padding-bottom: 50px;background-color: #9e0f00;">
<image class="wp100" mode="widthFix" src="https://jwl-jiakao-bq.oss-cn-hangzhou.aliyuncs.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/ggl_header.png"></image> <image class="wp100" mode="widthFix" src="https://jwl-jiakao-bq.oss-cn-hangzhou.aliyuncs.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/ggl_header.png"></image>
<view class="tip">您今日还剩{{actiNum}}次刮奖机会共有{{total}}人参加活动</view> <view class="tip">您今日还剩1次刮奖机会共有999人参加活动</view>
<view class="scraping"> <view class="scraping">
<scraping-card style="z-index: 20;" :result="result" watermark="刮一刮" title="刮一刮赢取大奖" ref="reset" @complete="handleComplete" > <scraping-card :result="result" watermark="刮一刮" title="刮一刮赢取大奖" ref="reset" ></scraping-card>
<cover-view v-if="showBtn" class="gj"> <view v-if="showBtn" class="gj">
<cover-view class="btn" @tap="handleScrap"> <view class="btn" @tap="handleScrap">
{{btnText}} 点我刮奖
</cover-view> </view>
</cover-view> </view>
</scraping-card>
</view> </view>
<view class="relative mt30 m20lr"> <view class="relative mt30 m20lr">
<image class="wp100" mode="widthFix" src="/static/image/index/tip.png"></image> <image class="wp100" mode="widthFix" src="/static/image/index/tip.png"></image>
<view class="title">中奖名单</view> <view class="title">中奖名单</view>
<view class="card"> <view class="card">
<view v-for="(item, index) in winningList" :key="index" class="card-item"> <view v-for="(item, index) in winningList" :key="index" class="card-item">
<text class="item-text">{{ hidePhoneNumber(item.phone) }}</text> <text class="item-text">188****8888</text>
<text class="item-text">{{ item.awards }}</text> <text class="item-text">一等奖</text>
</view> </view>
</view> </view>
</view> </view>
@ -25,120 +24,39 @@
<image class="wp100" mode="widthFix" src="/static/image/index/tip.png"></image> <image class="wp100" mode="widthFix" src="/static/image/index/tip.png"></image>
<view class="title">活动说明</view> <view class="title">活动说明</view>
<view class="card"> <view class="card">
<u-parse :content="activityRule"></u-parse> <view class="item-text">1. 中奖率100%</view>
<view class="item-text">2. 报名后可获得一次抽奖机会</view>
<view class="item-text">3. 中奖用户请于"我的-我的奖品"中查看并核销</view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import useUserStore from '@/jtools/store/user'
import ScrapingCard from './scraping.vue' import ScrapingCard from './scraping.vue'
import { queryActivityDetail,queryLuckyNum,queryLuckyResult,saveWinner,getLuckyRecord } from '@/jtools/api/activity'
export default { export default {
components: { components: {
ScrapingCard ScrapingCard
}, },
data() { data() {
return { return {
detailId: undefined, result: '特等奖',
result: '',
btnText: '点我刮奖',
showBtn: true, showBtn: true,
actiNum: 0, winningList: [1,2,3,4,5,6,7,8]
total: 0,
winningList: [],
activityRule: undefined
} }
}, },
onLoad(op) {
this.detailId = op.detailId
this.getActivityDetail()
this.getActivityNum()
this.searchWinningList()
},
methods: { methods: {
handleScrap() { handleScrap() {
if(!this.actiNum) { this.showBtn = !this.showBtn
uni.showToast({
icon: 'none',
title: '暂无抽奖机会'
})
return
}
queryLuckyResult({
detailId: this.detailId
}).then(resp => {
if(resp.code == 200) {
this.result = resp.msg
this.showBtn = !this.showBtn
this.$refs.reset.init()
}
})
},
getActivityDetail() {
queryActivityDetail({detailId: this.detailId}).then(resp => {
if(resp.code == 200) {
this.activityRule = resp.data.activity.activityRule
}
})
},
hidePhoneNumber(phoneNumber) {
//
if (!/^\d{11}$/.test(phoneNumber)) {
return "无效的电话号码";
}
//
return phoneNumber.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
},
getActivityNum() {
queryLuckyNum({
detailId: this.detailId,
phone: useUserStore().userInfo?.phone || ''
}).then(resp => {
if(resp.code == 200) {
this.actiNum = resp.data.drawNum
this.total = resp.data.totalPeople
}
})
},
searchWinningList() {
getLuckyRecord({
detailId: this.detailId,
pageSize: 8
}).then(resp => {
if(resp.code == 200) {
this.winningList = resp.rows
}
})
},
handleComplete() {
saveWinner({
phone: useUserStore().userInfo?.phone || '',
detailId: this.detailId,
awards: this.result
}).then(resp => {
this.btnText = '再刮一次!'
if(resp.code == 200) {
this.getActivityNum()
let help = ",完成助力即可领取奖品!"
uni.showToast({
icon: 'none',
title: `恭喜获得${this.result}` + help
})
this.showBtn = true
}
})
} }
}, },
mounted() {
}
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.tip { .tip {
position: relative; position: relative;
margin-top: -80px; margin-top: -80px;

@ -1,280 +1,266 @@
<template> <template>
<view class="scraping-happy" id="container"> <view class="scraping-happy" id="container">
<canvas canvas-id="scraping-happy" class="scraping__canvas" :disable-scroll="true" @touchstart="touchstart" <canvas
@touchmove="touchmove" @touchend="touchend" /> canvas-id="scraping-happy"
class="scraping__canvas"
:disable-scroll="true"
@touchstart="touchstart"
@touchmove="touchmove"
@touchend="touchend"
/>
<cover-view class="scraping__view"> <cover-view class="scraping__view">
{{ showText }} {{ showText }}
</cover-view> </cover-view>
<slot></slot>
</view> </view>
</template> </template>
<script> <script>
/** @name 水印配置默认值 **/ /** @name 水印配置默认值 **/
const WATERMARK = { const WATERMARK = {
text: '刮一刮', text: '刮一刮',
fontSize: 14, fontSize: 14,
color: '#C5C5C5', color: '#C5C5C5',
} }
/** @name 标题配置默认值 **/ /** @name 标题配置默认值 **/
const TITLE = { const TITLE = {
text: '刮一刮', text: '刮一刮',
fontSize: 16, fontSize: 16,
color: '#333', color: '#333',
} }
/** /**
* @name 涂层配置默认值 * @name 涂层配置默认值
* @property { string } color 涂层颜色 * @property { string } color 涂层颜色
* @property { number } drawSize 清除涂层的画笔大小 * @property { number } drawSize 清除涂层的画笔大小
*/ */
const MASK = { const MASK = {
color: '#DDDDDD', color: '#DDDDDD',
drawSize: 20, drawSize: 20,
} }
/** @name 容错值,解决部分机型涂层没有覆盖满的情况,主要原因是由于像素尺寸不同导致的,应尽可能让width与height保持整数 **/ /** @name 容错值,解决部分机型涂层没有覆盖满的情况,主要原因是由于像素尺寸不同导致的,应尽可能让width与height保持整数 **/
const TOLERANT = 3; const TOLERANT = 3;
let ctx = null; let ctx = null;
export default { export default {
props: { props: {
/** @name 涂层设置 **/ /** @name 涂层设置 **/
mask: { mask: {
type: [String, Object], type: [String, Object],
}, },
/** @name 水印设置 **/ /** @name 水印设置 **/
watermark: { watermark: {
type: [String, Object], type: [String, Object],
}, },
/** @name 提示文字 **/ /** @name 提示文字 **/
title: { title: {
type: [String, Object], type: [String, Object],
}, },
/** @name 刮开百分之多少直接消除图层,为0的时候不消除 **/ /** @name 刮开百分之多少直接消除图层,为0的时候不消除 **/
percentage: { percentage: {
type: Number, type: Number,
default: 40, default: 60,
},
result: {
type: String,
default: ''
}
}, },
data() { result: {
type: String,
default: ''
}
},
data() {
return {
width: 0,
height: 0,
touchX: 0,
touchY: 0,
showText: ''
}
},
computed: {
maskSetting() {
return { return {
width: 0, ...MASK,
height: 0, ...(typeof this.mask === 'object' ? this.mask : { text: this.mask }),
touchX: 0,
touchY: 0,
showText: ''
} }
}, },
computed: { watermarkSetting() {
maskSetting() { return {
return { ...WATERMARK,
...MASK, ...(typeof this.watermark === 'object' ? this.watermark : { text: this.watermark }),
...(typeof this.mask === 'object' ? this.mask : { };
text: this.mask },
}), titleSetting() {
return {
...TITLE,
...(typeof this.title === 'object' ? this.title : { text: this.title }),
};
}
},
mounted() {
//
ctx = uni.createCanvasContext('scraping-happy', this);
this.init();
},
methods: {
/** @name 初始化 **/
init() {
const query = uni.createSelectorQuery().in(this);
query
.select('#container')
.boundingClientRect(({ width, height }) => {
this.width = width;
this.height = height;
setTimeout(() => {
this.initCanvas();
this.showText = this.result
}, 20)
})
.exec();
},
/** @name 初始化canvas状态 **/
initCanvas() {
const { width, height } = this;
//
ctx.clearRect(0, 0, width, height);
//
ctx.setFillStyle(this.maskSetting.color);
//
ctx.fillRect(0, 0, width, height + TOLERANT);
//
this.drawWatermark();
//
this.drawTitle();
// canvas
ctx.draw();
},
/** @name 绘制水印 **/
drawWatermark() {
if (!this.watermarkSetting.text) return;
//
ctx.save();
//
ctx.rotate((-10 * Math.PI) / 180);
//
const { width, height } = this;
const watermarkWidth = this.watermarkSetting.text.length * this.watermarkSetting.fontSize;
let x = 0;
let y = 0;
let i = 0;
while ((x <= width * 5 || y <= height * 5) && i < 300) {
ctx.setFillStyle(this.watermarkSetting.color);
ctx.setFontSize(this.watermarkSetting.fontSize);
ctx.fillText(this.watermarkSetting.text, x, y);
x += watermarkWidth + watermarkWidth * 1.6;
if (x > width && y <= height) {
x = -Math.random() * 100;
y += this.watermarkSetting.fontSize * 3;
} }
}, i++;
watermarkSetting() {
return {
...WATERMARK,
...(typeof this.watermark === 'object' ? this.watermark : {
text: this.watermark
}),
};
},
titleSetting() {
return {
...TITLE,
...(typeof this.title === 'object' ? this.title : {
text: this.title
}),
};
} }
ctx.restore();
}, },
mounted() { /** @name 绘制提示文字 **/
// drawTitle() {
ctx = uni.createCanvasContext('scraping-happy', this); if (!this.titleSetting.text) return;
this.init(); ctx.setTextAlign('center');
ctx.setTextBaseline('middle');
ctx.setFillStyle(this.titleSetting.color);
ctx.setFontSize(this.titleSetting.fontSize);
ctx.fillText(this.titleSetting.text, this.width / 2, this.height / 3);
}, },
methods: { /** @name 触摸事件 **/
/** @name 初始化 **/ touchstart(e) {
init() { this.touchX = e.touches[0].x;
const query = uni.createSelectorQuery().in(this); this.touchY = e.touches[0].y;
query },
.select('#container') async touchmove(e) {
.boundingClientRect(({ //
width, ctx.moveTo(this.touchX, this.touchY);
height //
}) => { ctx.clearRect(this.touchX, this.touchY, this.maskSetting.drawSize, this.maskSetting.drawSize);
this.width = width; ctx.draw(true);
this.height = height; //
setTimeout(() => { this.touchX = e.touches[0].x;
this.initCanvas(); this.touchY = e.touches[0].y;
this.showText = this.result
}, 20)
})
.exec();
},
/** @name 初始化canvas状态 **/
initCanvas() {
const {
width,
height
} = this;
//
ctx.clearRect(0, 0, width, height);
//
ctx.setFillStyle(this.maskSetting.color);
//
ctx.fillRect(0, 0, width, height + TOLERANT);
//
this.drawWatermark();
//
this.drawTitle();
// canvas
ctx.draw();
},
/** @name 绘制水印 **/
drawWatermark() {
if (!this.watermarkSetting.text) return;
//
ctx.save();
//
ctx.rotate((-10 * Math.PI) / 180);
//
const {
width,
height
} = this;
const watermarkWidth = this.watermarkSetting.text.length * this.watermarkSetting.fontSize;
let x = 0;
let y = 0;
let i = 0;
while ((x <= width * 5 || y <= height * 5) && i < 300) {
ctx.setFillStyle(this.watermarkSetting.color);
ctx.setFontSize(this.watermarkSetting.fontSize);
ctx.fillText(this.watermarkSetting.text, x, y);
x += watermarkWidth + watermarkWidth * 1.6;
if (x > width && y <= height) {
x = -Math.random() * 100;
y += this.watermarkSetting.fontSize * 3;
}
i++;
}
ctx.restore();
},
/** @name 绘制提示文字 **/
drawTitle() {
if (!this.titleSetting.text) return;
ctx.setTextAlign('center');
ctx.setTextBaseline('middle');
ctx.setFillStyle(this.titleSetting.color);
ctx.setFontSize(this.titleSetting.fontSize);
ctx.fillText(this.titleSetting.text, this.width / 2, this.height / 3);
},
/** @name 触摸事件 **/
touchstart(e) {
this.touchX = e.touches[0].x;
this.touchY = e.touches[0].y;
},
async touchmove(e) {
//
ctx.moveTo(this.touchX, this.touchY);
//
ctx.clearRect(this.touchX, this.touchY, this.maskSetting.drawSize, this.maskSetting.drawSize);
ctx.draw(true);
//
this.touchX = e.touches[0].x;
this.touchY = e.touches[0].y;
// if (this.percentage > 0) { // if (this.percentage > 0) {
// const clearPercent = await this.getClearMaskPercent(); // const clearPercent = await this.getClearMaskPercent();
// } // }
}, },
async touchend() { async touchend() {
if (this.percentage > 0) { if (this.percentage > 0) {
const clearPercent = await this.getClearMaskPercent(); const clearPercent = await this.getClearMaskPercent();
if (clearPercent >= this.percentage) { if (clearPercent >= this.percentage) {
ctx.moveTo(0, 0); ctx.moveTo(0, 0);
ctx.clearRect(0, 0, this.width, this.height); ctx.clearRect(0, 0, this.width, this.height);
ctx.stroke(); ctx.stroke();
ctx.draw(true); ctx.draw(true);
this.$emit('complete')
}
} }
},
/** @name 计算被清除的涂层百分比 **/
getClearMaskPercent() {
return new Promise(resolve => {
uni.canvasGetImageData({
canvasId: 'scraping-happy',
x: 0,
y: 0,
width: this.width,
height: this.height,
success: res => {
// "4" rgba
const allPointPixels = res.data;
// -
const clearPoint = [];
//
for (let i = 0; i < allPointPixels.length; i += 4) {
if (allPointPixels[i + 3] < 128) {
clearPoint.push(allPointPixels[i + 3]);
}
}
// = /
const percent = (
(clearPoint.length / (allPointPixels.length / 4)) *
100
).toFixed(2);
resolve(percent);
},
fail: e => {
console.log('canvasGetImageData', e);
},
}, this);
});
},
/** @name 重置 **/
reset() {
this.initCanvas();
this.touchX = 0;
this.touchY = 0;
} }
},
/** @name 计算被清除的涂层百分比 **/
getClearMaskPercent() {
return new Promise(resolve => {
uni.canvasGetImageData({
canvasId: 'scraping-happy',
x: 0,
y: 0,
width: this.width,
height: this.height,
success: res => {
// "4" rgba
const allPointPixels = res.data;
// -
const clearPoint = [];
//
for (let i = 0; i < allPointPixels.length; i += 4) {
if (allPointPixels[i + 3] < 128) {
clearPoint.push(allPointPixels[i + 3]);
}
}
// = /
const percent = (
(clearPoint.length / (allPointPixels.length / 4)) *
100
).toFixed(2);
resolve(percent);
},
fail: e => {
console.log('canvasGetImageData', e);
},
}, this);
});
},
/** @name 重置 **/
reset() {
this.initCanvas();
this.touchX = 0;
this.touchY = 0;
} }
}; }
};
</script> </script>
<style> <style>
.scraping-happy { .scraping-happy {
width: 100%; width: 100%;
height: 200rpx; height: 200rpx;
position: relative; position: relative;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.scraping__canvas {
.scraping__canvas { width: 100%;
width: 100%; height: 100%;
height: 100%; position: absolute;
position: absolute; z-index: 10;
z-index: 10; /* background-color: red; */
/* background-color: red; */ display: inline-block;
display: inline-block; }
} .scraping__view {
position: absolute;
.scraping__view { z-index: 1;
position: absolute; color: #f29100;
z-index: 1; font-size: 20px;
color: #f29100; font-weight: bold;
font-size: 20px; }
font-weight: bold; </style>
letter-spacing: 8px;
}
</style>

@ -1,153 +1,137 @@
<template> <template>
<view> <view>
<view v-if="getLoading" class="wp100 relative" style="height: 100vh;"> <view v-if="getLoading" class="wp100 relative" style="height: 100vh;">
<image class="wp100" mode="widthFix" <image class="wp100" mode="widthFix" src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/%E8%80%83%E8%AF%95%E6%8F%90%E9%86%92_20230906135037.png"></image>
src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/%E8%80%83%E8%AF%95%E6%8F%90%E9%86%92_20230906135037.png"> <view class="wp100 flex ai-c jc-c" style="position: absolute;bottom: 0;left: 0;padding-bottom: 124rpx;">
</image> <image style="width: 452rpx;" src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/%E9%87%91%E6%AD%A6%E8%81%94_20230831123333.png" mode="widthFix"></image>
<view class="wp100 flex ai-c jc-c" style="position: absolute;bottom: 0;left: 0;padding-bottom: 124rpx;"> </view>
<image style="width: 452rpx;" </view>
src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/%E9%87%91%E6%AD%A6%E8%81%94_20230831123333.png" <view v-if="!getLoading">
mode="widthFix"></image> <j-navbar :isBack="false">金武联驾考</j-navbar>
<u-sticky bgColor="#fff">
<u-tabs :list="categoryList" :current="curTab" :scrollable="false" @change="changeCategory"></u-tabs>
</u-sticky>
<view class="m10tb">
<u-swiper :list="activityList" @click="handleToActivity"></u-swiper>
</view> </view>
</view> <view style="background-color: rgb(245, 245, 245);">
<view v-if="!getLoading"> <template v-if="subject=='1' || subject=='4'">
<!-- <j-navbar :isBack="false">金武联驾考</j-navbar> --> <Subject1 :subject="subject" :rightList="rightList" :wrongList="wrongList" />
<u-sticky bgColor="#fff"> </template>
<u-tabs :list="categoryList" :current="curTab" :scrollable="false" @change="changeCategory"></u-tabs> <template v-else>
</u-sticky> <Subject2 :subject="subject" ref="subjectRef" />
<view class="m10tb" v-if="activityList&&activityList.length"> </template>
<u-swiper class="acticity" keyName="image" :list="activityList" @click="handleToActivity"></u-swiper> </view>
</view> </view>
<view style="background-color: rgb(245, 245, 245);"> </view>
<template v-if="subject=='1' || subject=='4'">
<Subject1 :subject="subject" :rightList="rightList" :wrongList="wrongList" />
</template>
<template v-else>
<Subject2 :subject="subject" ref="subjectRef" />
</template>
</view>
</view>
</view>
</template> </template>
<script> <script>
import { import {
mapState, mapState,
mapActions mapActions
} from 'pinia' // } from 'pinia' //
import useQuestionStore from '@/jtools/store/question' //store import useQuestionStore from '@/jtools/store/question' //store
import useUserStore from '@/jtools/store/user' import storage from '@/jtools/storage';
import storage from '@/jtools/storage'; import {
import { querySysConfigList,
querySysConfigList, } from '@/jtools/api/question';
} from '@/jtools/api/question'; import Subject1 from "./components/Subject1";
import Subject1 from "./components/Subject1"; import Subject2 from "./components/Subject2";
import Subject2 from "./components/Subject2"; export default {
import { components: {
queryActivityList Subject1,
} from '@/jtools/api/activity'; Subject2
export default { },
components: { data() {
Subject1, return {
Subject2 show:false,
}, subject: storage.get('curSubject') || '1',
data() { curTab: 0,
return { searchValue: '',
getLoading: true, cityName: '',
show: false, categoryList: [],
subject: storage.get('curSubject') || '1', rightList: storage.get(`rightList_subject${this.subject}`) || [],
curTab: 0, wrongList: storage.get(`wrongList_subject${this.subject}`) || [],
searchValue: '', activityList: ['https://cdn.uviewui.com/uview/swiper/swiper1.png']
cityName: '', };
categoryList: [], },
rightList: storage.get(`rightList_subject${this.subject}`) || [], onShow() {
wrongList: storage.get(`wrongList_subject${this.subject}`) || [], this.show=true
activityList: [] this.getSubjectConfig()
}; if (this.subject == '1' || this.subject == '4') {
}, this.rightList = storage.get(`rightList_subject${this.subject}`) || []
onShow() { this.wrongList = storage.get(`wrongList_subject${this.subject}`) || []
setTimeout(() => { }
this.getLoading = false if(this.subject=='2'||this.subject=='3'){
this.show = true this.$refs.subjectRef.getDiverType()
}, 100); }
this.getSubjectConfig() },
if (this.subject == '1' || this.subject == '4') { onHide(){
this.rightList = storage.get(`rightList_subject${this.subject}`) || [] this.show=false
this.wrongList = storage.get(`wrongList_subject${this.subject}`) || [] },
} computed: {
if (this.subject == '2' || this.subject == '3') { ...mapState(useQuestionStore, ["loading_subject4", "loading_subject1","curSubject","orderQuestion_subject1","orderQuestion_subject4"]), //tagslist
this.$refs.subjectRef.getDiverType() getLoading() {
} return this.loading_subject4 && this.loading_subject1
this.queryActivityList() }
}, },
onHide() { watch:{
this.show = false getLoading(newVal){
}, if(this.show){
computed: { if(newVal){
...mapState(useQuestionStore, ["loading_subject4", "loading_subject1", "curSubject", "orderQuestion_subject1", if(this.loading_subject4 && this.loading_subject1){
"orderQuestion_subject4" uni.hideTabBar();
]), //tagslist }
}, }else{
methods: { uni.showTabBar()
...mapActions(useQuestionStore, ['getOrderQuestion_sub4', 'getOrderQuestion_sub1', 'changeSubject']), }
// }
getSubjectConfig() { }
const carTypeId = storage.get('carType') || '1001' },
querySysConfigList(carTypeId, 'Subject').then(resp => { methods: {
if (resp.code === '0000') { ...mapActions(useQuestionStore, ['getOrderQuestion_sub4', 'getOrderQuestion_sub1', 'changeSubject']),
this.categoryList = resp.data.map(item => { //
return { getSubjectConfig() {
...item, const carTypeId = storage.get('carType') || '1001'
name: item.configItemName querySysConfigList(carTypeId, 'Subject').then(resp => {
} if (resp.code === '0000') {
}) this.categoryList = resp.data.map(item => {
this.subject = storage.get('curSubject') || '1', return {
this.curTab = this.categoryList.findIndex(item => item.configItemCode == this.subject) || 0 ...item,
} name: item.configItemName
}) }
}, })
// this.subject=storage.get('curSubject') || '1',
async changeCategory(val) { this.curTab=this.categoryList.findIndex(item=>item.configItemCode==this.subject)
this.subject = val.configItemCode }
this.changeSubject(this.subject) })
if (this.subject == '1' || this.subject == '4') { },
this.rightList = storage.get(`rightList_subject${this.subject}`) || [] //
this.wrongList = storage.get(`wrongList_subject${this.subject}`) || [] async changeCategory(val) {
} else { this.subject = val.configItemCode
setTimeout(() => { this.changeSubject(this.subject)
this.$refs.subjectRef.getDiverType() if (this.subject == '1' || this.subject == '4') {
}, 100) this.rightList = storage.get(`rightList_subject${this.subject}`) || []
} this.wrongList = storage.get(`wrongList_subject${this.subject}`) || []
}, } else {
// setTimeout(() => {
queryActivityList() { this.$refs.subjectRef.getDiverType()
queryActivityList({ }, 100)
schoolId: useUserStore().userInfo?.schoolId || '' }
}).then(resp => { },
this.activityList = resp.data.map(item => ({
...item,
image: 'https://jwl.ahduima.com' + item.image
}));
})
},
// //
handleToActivity(index) { handleToActivity(index) {
let detailId;
this.activityList.find((item, index1) => {
if (index === index1) {
detailId = item.detailId;
}
})
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/activity?detailId=' + detailId, url: '/pages/index/activity'
}) })
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .u-tabs__wrapper__nav__line { ::v-deep .u-tabs__wrapper__nav__line {
background: linear-gradient(90deg, #11DF20 0%, #00B74F 100%) !important; background: linear-gradient(90deg, #11DF20 0%, #00B74F 100%) !important;
bottom: 14rpx !important; bottom: 14rpx !important;
} }
</style> </style>

@ -7,11 +7,11 @@
<view class="list"> <view class="list">
<view class="list-call"> <view class="list-call">
<u-input class="sl-input" border="none" v-model="loginForm.phone" type="number" maxlength="11" <u-input class="sl-input" border="none" v-model="login.phone" type="number" maxlength="11"
placeholder="输入手机号" /> placeholder="输入手机号" />
</view> </view>
<view class="list-call"> <view class="list-call">
<u-input class="sl-input" v-model="loginForm.code" type="text" maxlength="6" border="none" placeholder="输入验证码"> <u-input class="sl-input" v-model="login.code" type="text" maxlength="6" border="none" placeholder="输入验证码">
<template #suffix> <template #suffix>
<text class="fs14 mr10" style="color: #05C341;" @tap="getCode">{{ countDown == 0 ? '获取验证码' : countDown }}</text> <text class="fs14 mr10" style="color: #05C341;" @tap="getCode">{{ countDown == 0 ? '获取验证码' : countDown }}</text>
</template> </template>
@ -39,7 +39,7 @@ import storage from '@/jtools/storage';
export default { export default {
data() { data() {
return { return {
loginForm: { login: {
phone: '', phone: '',
code: '' code: ''
}, },
@ -54,9 +54,9 @@ export default {
}, },
methods: { methods: {
getCode() { getCode() {
if (isPhone(this.loginForm.phone) && this.countDown == 0) { if (isPhone(this.login.phone) && this.countDown == 0) {
getCode({ getCode({
phone: this.loginForm.phone phone: this.login.phone
}).then(resp => { }).then(resp => {
// if (resp.code == '0000') { // if (resp.code == '0000') {
uni.showToast({ uni.showToast({
@ -80,8 +80,8 @@ export default {
this.countDown = 0 this.countDown = 0
}, },
bindLogin() { bindLogin() {
if (isPhone(this.loginForm.phone) && this.loginForm.code) { if (isPhone(this.login.phone) && this.login.code) {
let params = { ...this.loginForm } let params = { ...this.login }
if (storage.get('companyId')) { if (storage.get('companyId')) {
params.id = storage.get('companyId') params.id = storage.get('companyId')
} }

@ -1,254 +0,0 @@
<template>
<view style="padding-bottom: 50px;background-color: #C5121B;">
<image class="wp100 img" mode="widthFix"
src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/%E5%8A%A9%E5%8A%9B%E4%B8%BB%E5%9B%BE.jpg">
</image>
<view class="relative tip">邀请好友帮助你进行助力即可有机会领取奖品</view>
<view class="relative help_div">
<!-- -->
<view v-if="type == 1" class="relative help_card">
<view class="relative help_tip">
还差{{diffNum}}位好友助力即可领取奖品:
</view>
<view v-if="winnerInfo.awards != undefined" class="relative help_tip" style="font-size: 40rpx;">
{{winnerInfo.awards}}
</view>
<view class="p20">
<u-grid :border="false" col="3">
<u-grid-item v-for="(item, index) in helpUserList" :key="index">
<u-avatar v-if="item.id" class="p10tb border" size="120rpx" :src="item.avatarUrl"></u-avatar>
<view v-else class="p10tb">
<view class="avatar-text">
<u-avatar bg-color="#fff" color="#ccc" size="120rpx" text="邀"></u-avatar>
</view>
</view>
</u-grid-item>
</u-grid>
</view>
<view class="help_btn">
<button open-type="share" class="help_btn_font"> 邀请好友助力</button>
</view>
</view>
<view v-if="type == 2" class="relative help_card">
<view class="relative help_list" style="top: 200rpx;">
<view v-if="winnerInfo?.activityName" class="help_tip"
style="font-size: 40rpx; margin: 25rpx 0rpx;">
{{winnerInfo?.activityName}}
</view>
<view v-if="winnerInfo.schoolName != undefined" class="help_tip">
举办单位{{winnerInfo.schoolName}}
</view>
<view v-if="winnerInfo.awards != undefined" class="help_tip" style="font-size: 45rpx;margin: 25rpx 0rpx;">
奖品{{winnerInfo.awards}}
</view>
</view>
<view class="help_btn">
<button class="help_btn_font" open-type="chooseAvatar" @chooseavatar="handleHelp"
:disabled="disBtn">帮好友助力</button>
</view>
</view>
</view>
</view>
</template>
<script>
import useUserStore from '@/jtools/store/user'
import {
queryActivityDetail,
queryHelpInfo,
saveHelpInfo,
queryWinnerInfo
} from '@/jtools/api/activity'
export default {
data() {
return {
winnerId: undefined,
helpUserList: [],
drawNum: 0,
phone: undefined,
type: 2,
winnerInfo: undefined,
disBtn: false
}
},
onLoad(op) {
this.winnerId = op.id
// this.type = op.type ? Number(op.type) : 1
this.phone = useUserStore().userInfo?.phone || undefined
console.log(this.phone)
this.getWinnerInfo()
this.getHelpInfo()
this.disBtn = false
},
onShareAppMessage(res) {
if (res.from === 'button') { //
console.log(res.target)
}
return {
title: '我正在参与领奖活动柜,请帮我助力',
path: '/pages/me/help?id=' + this.winnerId + '&type=2'
}
},
methods: {
//
getWinnerInfo() {
queryWinnerInfo({
winnerId: this.winnerId
}).then(resp => {
if (resp.code == 200) {
console.log(resp)
this.winnerInfo = resp.data;
if (this.phone && this.winnerInfo.phone == this.phone) {
this.type = 1
} else {
this.type = 2
}
}
})
},
//
getHelpInfo() {
queryHelpInfo({
winnerId: this.winnerId
}).then(resp => {
if (resp.code == 200) {
this.drawNum = resp.data.helpNum;
const list = resp.data.helpUsers.map(item => ({
...item,
avatarUrl: 'https://jwl.ahduima.com' + item.avatarUrl
}));
this.diffNum = (this.drawNum - list.length) < 0 ? 0 : (this.drawNum - list.length);
const arr = new Array(this.diffNum).fill({})
this.helpUserList = [...list,...arr]
}
})
},
//
handleHelp(e) {
this.disBtn = false
uni.login({
provider: 'weixin', //使
success: (loginRes) => {
console.log(loginRes);
uni.uploadFile({
url: 'https://jwl.ahduima.com/activity/applet/activity/help/save',
// url: 'http://192.168.1.6:8089/applet/activity/help/save',
filePath: e.detail.avatarUrl,
name: 'file',
formData: {
'code': loginRes.code,
'winnerId': this.winnerId,
},
success: (uploadFileRes) => {
console.log(uploadFileRes.data);
let resp = JSON.parse(uploadFileRes.data);
console.log(resp);
if (resp.code == 200) {
uni.showToast({
icon: 'none',
title: `助力成功`
})
this.disBtn = true
} else {
uni.showToast({
icon: 'error',
title: resp.msg
})
this.disBtn = true
}
}
});
}
});
},
},
}
</script>
<style scoped lang="scss">
.img {
top: -130rpx !important;
}
.tip {
height: 75px;
font-family: PingFang SC;
font-weight: 400;
color: #FEFEFE;
line-height: 48px;
top: -520rpx;
text-align: center;
font-size: 35rpx;
}
.avatar-text {
border-radius: 50%;
border: 1px dashed #ccc;
}
.help_div {
width: 710rpx;
height: 996rpx;
top: -560rpx;
margin-left: 20rpx;
margin-right: 20rpx;
background: linear-gradient(0deg, #F33D2F 100%, rgba(197, 18, 27, 0.01) 0%);
border-radius: 40rpx;
.help_card {
width: 630rpx;
height: 886rpx;
margin: 0rpx 39rpx;
top: 55rpx;
background: #FFFFFF;
border-radius: 24rpx;
.help_tip {
text-align: center;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #010101;
line-height: 55rpx;
top: 15rpx;
}
.help_list {
margin: 68rpx 25rpx 25rpx 20rpx;
height: 580rpx;
}
.help_btn {
text-align: center;
margin: 0 75rpx;
margin-bottom: 30rpx;
width: 500rpx;
height: 86rpx;
background: linear-gradient(0deg, #DE4224 0%, #B81706 100%);
border-radius: 43rpx;
.help_btn_font {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #FFFFFF;
line-height: 86rpx;
background: center;
}
}
}
}
</style>

@ -12,9 +12,6 @@
</view> </view>
<view class="mt5 fs14 cor-666">陪您学车 {{ user.days }}</view> <view class="mt5 fs14 cor-666">陪您学车 {{ user.days }}</view>
</view> </view>
<view v-if="canRecieve" class="ml20 p20" @tap="handleScan">
<u-icon name="scan" size="40"></u-icon>
</view>
</view> </view>
<view class="info flex ai-c" v-else @tap="toLogin"> <view class="info flex ai-c" v-else @tap="toLogin">
<u-avatar class="br-p50 overflow-h" :size="64" src="@/static/image/mine/default_avatar.png" shape="circle"></u-avatar> <u-avatar class="br-p50 overflow-h" :size="64" src="@/static/image/mine/default_avatar.png" shape="circle"></u-avatar>
@ -110,8 +107,8 @@
<script> <script>
import useUserStore from '@/jtools/store/user' import useUserStore from '@/jtools/store/user'
import storage from '@/jtools/storage'; import storage from '@/jtools/storage';
import { receiveWinner,canRecieveGift } from '@/jtools/api/activity'
export default { export default {
components: {},
computed: { computed: {
isLogin() { isLogin() {
return useUserStore().isLogin return useUserStore().isLogin
@ -151,25 +148,14 @@ export default {
data() { data() {
return { return {
carName: storage.get('carName') || '小车C1/C2/C3', carName: storage.get('carName') || '小车C1/C2/C3',
isIOS: true, isIOS: true
canRecieve: false
} }
}, },
onShow() { onShow() {
this.isIOS = this.$platform.device().includes('ios') this.isIOS = this.$platform.device().includes('ios')
this.carName = storage.get('carName') || '小车C1/C2/C3' this.carName = storage.get('carName') || '小车C1/C2/C3'
this.searchActivityAuth()
}, },
methods: { methods: {
searchActivityAuth() {
canRecieveGift({
phone: useUserStore().userInfo?.phone || ''
}).then(resp => {
if(resp.code == 200) {
this.canRecieve = resp.data
}
})
},
// //
callPhoneNumber() { callPhoneNumber() {
uni.makePhoneCall({ uni.makePhoneCall({
@ -247,25 +233,6 @@ export default {
uni.navigateTo({ uni.navigateTo({
url: '/pages/me/myGift' url: '/pages/me/myGift'
}) })
},
handleScan() {
uni.scanCode({
scanType: ['qrCode'],
success(res) {
console.log('条码内容:' + res.result);
receiveWinner({
id: res.result,
receiveUser: useUserStore().userInfo?.phone || []
}).then(resp => {
if(resp.code == 200) {
uni.showToast({
icon: 'none',
title: '核销成功!'
})
}
})
}
})
} }
} }
} }

@ -1,73 +1,44 @@
<template> <template>
<view class="p10lr p20tb"> <view class="p10lr p20tb">
<u-list @scrolltolower="loadmore"> <view v-for="(item, index) in list" :key="index" class="item">
<u-list-item v-for="(item, index) in list" :key="index" class="item"> <view class="relative">
<view class="relative"> <img src="/static/image/mine/giftitem.png" style="width: 100%;" mode="widthFix" alt="" />
<img src="/static/image/mine/giftitem.png" style="width: 100%;" mode="widthFix" alt="" /> <view class="ab_full df ai-c jcc">一等奖</view>
<view class="ab_full df ai-c jcc">{{item.awards}}</view> </view>
<view class="df ai-c jcsb p20tb p10lr">
<view class="item-label">
<view>活动名称幸运刮刮乐开心赢大奖</view>
<view>参与时间2024-01-01 08:00</view>
<view>有效期至2024-03-01 08:00</view>
</view> </view>
<view class="df ai-c jcsb p20tb p10lr"> <view class="ml20" style="width: 120rpx;">
<view class="item-label"> <img v-if="index%2==0" src="/static/image/mine/writeoff.png" style="width: 120rpx;height: 120rpx;" />
<view>活动名称{{ item.activityName }}</view> <view v-else class="btn" @tap="handleWriteoff(item)">核销</view>
<view>参与时间{{ item.createTime }}</view>
<view>有效期至{{ item.endTime }}</view>
</view>
<view class="ml20" style="width: 120rpx;">
<view v-if="item.status == 0" class="btn" @tap="handleHelp(item)">助力</view>
<view v-else-if="item.status == 1" class="btn" @tap="handleWriteoff(item)">核销</view>
<img v-else-if="item.status == 2" src="/static/image/mine/writeoff.png" style="width: 120rpx;height: 120rpx;" />
<img v-else src="/static/image/mine/outtime.png" style="width: 120rpx;height: 120rpx;" />
</view>
</view> </view>
</u-list-item> </view>
</u-list> </view>
</view> </view>
</template> </template>
<script> <script>
import useUserStore from '@/jtools/store/user'
import { getLuckyRecord } from '@/jtools/api/activity'
export default { export default {
data() { data() {
return { return {
pageNum: 1,
list: [] list: []
} }
}, },
onShow() { onShow() {
this.pageNum = 1
this.list = []
this.handleSearch() this.handleSearch()
}, },
methods: { methods: {
handleSearch() { handleSearch() {
getLuckyRecord({ this.list = [1,2,3,4,5]
phone: useUserStore().userInfo.phone,
pageSize: 10,
pageNum: this.pageNum
}).then(resp => {
if(resp.code == 200) {
if(resp.rows && resp.rows.length) {
this.list = [...this.list, ...resp.rows]
} else {
this.pageNum = this.pageNum > 1 ? this.pageNum-1 : 1
}
}
})
},
loadmore() {
this.handleSearch(this.pageNum++)
}, },
handleWriteoff(item) { handleWriteoff(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/me/qrCode?id=${item.id}` url: `/pages/me/qrCode?item=${item}`
}) })
}, }
handleHelp(item){
uni.navigateTo({
url: `/pages/me/help?id=${item.id}`
})
}
} }
} }
</script> </script>

@ -1,6 +1,6 @@
<template> <template>
<view class="df jcc" style="padding-top: 100px;"> <view class="df jcc" style="padding-top: 100px;">
<qrcode v-if="value" :value="value" :size="200"/> <qrcode value="123" :size="200"/>
</view> </view>
</template> </template>
@ -16,8 +16,11 @@
} }
}, },
onLoad(option) { onLoad(option) {
this.value = option.id this.value = option.item
}, },
methods: {
}
} }
</script> </script>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Loading…
Cancel
Save