作者 郑喜程

junyao微信小程序#

正在显示 100 个修改的文件 包含 4127 行增加0 行删除

要显示太多修改。

为保证性能只显示 100 of 100+ 个文件。

{
"extends": "standard",
//插件
// "plugins": [
// "prettier"
// ],
//配置解析器
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
//插件
"plugins": ["prettier", "html"],
"settings": {
"html/html-extensions": [".wxml"]
},
"env": {
//脚本目标的运行环境
"node": true
},
//全局变量
"globals": {
"__DEV__": true,
"__WECHAT__": true,
"__ALIPAY__": true,
"App": true,
"Page": true,
"Component": true,
"Behavior": true,
"wx": true,
"getApp": true
},
//规则,只用插件:插件名/规则
"rules": {
"indent": ["error", "tab", { "SwitchCase": 1 }],
"no-console": 0,
"no-tabs": 0,
"quotes": [
2,
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"semi": [
2,
"never",
{
"beforeStatementContinuationChars": "never"
}
],
"no-delete-var": 2,
"space-before-function-paren": 0,
"prefer-const": [
2,
{
"ignoreReadBeforeAssign": false
}
]
}
}
... ...
# DIY
target/
# svn
.svn/
# Linux System
*~
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# Windows System
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
# OSX System
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# Eclipse
*.pydevproject
.metadata
.gradle
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
# Eclipse Core
.project
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# JDT-specific (Eclipse Java Development Tools)
.classpath
# Java annotation processor (APT)
.factorypath
# PDT-specific
.buildpath
# sbteclipse plugin
.target
# TeXlipse plugin
.texlipse
# JetBrains
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
*.iml
## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:
# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries
# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml
# Gradle:
# .idea/gradle.xml
# .idea/libraries
# Mongo Explorer plugin:
# .idea/mongoSettings.xml
## File-based project format:
*.ipr
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
# JAVA
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
#Maven
target/
**/target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
logs/
node_modules
project.private.config.json
\ No newline at end of file
... ...
/*
* @Autor: 李响
* @Date: 2022-08-11 13:45:55
* @LastEditors: 李响
* @LastEditTime: 2023-02-02 15:36:35
* @description:
*/
// .prettierrc.js
module.exports = {
printWidth: 220,
tabWidth: 2,
useTabs: true,
semi: false,
singleQuote: true,
// 对象的 key 仅在必要时用引号
quoteProps: 'as-needed',
// jsx 不使用单引号,而使用双引号
jsxSingleQuote: false,
// 末尾不需要逗号
trailingComma: 'none',
// 大括号内的首尾需要空格
bracketSpacing: true,
// jsx 标签的反尖括号需要换行
jsxBracketSameLine: false,
// 箭头函数,只有一个参数的时候,无需括号
arrowParens: 'avoid',
// 每个文件格式化的范围是文件的全部内容
rangeStart: 0,
rangeEnd: Infinity,
// 不需要写文件开头的 @prettier
requirePragma: false,
// 不需要自动在文件开头插入 @prettier
insertPragma: false,
// 使用默认的折行标准
proseWrap: 'preserve',
// 根据显示样式决定 html 要不要折行
htmlWhitespaceSensitivity: 'css',
// 换行符使用 lf
endOfLine: 'lf'
}
... ...
均瑶专属小程序
... ...
// app.js
import utils from './utils/util.js'
import api from './utils/api.js'
import config from './utils/config.js'
// import {init} from './utils/myPage'
const OssUploader = require('/utils/plugins/ossUpload.js')
let isGetCoupon = false
App({
onLaunch: function () {
// 登录
// 获取用户信息
// this.getSetting()
// init({})
// this.globalData.brandId = config.brandId
// console.log(this.globalData.brandId);
this.getSystemInfoSync()
// 获取nick
let nick = wx.getStorageSync('nick')
if(nick){
const {unionId,userId,wxappOpenId,wxappEcdOpenId,wxchatOpenId} = nick
wx.setStorageSync('subData', {
unionId,
userId,
openId:wxappOpenId ? wxappOpenId : wxappEcdOpenId ? wxappEcdOpenId : wxchatOpenId
})
}
// 可比克 字体
wx.loadFontFace({
family: 'PangMenZhengDao',
source: 'url("https://hbrand.oss-cn-hangzhou.aliyuncs.com/BUSINESS/SCAN/cpp/kebike/1635742999484228.ttf")',
global: true
})
if (wx.onNeedPrivacyAuthorization) {
wx.onNeedPrivacyAuthorization((resolve, eventInfo) => {
wx.removeStorageSync('nick')
utils.needLogin()
resolve({ event: 'exposureAuthorization' })
})
}
},
getCode() {
return new Promise((resolve, reject) => {
wx.login({
success: res => {
if (res.code) {
// 防止获取两次code
if (res.code !== this.globalData.code) {
wx.checkSession({
success: () => {
this.globalData.code = res.code
resolve(res.code)
},
fail: () => {
wx.login({
success: res => {
this.globalData.code = res.code
resolve(res.code)
}
})
}
})
}
}
}
})
})
},
getLocation(type = 'gcj02') {
const _this = this
return new Promise((resolve, reject) => {
wx.getFuzzyLocation({
type,
success(res) {
_this.globalData.locate = `${res.latitude},${res.longitude}`
resolve(res)
},
fail(res) {
wx.setStorageSync('isIndexClick', false)
wx.navigateTo({
url: '/pages/defaultError/defaultError?errorId=0&errorMsg=授权失败|我们需要您的位置信息来判断您能否参与活动, 请允许授权'
})
}
})
})
},
updateUserInfo(code, memberInfo) {
return this.Login(code, memberInfo)
},
async updateUserInfoScan(code, memberInfo) {
await this.getLocation()
return this.LoginScan(code, memberInfo)
},
getUserInfo() {
return new Promise((resolve, reject) => {
if (!wx.getUserProfile) {
resolve({})
return
}
wx.getUserProfile({
desc: '用于完善会员资料',
complete(res) {
resolve(res)
}
})
})
},
Login(code, { encryptedData = '', iv = '' }) {
const _this = this
const params = {
encryptedData,
iv,
code
}
return new Promise((resolve, reject) => {
this.api.updateUserInfo(params).then(res => {
const {unionId,userId,wxappOpenId,wxappEcdOpenId,wxchatOpenId} = res.data
wx.setStorageSync('nick', res.data)
wx.setStorageSync('subData', {
unionId,
userId,
openId:wxappOpenId ? wxappOpenId : wxappEcdOpenId ? wxappEcdOpenId : wxchatOpenId
})
if (res.status === 1) {
resolve(res.data)
_this.globalData.token = res.data.token
_this.globalData.userId = res.data.userId
}
})
})
},
LoginScan(code, { encryptedData = '', iv = '' }) {
const _this = this
const { locate } = _this.globalData
const params = {
encryptedData,
iv,
code,
locate
}
return new Promise((resolve, reject) => {
this.api.updateUserInfoScan(params).then(res => {
const {unionId,userId,wxappOpenId,wxappEcdOpenId,wxchatOpenId} = res.data
wx.setStorageSync('nick', res.data)
wx.setStorageSync('subData', {
unionId,
userId,
openId:wxappOpenId ? wxappOpenId : wxappEcdOpenId ? wxappEcdOpenId : wxchatOpenId
})
if (res.status === 1) {
resolve(res.data)
_this.globalData.token = res.data.token
}
})
})
},
getCoupon(locate, presentId, cb, linkId = '') {
if (isGetCoupon) {
wx.showToast({
title: '正在领取,请耐心等待',
icon: 'none'
})
return
} else {
isGetCoupon = true
}
this.api
.getCoupons({
locate: locate,
presentId: presentId,
linkId: linkId
})
.then(res => {
isGetCoupon = false
if (res.status === 1) {
setTimeout(() => {
wx.showToast({
title: `领取成功, 已领${wx.getStorageSync('couponForGetCount') + 1}张`,
icon: 'none',
duration: 3000
})
}, 1000)
} else {
}
if (cb) {
cb(res.data)
}
})
},
uploadFile(context, callBack, directory = 'fileData/') {
let filePath = context
if (typeof context === 'object') {
wx.showLoading({
title: context.msg
})
filePath = context.filePath
}
OssUploader(filePath, directory, res => {
wx.hideLoading()
callBack(res)
})
},
/**
* @param {*} path 链接
* @return {*}
* @author: swordman
* @description: 获取链接路径
* @example:
*/
GetUrlParh(path) {
//获取type
if (!path) {
return ''
}
// return path.split('n/')[1].split('?')[0]
const parts = path.split('/'); // 以 '/' 为分隔符拆分字符串
return parts[3].toLowerCase();
},
uploadFile(context, callBack, directory = 'fileData/') {
let filePath = context
if (typeof context === 'object') {
wx.showLoading({
title: context.msg
})
filePath = context.filePath
}
OssUploader(filePath, directory, res => {
wx.hideLoading()
callBack(res)
})
},
// 订阅消息
sendSubscribeMessage(tmplIds = [], cb) {
if (wx.requestSubscribeMessage) {
wx.requestSubscribeMessage({
tmplIds,
success(res) {},
fail(res) {},
complete(res) {
if (cb) {
cb(res)
}
}
})
} else {
if (cb) {
cb()
}
}
},
// 获取设备信息
getSystemInfoSync() {
try {
const res = wx.getSystemInfoSync()
console.log(res, '设备信息')
this.globalData.systemInfo = res
} catch (e) {}
},
getStatusBarHeight() {
return this.globalData.systemInfo?.statusBarHeight || 20
},
getTitleBarHeight() {
return this.globalData.systemInfo?.model.indexOf('iPhone') !== -1 ? 44 : 48
},
globalData: {
userInfo: null,
token: '',
isUserInfoScope: false,
isEnableLocation: 0,
distance: 0,
payAmount: 0,
storeName: '',
storeId: '',
locate: '',
weiyiUserIdentity: false, // 唯怡一码双扫用户身份判断,true:服务员,false:消费者
qrCode: '', // 唯怡一码双扫页面调用的二维码
brandId: '117', // 唯怡一码双扫使用内容117、测试196
groupId: '', // 唯怡一码双扫使用内容
summary: '', // 唯怡一码双扫使用内容
thirdPhone: '', // 唯怡一码双扫使用内容
simpleCode: '', // 唯怡一码双扫使用内容
isUserPhone: '', // 唯怡一码双扫使用内容,判断用户是否需要填写手机号
scopeCamera: '',
systemInfo: null
},
utils: utils,
api: api,
config: config
})
// eslint-disable-next-line no-extend-native
Date.prototype.pattern = function (fmt) {
// 日期处理
const o = {
'M+': this.getMonth() + 1, // 月份
'd+': this.getDate(), // 日
'h+': this.getHours() % 12 === 0 ? 12 : this.getHours() % 12, // 小时
'H+': this.getHours(), // 小时
'm+': this.getMinutes(), // 分
's+': this.getSeconds(), // 秒
'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
S: this.getMilliseconds() // 毫秒
}
const week = {
0: '\u65e5',
1: '\u4e00',
2: '\u4e8c',
3: '\u4e09',
4: '\u56db',
5: '\u4e94',
6: '\u516d'
}
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
}
if (/(E+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length > 1 ? (RegExp.$1.length > 2 ? '\u661f\u671f' : '\u5468') : '') + week[this.getDay() + ''])
}
for (const k in o) {
if (new RegExp('(' + k + ')').test(fmt)) {
fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length))
}
}
return fmt
}
... ...
{
"pages": [
"custom-pages/custom-index/index",
"pages/index/index",
"pages/couponPack/couponPack",
"pages/login/login",
"pages/defaultError/defaultError",
"pages/scan/index/index",
"custom-pages/custom-product/index",
"custom-pages/custom-scan/index",
"pages/clearCode/index",
"pages/webView/index"
],
"subPackages": [{
"root": "scanGroup",
"pages": ["index/index", "dahaoda/index/index", "dahaoda/record/index", "jyScan/index/index",
"jyScan/record/index"
]
},
{
"root": "middlePage",
"pages": [
"pages/privacyGps/privacyGps",
"pages/scanCode/scanCode",
"pages/scan/scan",
"pages/scanTest/scanTest",
"pages/rule/rule"
]
}
],
"entryPagePath": "custom-pages/custom-index/index",
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "味动力乳酸菌",
"navigationBarTextStyle": "black"
},
"tabBar": {
"custom": true,
"list": [{
"pagePath": "custom-pages/custom-index/index",
"text": "首页",
"iconPath": "/images/icon_index_act.png"
},
{
"pagePath": "custom-pages/custom-scan/index",
"text": "扫码"
},
{
"pagePath": "custom-pages/custom-product/index",
"text": "产品介绍"
}
]
},
"usingComponents": {
"mp-html": "mp-html",
"v-popup": "./components/v-popup/v-popup",
"mp-navigation-bar": "weui-miniprogram/navigation-bar/navigation-bar"
},
"requiredPrivateInfos": ["getFuzzyLocation"],
"permission": {
"scope.userFuzzyLocation": {
"desc": "你的位置信息将用于活动参与"
}
},
"plugins": {},
"useExtendedLib": {
"weui": true
},
"__usePrivacyCheck__": true,
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
... ...
/**app.wxss**/
button {
padding: 0;
margin: 0;
border: 0;
background: transparent;
line-height: auto;
border-radius: 0;
/* line-height: 1; */
}
button::after {
border: 0;
border-radius: 0;
width: 0;
height: 0;
}
.btn-scan {
margin-bottom: 34rpx !important;
margin-top: 61rpx !important;
}
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
... ...
// clearCode/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--clearCode/index.wxml-->
<text>clearCode/index.wxml</text>
... ...
/* clearCode/index.wxss */
\ No newline at end of file
... ...
// clearCode/index/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--clearCode/index/index.wxml-->
<text>clearCode/index/index.wxml</text>
... ...
/* clearCode/index/index.wxss */
\ No newline at end of file
... ...
Component({
/**
* 组件的属性列表
*/
properties: {
sildeBlockCont: { //接受父组件值
type: String
},
isVisibile:{ //控制组件
type:Boolean
}
},
/**
* 组件的初始数据
*/
data: {
slidebel:false,//滑动弹窗
    canfile_image:'',//裁剪图片
    canfile_index:'',//图片返回 1 至 3 之间的数
    canfile_x:'',//x返回 60 至 240 之间的数
    canfile_y:'',//y返回 0 至 50 之间的数
    slide_clientX:0,//移动位置
    slide_status:0,//0 停止操作   1 触发长按   2 正确   3 错误
originY:0, //y数据
trail:[], //数组
},
/**
* 组件的方法列表
*/
methods: {
// 弹窗
visidlisd(e){
this.setData({
  slidebel:!this.data.slidebel
})
if(this.data.slidebel){
  this.slide_tap()
}
},
// 画布
 slide_tap(e){
    var that = this
    that.setData({
      canfile_index:Math.round(Math.random() * 8 + 1),
      canfile_x:Math.round(Math.random() * 180 + 60),
      canfile_y:Math.round(Math.random() * 54),
      canfile_image:''
    })
    clearTimeout(that.data.timeoutID)
    that.data.timeoutID = setTimeout(function () {
      var context = wx.createCanvasContext('firstCanvas',that)
      context.width = 300
      context.height = 150
wx.downloadFile({
url: 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/BUSINESS/SCAN/bpp/sliderVerify/'+that.data.canfile_index+'.jpg',
success:function(res){
var imgUrl= res.tempFilePath;
context.drawImage(imgUrl,0,0,context.width,context.height)
context.draw(true,(()=>{
      wx.canvasToTempFilePath({
          x: that.data.canfile_x,
          y: that.data.canfile_y,
          width:50,
          height:50,
          canvasId: 'firstCanvas',
          success: function (res) {
// console.log(res);
            that.setData({
              canfile_image:res.tempFilePath
            })
          }
        },that);
}))
}
})
    },300)
},
// 滑动开始
slide_start(e){
this.setData({
 slide_status:1,
originY: e.clientY || e.touches[0].clientY
})
},
// 滑动中
slide_hmove(e){
var eventY = e.clientY || e.touches[0].clientY;
var moveY = eventY - this.data.originY;
var arr=[]
arr.push(Math.round(moveY))
this.setData({
slide_clientX:(e.touches[0].clientX - 60) < 1 ? 0 : (e.touches[0].clientX - 60),
})
this.data.trail.push(Math.round(moveY))
},
//滑动结束
slide_chend(e){
// console.log(JSON.stringify(this.data.trail));
// 滑动结束验证
this.triggerEvent("verify",JSON.stringify(this.data.trail))
var that = this
var cliextX;
if(that.data.slide_clientX < 1){
  that.data.slide_status = 0
return false
}
 if(that.data.slide_clientX > 240){
    cliextX = 240
 }else{
    cliextX = that.data.slide_clientX
 }
if(((that.data.canfile_x + 5) > cliextX) && ((that.data.canfile_x - 5) < cliextX)){
     that.setData({
       slide_status:2,
       slide_clientX:that.data.canfile_x,
     })
// 验证成功触发父组件函数
this.triggerEvent("success")
    that.setData({
    slidebel:false,
    })
 }else{
    that.setData({
      slide_status:3,
    })
// 验证失败出发父组件函数
this.triggerEvent("fail")
 }
 setTimeout(function () {
     that.setData({
       slide_status:0,
       slide_clientX:0,
    })
 },1500)
},
},
lifetimes: {
created() {
// 在组件实例刚刚被创建时执行
},
attached: function() {
// 在组件实例进入页面节点树时执行
},
ready() {
// 在组件在视图层布局完成后执行
// console.log(this.properties.sildeBlockCont);
},
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!-- 滑动验证弹窗 -->
<view class="slide_model" wx:if="{{slidebel}}">
<view>
<view class="canvas_img">
<canvas wx:if="{{!canfile_image}}" style="width: 300px; height: 104px;" canvas-id="firstCanvas" id="firstCanvas"></canvas>
<image wx:if="{{canfile_image}}" class="canvas_srinl" src='https://hbrand.oss-cn-hangzhou.aliyuncs.com/BUSINESS/SCAN/bpp/sliderVerify/{{canfile_index}}.jpg'></image>
<view class="canvas_view" style="left:{{canfile_x}}px;top:{{canfile_y}}px;"></view>
<image class="canfile_image" style="top:{{canfile_y}}px;left:{{slide_clientX > 250 ? 250 : slide_clientX}}px;" src="{{canfile_image}}"></image>
</view>
<!-- 滑块 -->
<view class="canvas_slide">
<view class="canvas_width" style="width:{{slide_clientX > 260?260:slide_clientX}}px;{{slide_status == 2?'background:#52CCBA;':''}}{{slide_status == 3?'background:#F57A7A;':''}}"></view>
<view class="canvas_kus" bindtouchstart="slide_start" bindtouchmove="slide_hmove" bindtouchend="slide_chend"
style="left:{{slide_clientX > 260?260:slide_clientX}}px;{{slide_status == 0?'color: #333;':''}}{{slide_status == 1?'background:#1991FA;':''}}{{slide_status == 2?'background:#52CCBA;':''}}{{slide_status == 3?'background:#F57A7A;':''}}">
<view wx:if="{{slide_status < 2}}" class="cuIcon-back_android"></view>
<view wx:if="{{slide_status == 2}}" class="cuIcon-check"></view>
<view wx:if="{{slide_status == 3}}" class="cuIcon-close"></view>
</view>
<view wx:if="{{slide_status == 0}}">拖动左边滑块完成上方拼图</view>
</view>
<!-- ------按钮------ -->
<view class="canvas_guil">
<!-- <view bindtap="visidlisd" class="cuIcon-roundclose">关闭</view> -->
<view bindtap="slide_tap" class="cuIcon-refresh">刷新</view>
</view>
</view>
</view>
... ...
/* components/SliderVerify/SliderVerify.wxss */
/* 滑动验证 */
.slide_model {
width: 100%;
height: 100vh;
z-index: 10;
position: fixed;
left: 0;
top: 0;
background: rgba(0, 0, 0, 0.4);
display: flex;
align-items: center;
justify-content: center;
}
.slide_model>view {
float: left;
z-index: 1;
position: relative;
width: calc(300px + 60rpx);
background-color: rgb(255, 255, 255);
border-radius: 8px
}
.canvas_img {
width: 300px;
height: 150px;
position: relative;
background-color: rgb(255, 255, 255);
float: left;
margin: 30rpx 30rpx 0;
}
.canvas_view {
width: 50px;
height: 50px;
position: absolute;
background: #fff;
z-index: 2;
}
.canfile_image {
width: 50px;
height: 50px;
position: absolute;
left: 0;
z-index: 3;
box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.2);
}
.canvas_kus {
width: 40px;
height: 40px;
background-color: #fff;
font-size: 36rpx;
font-weight: 700;
position: absolute;
left: 0;
top: 0;
border: 1px solid #ddd;
color: #fff;
}
.canvas_srinl {
width: 300px;
/* height: 104px; */
height: 150px;
}
.canvas_width {
position: absolute;
left: 0;
top: 0;
height: 40px;
background-color: #1991FA;
width: 0;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
}
.cuIcon-back_android {
transform: rotate(180deg);
}
.canvas_slide {
width: 300px;
height: 40px;
background: #eee;
text-align: center;
/* padding-left: 50rpx; */
line-height: 80rpx;
float: left;
margin: 30rpx;
position: relative;
font-size: 26rpx;
}
.canvas_guil {
width: 100%;
border-top: 1px solid #f4f4f4;
height: 80rpx;
display: flex;
align-items: center;
float: left;
font-size: 35rpx;
color: #666;
}
.canvas_guil>view {
margin-left: 30rpx;
}
\ No newline at end of file
... ...
// components/bottomBar/bottomBar.js
Component({
/**
* 组件的属性列表
*/
properties: {
active: {
type: String,
value: 'getCoupon'
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
goToFindShop() {
wx.redirectTo({
url: '/pages/findShop/findShop'
})
},
goToCouponPack() {
wx.redirectTo({
url: '/pages/couponPack/couponPack'
})
},
goToShopCoupon() {
wx.redirectTo({
url: '/pages/shopCoupon/shopCoupon'
})
}
}
})
\ No newline at end of file
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<view class="tabbar">
<view class="tabbar-item" bindtap="goToShopCoupon">
<image class="tabbar-item__icon" src="icon/lingquan{{active=='getCoupon'?'2':'1'}}.png" mode="widthFix" />
<text class="tabbar-item__text {{active=='getCoupon'?'active':''}}">领券</text>
</view>
<view class="tabbar-item" bindtap="goToFindShop">
<image class="tabbar-item__icon" src="icon/zhaodian{{active=='findShop'?'2':'1'}}.png" mode="widthFix" />
<text class="tabbar-item__text {{active=='findShop'?'active':''}}">找店</text>
</view>
<view class="tabbar-item" bindtap="goToCouponPack">
<image class="tabbar-item__icon" src="icon/quanbao{{active=='couponPack'?'2':'1'}}.png" mode="widthFix" />
<text class="tabbar-item__text {{active=='couponPack'?'active':''}}">我的券包</text>
</view>
</view>
... ...
/* 底部导航栏样式 */
.tabbar {
width: 100%;
height: 98rpx;
background-color: #fff;
position: fixed;
bottom: 0;
left: 0;
display: flex;
justify-content: center;
}
.tabbar-item {
height: 100%;
width: 33.33%;
color: #666;
}
.tabbar-item__icon {
width: 40rpx;
height: 40rpx;
display: block;
margin: 15rpx auto 6rpx;
}
.tabbar-item__text {
text-align: center;
display: block;
margin: 0 auto;
font-size: 22rpx;
}
.active {
color: #FF7F00;
}
\ No newline at end of file
... ...
// components/button.js
Component({
/**
* 组件的属性列表
*/
properties: {
text: {
type: String,
value: '',
},
type: {
type: String,
value: 'normal',
},
plain: {
type: Boolean,
value: false,
},
disabled: {
type: Boolean,
value: false,
}
},
/**
* 暴露class
*/
externalClasses: ['lx-class'],
/**
* 组件的初始数据
*/
data: {
typeMap: {
normal: 'orange-theme',
success: 'green-theme',
primary: 'blue-theme',
danger: 'red-theme'
}
},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<button wx:if="{{plain}}" class="lx-class {{typeMap[type]}} btn btn-line" disabled="{{disabled}}">{{text}}</button>
<button wx:else class="lx-class {{typeMap[type]}} btn btn-solid" disabled="{{disabled}}">{{text}}</button>
... ...
/* components/button.wxss */
/* pages/couponDetail/couponDetail.wxss */
.btn {
width: 85%;
height: 80rpx;
border-radius: 40rpx;
font-size: 32rpx;
font-weight: 400;
display: block;
margin: 0 auto;
}
.btn::after {
border: none;
}
.btn-solid {
background-color: #FF7F00;
color: #fff !important;
}
.btn-line {
background-color: #fff !important;
border: 1px solid #FF7F00;
color: #FF7F00;
}
.btn[disabled] {
background-color: rgba(255, 127, 0, 0.4) !important;
border-color: rgba(255, 127, 0, 0.4) !important;
color: #FFF !important;
}
.green-theme {
background-color: #47BB01;
border-color: #47BB01;
color: #47BB01;
}
.blue-theme {
background-color: #409eff;
border-color: #409eff;
color: #409eff;
}
.danger-theme {
background-color: #f56c6c;
border-color: #f56c6c;
color: #f56c6c;
}
\ No newline at end of file
... ...
// component/v-noneData/v-noneData.js
Component({
/**
* 组件的属性列表
*/
properties: {
imageUrl: String,
text: String,
subtitle: String,
top: {
type: String,
value: '0rpx'
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
imageLoad(e) {
let { width, height } = e.detail;
this.setData({
style: `width: ${width}rpx;height: ${height}rpx;`
})
}
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
@import '../../utils/less/global.less';
.image{
margin: 0 auto;
}
.hideImg{
display: none;
}
.text{
text-align: center;
margin-top: 30rpx;
color: @subTitle-color;
font-size: 28rpx;
}
\ No newline at end of file
... ...
<!--component/v-noneData/v-noneData.wxml-->
<view class='none' style='padding-top: {{ top }}'>
<image style='{{ style }}' class='image {{ style ? "" : "hideImg" }}' src='{{ imageUrl }}' bindload="imageLoad" />
<view class='text'>{{ text }}</view>
<view class='text' wx:if='{{ subtitle }}'>{{ subtitle }}</view>
</view>
... ...
.image {
display: block;
margin: 0 auto;
}
.hideImg {
display: none;
}
.text {
text-align: center;
margin-top: 30rpx;
color: #999999;
font-size: 28rpx;
width: 650rpx;
margin-left: 50rpx;
}
... ...
// component/v-noneData/v-noneData.js
Component({
/**
* 组件的属性列表
*/
properties: {
showPopup: {
type: Boolean,
value: false
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--弹窗插件-->
<view class="mask" wx:if="{{showPopup}}">
<view class="mask-wrap">
<slot></slot>
</view>
</view>
\ No newline at end of file
... ...
.mask {
width: 100%;
height: 100%;
overflow: scroll;
background: rgba(0, 0, 0, 0.7);
position: fixed;
top: 0;
left: 0;
z-index: 1000;
}
.mask-wrap {
display: flex;
flex-direction: column;
height: 100%;
align-items: center;
justify-content: center;
}
... ...
// components/v-tab/v-tab.js
const sliderWidth = 65
const app = getApp()
Component({
/**
* 组件的属性列表
*/
externalClasses: ['extra-class'],
properties: {
dataList: {
type: Array,
value: [],
observer(selectIndex) {
this.menuData()
}
},
type: {
type: String,
value: 'array' // array 为 [1,2,3] 格式 objectArray 为 [{}]格式
},
selectIndex: {
type: Number,
value: 0,
observer(selectIndex) {
this.menuData()
}
}
},
/**
* 组件的初始数据
*/
data: {
sliderOffset: 0,
sliderLeft: 0
},
// observers: {
// 'selectIndex': function(selectIndex) {
// this.menuData()
// }
// },
lifetimes: {
attached() {
this.menuData()
}
},
/**
* 组件的方法列表
*/
methods: {
menuData() {
wx.getSystemInfo({
success: res => {
this.setData({
sliderLeft: (res.windowWidth / this.data.dataList.length - sliderWidth) / 2,
sliderOffset: res.windowWidth / this.data.dataList.length * this.data.selectIndex
})
}
})
},
tabClick(e) {
const { offsetLeft, id } = e.currentTarget
this.setData({
sliderOffset: offsetLeft,
selectIndex: id
})
if (this.data.type === 'array') {
this.triggerEvent('selectIndex', Number(id))
}
if (this.data.type === 'objectArray') {
this.triggerEvent('selectIndex', this.data.dataList[id].id)
}
}
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
@import '../../utils/less/global.less';
.v-tab {
width: 100%;
height: 80rpx;
background: #fff;
border-bottom: 1rpx solid @splitLine-color;
position: relative;
}
.v-tabList {
width: 100%;
height: 100%;
display: flex;
align-items: center;
position: relative;
}
.v-tab{
flex: 1;
color: @title-color;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
}
.v-tab-select {
font-size: 32rpx;
font-weight: 500;
}
.v-tab-slider{
position: absolute;
left: 0;
bottom: 0;
width: 65px;
height: 5rpx;
background-color: @default-color;
transition: transform .3s;
border-radius: 3px;
}
\ No newline at end of file
... ...
<!--components/v-tab/v-tab.wxml-->
<view class='v-tab extra-class'>
<slot ></slot>
<view class='v-tabList'>
<view
class='v-tab {{ selectIndex == index && "v-tab-select" }}'
id='{{ index }}'
wx:for='{{ dataList }}'
wx:key='name'
bindtap='tabClick'>{{ type === 'array' ? item : item.name }}</view>
<view
class='v-tab-slider'
style='left: {{ sliderLeft }}px; transform: translateX({{ sliderOffset }}px); -webkit-transform: translateX({{ sliderOffset }}px);'></view>
</view>
</view>
... ...
.v-tab {
width: 100%;
height: 80rpx;
background: #fff;
/* border-bottom: 1rpx solid #d9d9d9; */
position: relative;
}
.v-tabList {
width: 100%;
height: 100%;
display: flex;
align-items: center;
position: relative;
}
.v-tab {
flex: 1;
color: #333333;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
}
.v-tab-select {
font-size: 32rpx;
font-weight: 500;
}
.v-tab-slider {
position: absolute;
left: 0;
bottom: 0;
width: 65px;
height: 6rpx;
background-color: #FF9800;
transition: transform 0.3s;
border-radius: 6rpx;
}
\ No newline at end of file
... ...
import TouchEvent from "./utils/touchEvent";
const app = getApp()
Component({
properties: {
data: Array,
imgData:{
type:Array,
value:[]
},
back: {
type: String,
value: '#fff'
},
swiperCurIndex:{
type:Number,
value: 0,
observer: function(newVal, oldVal) {
if(newVal){
}// 在这里可以对接收到的数据进行相应的处理
}
}
},
options: {
multipleSlots: true
},
data: {
isLoading: false,
swiperData: [],
// swiperCurIndex: 0,
slideClass: "",
lockSwipe: false
},
lifetimes: {
created() {
this.data.swiperData = this.data.swiperData.concat(this.data.data);
new TouchEvent(this, "touchCard", {
swipe: evt => {
if (evt.direction === "Left") this.next(evt);
if (evt.direction === "Right") this.prev(evt);
}
});
},
async attached() {
const res = await this.getImgData()
this.setData({
imgData:res.data.skuImgageList
}, () => {
let imgList = [ ].concat.apply([],this.data.imgData)
let swiperData = imgList.map(item=>{
return { url:item }
})
this.setData({
swiperData
})
})
},
ready(){
},
},
methods: {
getImgData(){
return app.utils.doPost({
url: '/junYao/homeSkuInfo.json',
params: {}
},true)
},
next(e) {
if (this.data.lockSwipe) return;
this.data.lockSwipe = true;
if (-this.data.swiperCurIndex >= this.data.swiperData.length - 1)
return (this.data.lockSwipe = false);
if (-this.data.swiperCurIndex >= this.data.swiperData.length - 3) {
this.loadMore();
}
const index = e.currentTarget.dataset["index"];
const { src } = e.currentTarget.dataset
let mySwiperIndex = this.data.swiperData.findIndex(item=>item.url==src)
const tabIndex = this.data.imgData.findIndex(item => item.includes(this.data.swiperData[mySwiperIndex + 1].url));
this.triggerEvent('updateTab',{ tabIndex })
this.setData({ ["swiperData[" + index + "].slideClass"]: " ani-slide-up" }, () => {
this.setData({
swiperCurIndex: --this.data.swiperCurIndex
});
})
setTimeout(() => {
this.data.lockSwipe = false;
this.setData({
["swiperData[" + index + "].slideClass"]: ""
});
}, 360);
},
prev(e) {
const index = e.currentTarget.dataset["index"] - 1;
const { src } = e.currentTarget.dataset
if (this.data.lockSwipe || index < 0) return;
this.data.lockSwipe = true;
let mySwiperIndex = this.data.swiperData.findIndex(item=>item.url==src)
const tabIndex = this.data.imgData.findIndex(item => item.includes(this.data.swiperData[mySwiperIndex - 1].url));
this.triggerEvent('updateTab',{ tabIndex })
this.setData({
swiperCurIndex: ++this.data.swiperCurIndex
});
setTimeout(() => {
this.data.lockSwipe = false;
this.setData({
["swiperData[" + index + "].slideClass"]: ""
});
}, 360);
},
loadMore() {
this.isLoading = true;
this.triggerEvent("loadmore", { addToList: this.addToList.bind(this) });
},
addToList(list) {
this.isLoading = false;
this.setData({
swiperData: this.data.swiperData.concat(list)
});
}
}
});
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!-- 决定将二维数组数据遍历出来 -->
<view class="card-swiper">
<view wx:for="{{swiperData}}" wx:key="index" data-index="{{index}}" data-src="{{item.url}}" style="background: {{back}};" class="{{'card-swiper-item curdistance' + (swiperCurIndex + index) + (!!item.slideClass? item.slideClass: '')}}" bindtap="next" catchtouchstart="touchCard.start" catchtouchmove="touchCard.move" catchtouchend="touchCard.end" catchtouchcancel="touchCard.cancel">
<image class="img_css" src="{{item.url}}" mode="scaleToFill"/>
</view>
</view>
\ No newline at end of file
... ...
/**index.wxss**/
.card-swiper{
position: relative;
width: 600rpx;
height: 1000rpx;
color: #666;
font-size: 28rpx;
width: 650rpx;
height: 1160rpx;
height: 100%;
box-shadow: 4rpx 6rpx 12rpx 0 #00438734;
}
.card-swiper-item{
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
width: 600rpx;
height: 1000rpx;
width: 650rpx;
height: 1160rpx;
height: 100%;
background-color: #fff;
z-index: 0;
display: none;
}
.card-swiper .card-swiper-item.curdistance0{
z-index: 10;
display: flex;
}
.card-swiper .card-swiper-item.curdistance1{
display: flex;
z-index: 9;
}
.card-swiper .card-swiper-item.curdistance2{
display: flex;
z-index: 8;
}
.ani-slide-up{
display: flex;
animation: slideUp .8s ease-out;
z-index: 11;
}
.ani-slide-down{
display: flex;
animation: slideUp .6s ease-in;
animation-direction: reverse;
}
@keyframes slideUp{
0% {
}
70% {
opacity: 1;
}
100% {
transform: rotate(-10deg) translate(-1500rpx,200rpx);
opacity: 0;
}
}
.img_css{
width: 100%;
height: 100%;
}
\ No newline at end of file
... ...
var defaultOption = {
touchStart: function () { },
touchMove: function () { },
touchEnd: function () { },
touchCancel: function () { },
multipointStart: function () { },
multipointEnd: function () { },
tap: function () { },
doubleTap: function () { },
longTap: function () { },
singleTap: function () { },
rotate: function () { },
pinch: function () { },
pressMove: function () { },
swipe: function () { }
}
export default class YrobotTouch {
constructor(pageOBJ, name, option = {}) {
this.preV = { x: null, y: null };
this.pinchStartLen = null;
this.scale = 1;
this.isDoubleTap = false;
this.delta = null;
this.last = null;
this.now = null;
this.tapTimeout = null;
this.singleTapTimeout = null;
this.longTapTimeout = null;
this.swipeTimeout = null;
this.x1 = this.x2 = this.y1 = this.y2 = null;
this.preTapPosition = { x: null, y: null };
this.lastZoom = 1;
this.tempZoom = 1;
try {
if (this._checkBeforeCreate(pageOBJ, name)) {
this._name = name
this._option = { ...defaultOption, ...option }
pageOBJ[name] = this
this._bindFunc(pageOBJ)
}
} catch (error) {
console.error(error)
}
}
_checkBeforeCreate(pageOBJ, name) {
if (!pageOBJ || !name) {
throw new Error('YrobotTouch实例化时,必须传入page对象和引用名')
return false
}
if (pageOBJ[name]) {
throw new Error('YrobotTouch实例化error: ' + name + ' 已经存在page中')
return false
}
return true
}
_bindFunc(pageOBJ) {
let funcNames = ['start', 'move', 'end', 'cancel']
for (let funcName of funcNames)
pageOBJ[this._name + '.' + funcName] = this[funcName].bind(this)
}
start(evt) {
if (!evt.touches) return;
this.now = Date.now();
this.x1 = evt.touches[0].pageX == null ? evt.touches[0].x : evt.touches[0].pageX;
this.y1 = evt.touches[0].pageY == null ? evt.touches[0].y : evt.touches[0].pageY;
this.delta = this.now - (this.last || this.now);
this._option.touchStart(evt);
if (this.preTapPosition.x !== null) {
this.isDoubleTap = (this.delta > 0 && this.delta <= 250 && Math.abs(this.preTapPosition.x - this.x1) < 30 && Math.abs(this.preTapPosition.y - this.y1) < 30);
}
this.preTapPosition.x = this.x1;
this.preTapPosition.y = this.y1;
this.last = this.now;
let preV = this.preV,
len = evt.touches.length;
if (len > 1) {
this._cancelLongTap();
this._cancelSingleTap();
let otx = evt.touches[1].pageX == null ? evt.touches[1].x : evt.touches[1].pageX;
let oty = evt.touches[1].pageY == null ? evt.touches[1].y : evt.touches[1].pageY;
let v = { x: otx - this.x1, y: oty - this.y1 };
preV.x = v.x;
preV.y = v.y;
this.pinchStartLen = getLen(preV);
this._option.multipointStart(evt);
}
this.longTapTimeout = setTimeout(function () {
evt.type = "longTap";
this._option.longTap(evt);
}.bind(this), 750);
}
move(evt) {
if (!evt.touches) return;
let preV = this.preV,
len = evt.touches.length,
currentX = evt.touches[0].pageX == null ? evt.touches[0].x : evt.touches[0].pageX,
currentY = evt.touches[0].pageY == null ? evt.touches[0].y : evt.touches[0].pageY;
this.isDoubleTap = false;
if (len > 1) {
let otx = evt.touches[1].pageX == null ? evt.touches[1].x : evt.touches[1].pageX;
let oty = evt.touches[1].pageY == null ? evt.touches[1].y : evt.touches[1].pageY;
let v = { x: otx - currentX, y: oty - currentY };
if (preV.x !== null) {
if (this.pinchStartLen > 0) {
evt.singleZoom = getLen(v) / this.pinchStartLen;
evt.zoom = evt.singleZoom * this.lastZoom;
this.tempZoom = evt.zoom;
evt.type = "pinch";
this._option.pinch(evt);
}
evt.angle = getRotateAngle(v, preV);
evt.type = "rotate";
this._option.rotate(evt);
}
preV.x = v.x;
preV.y = v.y;
} else {
if (this.x2 !== null) {
evt.deltaX = currentX - this.x2;
evt.deltaY = currentY - this.y2;
} else {
evt.deltaX = 0;
evt.deltaY = 0;
}
this._option.pressMove(evt);
}
this._option.touchMove(evt);
this._cancelLongTap();
this.x2 = currentX;
this.y2 = currentY;
if (len > 1) {
// evt.preventDefault();
}
}
end(evt) {
if (!evt.changedTouches) return;
this._cancelLongTap();
let self = this;
evt.direction = this._swipeDirection(this.x1, this.x2, this.y1, this.y2); //在结束钩子都加入方向判断,但触发swipe瞬时必须位移大于30
if (evt.touches.length < 2) {
this.lastZoom = this.tempZoom;
this._option.multipointEnd(evt);
}
this._option.touchEnd(evt);
//swipe
if ((this.x2 && Math.abs(this.x1 - this.x2) > 30) ||
(this.y2 && Math.abs(this.y1 - this.y2) > 30)) {
// evt.direction = this._swipeDirection(this.x1, this.x2, this.y1, this.y2);
this.swipeTimeout = setTimeout(function () {
evt.type = "swipe";
self._option.swipe(evt);
}, 0)
} else {
this.tapTimeout = setTimeout(function () {
evt.type = "tap";
self._option.tap(evt);
// trigger double tap immediately
if (self.isDoubleTap) {
evt.type = "doubleTap";
self._option.doubleTap(evt);
clearTimeout(self.singleTapTimeout);
self.isDoubleTap = false;
}
}, 0)
if (!self.isDoubleTap) {
self.singleTapTimeout = setTimeout(function () {
self._option.singleTap(evt);
}, 250);
}
}
this.preV.x = 0;
this.preV.y = 0;
this.scale = 1;
this.pinchStartLen = null;
this.x1 = this.x2 = this.y1 = this.y2 = null;
}
cancel(evt) {
clearTimeout(this.singleTapTimeout);
clearTimeout(this.tapTimeout);
clearTimeout(this.longTapTimeout);
clearTimeout(this.swipeTimeout);
this._option.touchCancel(evt);
}
_cancelLongTap() {
clearTimeout(this.longTapTimeout);
}
_cancelSingleTap() {
clearTimeout(this.singleTapTimeout);
}
_swipeDirection(x1, x2, y1, y2) {
return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down')
}
destroy() {
if (this.singleTapTimeout) clearTimeout(this.singleTapTimeout);
if (this.tapTimeout) clearTimeout(this.tapTimeout);
if (this.longTapTimeout) clearTimeout(this.longTapTimeout);
if (this.swipeTimeout) clearTimeout(this.swipeTimeout);
this._option.rotate = null;
this._option.touchStart = null;
this._option.multipointStart = null;
this._option.multipointEnd = null;
this._option.pinch = null;
this._option.swipe = null;
this._option.tap = null;
this._option.doubleTap = null;
this._option.longTap = null;
this._option.singleTap = null;
this._option.pressMove = null;
this._option.touchMove = null;
this._option.touchEnd = null;
this._option.touchCancel = null;
this.preV = this.pinchStartLen = this.scale = this.isDoubleTap = this.delta = this.last = this.now = this.tapTimeout = this.singleTapTimeout = this.longTapTimeout = this.swipeTimeout = this.x1 = this.x2 = this.y1 = this.y2 = this.preTapPosition = this.rotate = this.touchStart = this.multipointStart = this.multipointEnd = this.pinch = this.swipe = this.tap = this.doubleTap = this.longTap = this.singleTap = this.pressMove = this.touchMove = this.touchEnd = this.touchCancel = null;
return null;
}
}
function getLen(v) {
return Math.sqrt(v.x * v.x + v.y * v.y);
}
function dot(v1, v2) {
return v1.x * v2.x + v1.y * v2.y;
}
function getAngle(v1, v2) {
let mr = getLen(v1) * getLen(v2);
if (mr === 0) return 0;
let r = dot(v1, v2) / mr;
if (r > 1) r = 1;
return Math.acos(r);
}
function cross(v1, v2) {
return v1.x * v2.y - v2.x * v1.y;
}
function getRotateAngle(v1, v2) {
let angle = getAngle(v1, v2);
if (cross(v1, v2) > 0) {
angle *= -1;
}
return angle * 180 / Math.PI;
}
\ No newline at end of file
... ...
Component({
/**
* 组件的属性列表
*/
properties: {
transparent: { type: Boolean, value: false },
visible: { type: Boolean, value: false }
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
close() {
this.setData({
visible: false
})
}
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<view class="cover" wx:if="{{visible}}">
<view class="popup {{transparent?'transparent':''}}">
<slot/>
<view class="icon-close" bindtap = "close"></view>
</view>
</view>
... ...
.cover {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.8);
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
}
.popup {
width: 658rpx;
max-height: 70vh;
background: #FFFFFF;
border-radius: 16rpx;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 110rpx;
}
.transparent {
background: none;
}
.icon-close {
background: url('https://hbrand.oss-cn-hangzhou.aliyuncs.com/BUSINESS/CPP/weilong/icon_close.png') no-repeat center / cover;
width: 60rpx;
height: 60rpx;
position: absolute;
bottom: -110rpx;
left: calc(50% - 30rpx);
}
\ No newline at end of file
... ...
// custom-pages/custom-index/index.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
ruleShow:false,
groupId:null,
groupRule:'<p style="text-align:center;">\n\t消费者声明及活动详细规则\n</p>\n<p>\n\t请在参与本活动前仔细阅读本活动的各项条款,如果您参加了本活动,则活动主办方认为您已充分理解并同意该规则中的各条款:\n</p>\n<ol>\n\t<li>\n\t\t活动主办方及其联系方式:\n\t</li>\n</ol>\n<p style="text-indent:24px;">\n\t均瑶集团上海食品有限公司(以下简称“主办方”)\n</p>\n<p style="text-indent:24px;">\n\t联系电话:021-60251969(话费自理,工作日:9:00-12:00,13:30-18:00)\n</p>\n<ol>\n\t<li>\n\t\t活动期间及兑奖时间:\n\t</li>\n</ol>\n<p style="text-indent:24px;">\n\t即日起至2026年4月30日23:59:59截止。\n</p>\n<p style="text-indent:24px;">\n\t为充分保障中奖者权益,兑奖时间为即日起至2026年5月1日23:59:59截止,逾期视为自动放弃兑奖。\n</p>\n<ol>\n\t<li>\n\t\t活动区域:\n\t</li>\n</ol>\n<p style="text-indent:24px;">\n\t仅限中国大陆地区(不含港、澳、台)\n</p>\n<ol>\n\t<li>\n\t\t活动参与条件及参与方式:\n\t</li>\n</ol>\n<p style="text-indent:28px;">\n\t即日起,凡购买“扫码赢红包”味动力AD钙奶饮品(2个口味),揭开活动产品包装上活动标签(因其包装设计二维码于瓶盖内,故为揭开瓶盖,敬请谅解),微信扫描其内二维码,进入活动小程序,根据提示完成授权或登陆即可参与活动。参与活动的消费者有机会赢取666元微信红包一份、1.8元微信红包一份或0.6元微信红包一份;同时,还有机会获得复购奖励“1.8元复购红包”,获得复购奖励后再买一瓶活动产品并扫描再次购买的活动产品瓶盖内二维码后即可解锁领取1.8元现金红包,复购奖励数量有限,发完即止。\n</p>\n<ol>\n\t<li>\n\t\t开奖方式与开奖时间:\n\t</li>\n</ol>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;参与活动后,根据微信平台活动小程序页面提示,手机扫码即时开奖,若显示中奖,则线上即时领取红包即可。\n</p>\n<ol>\n\t<li>\n\t\t奖项种类设置:\n\t</li>\n</ol>\n<p style="text-indent:24px;">\n\t本活动奖项种类分为常规抽奖与复购奖励。\n</p>\n<ol>\n\t<li>\n\t\t其中常规抽奖设立奖品价格、奖品品名、奖品种类、奖品数量及中奖概率如下:\n\t</li>\n</ol>\n<p style="text-indent:24px;">\n\t一等奖:666元微信现金红包一份,价值人民币六百六十六元,本活动共设18份;中奖概率约为0.0039%\n</p>\n<p style="text-indent:24px;">\n\t二等奖:1.8元微信现金红包一份,价值人民币一元八角,本活动共设6,000份;中奖概率约为1.33%\n</p>\n<p style="text-indent:24px;">\n\t三等奖:0.6元微信现金红包一份,价值人民币八角,本活动共设80,000份;中奖概率约为17.78%\n</p>\n<p style="text-indent:24px;">\n\t其余未中奖将出现“谢谢惠顾”字样。\n</p>\n<p style="text-indent:24px;">\n\t*各奖项中奖率无法整除,谨请谅解。\n</p>\n<ol>\n\t<li>\n\t\t复购奖励设立奖品价格、奖品品名、奖品种类、奖品数量如下:\n\t</li>\n</ol>\n<p style="text-indent:24px;">\n\t复购奖励:人民币1.8元微信现金红包一份,价值人民币壹元捌角,共30,000份,数量有限,先到先得,发完即止。\n</p>\n<ol>\n\t<li>\n\t\t兑奖条件、兑奖方式及奖品交付方式:\n\t</li>\n</ol>\n<p style="text-indent:24px;">\n\t微信扫描活动产品包装上活动标签后,按手机页面提示操作进行兑奖。\n</p>\n<ol>\n\t<li>\n\t\t常规抽奖兑换方式、兑奖方式及奖品交付方式如下:\n\t</li>\n</ol>\n<ol>\n\t<li>\n\t\t如若抽中一等奖666元,需要完善中奖者姓名、身份证、手机号信息并确认提交即可兑奖。提请注意:因微信平台对商家转账到零钱的单笔提现金额上限至200元,即该奖项到账微信钱包时会自动拆分成4笔同时到中奖者微信账户余额;\n\t</li>\n\t<li>\n\t\t如若抽中二等奖1.8元/三等奖0.8元,点击领取即可兑奖,不需要完善中奖者信息;所得现金红包将存入本人微信账户,可在历史中奖记录中查看。\n\t</li>\n</ol>\n<ol>\n\t<li>\n\t\t复购奖励兑换方式、兑奖方式及奖品交付方式如下:\n\t</li>\n</ol>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;如若抽中复购奖励,复购奖励中奖者再买一瓶活动产品并点击活动页面中的“扫码激活”扫描再次购买的活动产品瓶盖内二维码后点击领取即可兑奖,不需要完善中奖者信息;所得现金红包将自动存入本人微信账户,可在历史中奖记录中查看。\n</p>\n<p style="text-indent:24px;">\n\t红包提现需遵守腾讯公司微信红包提现规则,由系统自动发放,转账延时属正常情况。本次活动所产生的个人所得税由均瑶集团上海食品有限公司依法代扣代缴,现金红包均为税后所得。\n</p>\n<ol>\n\t<li>\n\t\t活动声明、弃奖条件及注意事项:\n\t</li>\n</ol>\n<ol>\n\t<li>\n\t\t均瑶集团上海食品有限公司对活动产品真实性及有效性具有鉴定及确认权。\n\t</li>\n\t<li>\n\t\t本次活动产品总计投入2,250,000份,每个活动产品二维码只可参与一次抽奖活动,重复扫码无效。\n\t</li>\n\t<li>\n\t\t为保证活动参与体验,主办方将检测活动消费者所提交的相关数据以确保真实性。若检测出消费者有恶意或者虚假刷单行为,主办方有权取消其参加本次活动资格。提请注意:每个微信OpenID活动期间日参与次数限6次,超过参与次数后限制参与,并提示微信号参与已达日上限。消费者可以次日零点后再扫码参与。\n\t</li>\n\t<li>\n\t\t现金红包须在兑奖截止日期前(如需完善相关信息应当在兑换有效期内完善并正确)完成兑奖,过期视为弃奖,主办方不予补发。\n\t</li>\n\t<li>\n\t\t复购奖励中奖者,若未在中奖后72小时内再次购买活动产品并扫描再次购买的活动产品瓶盖内二维码的,视为弃奖。\n\t</li>\n\t<li>\n\t\t消费者应当在活动期间内参与活动并在兑奖期间内完成兑奖,否则视为弃奖。\n\t</li>\n\t<li>\n\t\t活动主办方不对因网络传输原因而导致消费者提交的信息错误或延误承担任何责任。\n\t</li>\n\t<li>\n\t\t消费者领奖过程中所发生的个人费用(包含但不限于上网费、手机流量费、短信费、咨询客服电话费)需自理,主办方不做任何形式的补偿。本活动对象为以消费为目的的消费者,禁止非真实活动参与者的刷单行为,活动参与者不遵守活动规则的,主办方有权根据法律法规及活动规则不予兑换/追回已兑换活动奖品,并且主办方保留追究无参与资格者一切法律责任的权力。\n\t</li>\n\t<li>\n\t\t若因消费者个人原因造成账号、密码遗失,并导致参与活动兑奖的消费者无法提交个人信息的情况,活动主办方不承担责任。\n\t</li>\n\t<li>\n\t\t如发现消费者恶意刷奖行为,包括但不限于:入侵本次活动所使用的网络服务器、使用技术手段获取活动后台信息或篡改活动后台中奖规则、参与记录不符合活动的最低参与要求、盗用他人信息参与活动、冒充他人获得红包等不正当行为,主办方有权取消其活动参与权和收回其所得红包。同时保留依法追究其法律责任的权利。\n\t</li>\n\t<li>\n\t\t活动过程中出现“不可抗力”事件或计算机系统故障直接或间接地造成活动主办方无法履行其全部或部分义务,则活动主办方将免予履行该义务,并无需承担相应的责任。“不可抗力”事件包括但不限于,地震、台风、火灾、水灾、战争、法律法规调整、政府命令禁止、因黑客攻击、计算机病毒影响、系统崩溃、数据丢失或其他人为原因造成计算机系统故障,及其他自然或人为灾害等导致活动无法继续开展的,且活动主办方不可预见、无法避免并无法控制的事件。\n\t</li>\n\t<li>\n\t\t活动过程中,如因政府法律法规调整或行政命令要求,活动主办方有权根据上述调整或要求随时调整活动内容及规则。活动内容及规则调整时,活动主办方将另行向活动参与者公告通知相关的调整,但无需征得活动参与者的同意。主办方有权根据法律法规、司法或行政命令的要求以及活动的实际情况,在法律允许的范围内随时取消、中止或终止此次活动。\n\t</li>\n\t<li>\n\t\t本次活动奖品所涉之相关服务由第三方服务提供商提供,使用服务的相关限制及注意事项以具体服务提供商的要求为准。对于消费者在领取和使用奖品过程中发生的任何伤害和损失,如该伤害和损失非由主办方之过错导致,主办方不承担任何责任。\n\t</li>\n\t<li>\n\t\t消费者需就因其违反本条款及细则的任何规定、侵犯他人权利或其他任何违法的行为而引起的所有索偿、责任、损失、损害、费用和开支对主办方做出补偿。\n\t</li>\n\t<li>\n\t\t本活动适用中华人民共和国法律。因本活动引起的或本活动有关的任何争议,由争议双方友好协商解决。如任何争议不能通过双方友好协商解决的,可通过其他有效法律途径征求最终解决方式。\n\t</li>\n\t<li>\n\t\t活动主办方、本促销活动的代理公司、广告公司、印刷商和相关合作企业之员工、家属,不可参加此次促销活动,&nbsp;以示公允。\n\t</li>\n\t<li>\n\t\t个人信息:\n\t</li>\n</ol>\n<ol>\n\t<li>\n\t\t用户向活动主办方提供的个人微信资料数据只会用作本次活动用途,及会被保密处理。\n\t</li>\n\t<li>\n\t\t用户必须授权使用个人微信账号登陆进行互动;若未能及时提供,将不能参加本次活动。\n\t</li>\n\t<li>\n\t\t用户进入本活动时,需要点击同意并授权个人的基本资料给活动主办方使用。本活动将通过微信收集用户基本信息,包括:微信信息资料。以上信息将被主办方委托的第三方用于本活动的奖品派发、活动数据分析等。活动主办方将采取适当的规范手段以保护个人信息安全,防止资料丢失、被盗用或遭篡改。\n\t</li>\n\t<li>\n\t\t用户在使用互联网时对个人信息的运用需进行监管和负责,如有通过公告版等形式自愿提供及公开的个人资料被他人使用或传播,与本活动无关。\n\t</li>\n\t<li>\n\t\t如用户本人主动将微信账号与密码共享,或因各种不可抗力因素所导致的个人资料泄露、丢失、被盗用或被篡改,主办方不承担任何责任。\n\t</li>\n\t<li>\n\t\t如经得用户同意,主办方可使用有关个人资料数据作直接商品促销用途;否则,主办方将不能使用其个人资料作前述直接促销用途。用户须确保所提供的个人资料属实及有效。\n\t</li>\n</ol>'
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// if (!app.utils.getToken()) {
// app.utils.needLogin()
// }else{
// this.getGroupId()
// }
this.getGroupId()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
active: 0
})
}
},
async getGroupId(){
const res = await app.utils.doPost({
url: '/junYao/homeGroupId.json',
params: {}
},true)
this.setData({
groupId:res.data
},()=>{
this.getGroupInfo(this.data.groupId)
})
},
getGroupInfo(id){
app.utils.doPost({
url: '/activity/getGroupInfo.json',
params: id
},true).then(res => {
this.setData({
// groupRule: res.data.summary,
})
})
},
goCode(){
wx.navigateTo({
url: '/pages/clearCode/index',
})
},
goRule(){
// wx.navigateTo({
// url: '/pages/webView/index',
// })
this.setData({
ruleShow:true
})
},
goRecord(){
wx.navigateTo({
url: `/scanGroup/jyScan/record/index?groupId=${this.data.groupId}`,
})
},
openPrivacyGps(){
wx.navigateTo({
url: `/middlePage/pages/privacyGps/privacyGps`,
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
... ...
{
"navigationStyle": "custom",
"usingComponents": {
"popup": "../components/popup/popup"
}
}
\ No newline at end of file
... ...
<!--custom-pages/custom-index/index.wxml-->
<view class="container_index">
<!-- <image class="index_img" src="https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/index.png" mode=""/> -->
<image class="index_img" src="/images/junyao/backgroundImg.png" mode="scaleToFill"/>
<image class="index_img logo" src="/images/junyao/logo.png" mode="widthFix"/>
<image class="index_img product" src="/images/junyao/product.png" mode="widthFix"/>
<image class="drink_power" src="/images/junyao/drinkPower.png" mode="widthFix"/>
<!-- <image class="index_img myPrize" src="/images/junyao/myPrize.png" mode="widthFix"/> -->
<!-- <image class="index_img welfareOfficer" src="/images/junyao/welfareOfficer.png" mode="widthFix"/> -->
<!-- <view bindtap="goRule">
<image class="draw_now" src="/images/junyao/drawNow.png" mode="widthFix"/>
</view> -->
<!-- <image class="code_index" src="https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/code_index.png" mode="" bindtap="goCode" /> -->
<!-- <view class="fixed_btn btn_1" bindtap="goRule">
<view class="mt_down">活动</view>
<view>规则</view>
</view> -->
<view bindtap="goRule" class="activity_box">
<!-- <image class="activity_rules" src="/images/junyao/activityRules.png" mode="widthFix"/> -->
<view class="activity_rules"></view>
<text class="activity_rules_text">活动规则</text>
</view>
<!-- <view class="fixed_btn btn_2" bindtap="goRecord">
<view class="mt_down">中奖</view>
<view>记录</view>
</view> -->
<view class="btnPrivacy">
<!-- <button class="btn_privacy" id="agree-btn" type="default" bindtap="openPrivacyGps">隐私政策(调试用)</button> -->
</view>
<!-- 活动规则 ruleShow-->
<popup visible="{{ ruleShow }}">
<view class="rule">
<view class="rule-title">—— 活动规则 ——</view>
<view class="rule-content">
<mp-html content="{{ groupRule }}"></mp-html>
</view>
</view>
</popup>
</view>
... ...
/* custom-pages/custom-index/index.wxss */
page {
/* height: 100%; */
/* height: auto; */
height: 100vh;
width: 100%;
overflow: hidden;
/* background-color: #004588; */
/* padding-bottom: 148rpx; */
}
.container_index {
width: 100%;
height: 100vh;
/* height: calc(100% - 148rpx); */
position: relative;
}
.index_img {
width: 100%;
height: calc(100% - 148rpx);
position: absolute;
}
.logo{
right: 0;
left: 0;
margin: auto;
width: 250rpx;
top: 11.5%;
}
.myPrize{
right: 10rpx;
width: 170rpx;
top: 30%;
}
.welfareOfficer{
right: 10rpx;
width: 170rpx;
bottom: 28%;
}
.activity_box {
width: 6em;
text-align: center;
position: absolute;
display: flex;
align-items: center;
right: 26rpx;
top: 13.5%;
}
.activity_rules {
position: absolute;
width: 100%;
height: 60rpx;
background-color: #B03344;
border-radius: 20rpx;
}
.activity_rules_text {
position: absolute;
width: 180rpx;
color: #fff;
border-radius: 20rpx;
}
.product {
top: 0;
bottom: -13%;
margin: auto;
}
.drink_power {
position: absolute;
width: 53%;
top: 17.5%;
margin: auto;
left: 0;
right: 0;
}
.draw_now {
position: absolute;
margin: auto;
left: 0;
right: 0;
bottom: 130rpx;
width: 75%;
}
.code_index {
width: 184rpx;
height: 234rpx;
position: fixed;
right: -35rpx;
bottom: 484rpx;
}
.mt_1 {
right: -35rpx;
top: 500rpx;
}
.fixed_btn {
width: 85rpx;
height: 80rpx;
background: #3f9ed1;
border-radius: 28rpx 0 0 28rpx;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
text-align: center;
letter-spacing: 0;
line-height: 28rpx;
position: absolute;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.btn_1 {
right: 0rpx;
top: 428rpx;
}
.btn_2 {
right: 0rpx;
top: 296rpx;
top: 524rpx;
}
.rule {
width: 100%;
height: 772rpx;
overflow-y: scroll;
}
.rule-title {
font-weight: 400;
font-size: 34rpx;
color: #10111A;
text-align: center;
margin-top: 20rpx;
}
.rule-content {
padding: 20rpx 48rpx 40rpx;
}
.btnPrivacy {
position: absolute;
bottom: 80px;
margin: auto;
left: 0;
right: 0;
width: 160px;
}
\ No newline at end of file
... ...
// custom-pages/custom-product/index.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
tabs: [ ], // 选项卡标题
tabIndex:0,
currentPage: 0,
swiperData: [
// {
// name: "内容1",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-22.png'
// },
// {
// name: "内容2",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-18.png'
// }, {
// name: "内容3",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-14.png'
// },
// {
// name: "内容1",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-22.png'
// }, {
// name: "内容2",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-18.png'
// }, {
// name: "内容3",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-14.png'
// },
// {
// name: "内容1",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-22.png'
// }, {
// name: "内容2",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-18.png'
// }, {
// name: "内容3",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-14.png'
// },{
// name: "内容1",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-22.png'
// }, {
// name: "内容2",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-18.png'
// }, {
// name: "内容3",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-14.png'
// },{
// name: "内容1",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-22.png'
// }, {
// name: "内容2",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-18.png'
// }, {
// name: "内容3",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-14.png'
// },{
// name: "内容1",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-22.png'
// }, {
// name: "内容2",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-18.png'
// }, {
// name: "内容3",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-14.png'
// },{
// name: "内容1",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-22.png'
// }, {
// name: "内容2",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-18.png'
// }, {
// name: "内容3",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-14.png'
// },{
// name: "内容1",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-22.png'
// }, {
// name: "内容2",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-18.png'
// }, {
// name: "内容3",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-14.png'
// },{
// name: "内容1",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-22.png'
// }, {
// name: "内容2",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-18.png'
// }, {
// name: "内容3",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-14.png'
// },{
// name: "内容1",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-22.png'
// }, {
// name: "内容2",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-18.png'
// }, {
// name: "内容3",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-14.png'
// },{
// name: "内容1",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-22.png'
// }, {
// name: "内容2",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-18.png'
// }, {
// name: "内容3",
// url:'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-14.png'
// },
],
imgData:[
// [
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-14.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-15.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-16.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-17.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-18.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-19.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-20.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-21.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate1/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-22.png',
// ],
// [
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate2/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-01.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate2/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-02.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate2/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-03.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate2/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-04.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate2/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-05.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate2/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-06.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate2/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-07.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/cates/cate2/%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8C-p-08.png',
// ],
// [
// 'https://via.placeholder.com/400x200?text=Image+1_1',
// 'https://via.placeholder.com/400x200?text=Image+1_2',
// 'https://via.placeholder.com/400x200?text=Image+1_3',
// 'https://via.placeholder.com/400x200?text=Image+1_4',
// 'https://via.placeholder.com/400x200?text=Image+1_5',
// 'https://via.placeholder.com/400x200?text=Image+1_6',
// 'https://via.placeholder.com/400x200?text=Image+1_7',
// 'https://via.placeholder.com/400x200?text=Image+1_8',
// ],
// [
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate1/0.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate1/1.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate1/2.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate1/3.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate1/4.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate1/5.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate1/6.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate1/7.png',
// ],
// [
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate2/8.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate2/9.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate2/10.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate2/11.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate2/12.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate2/13.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate2/14.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate2/15.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate2/16.png',
// ],
// [
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate3/21.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate3/22.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate3/23.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate3/24.png',
// ],
// [
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate4/27.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate4/28.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate4/29.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate4/30.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate4/31.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate4/32.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate4/33.png',
// ],
// [
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate5/17.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate5/18.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate5/19.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate5/20.png',
// ],
// [
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate6/25.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate6/26.png',
// ],
// [
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate7/34.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate7/35.png',
// 'https://hbrand.oss-cn-hangzhou.aliyuncs.com/cpp/jyScan/SKUcates/cate7/36.png',
// ],
]
},
/**
* 生命周期函数--监听页面加载
*/
async onLoad(options) {
const res = await this.getImgData()
this.setData({
tabs:res.data.skuClassList,
imgData:res.data.skuImgageList
}, () => {
let imgList = [ ].concat.apply([],this.data.imgData)
// console.log(imgList);
let swiperData = imgList.map(item=>{
return { url:item }
})
// console.log(swiperData);
this.setData({
swiperData
})
})
// console.log(this.data.swiperData);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
active: 2
})
}
},
// 获取数据
getImgData(){
//旧厂商接口
return app.utils.doPost({
url: '/junYao/homeSkuInfo.json',
params: {}
},true)
},
changeTab(e){
const { imgData , swiperData } = this.data
const { index } = e.currentTarget.dataset
let swiperCurIndex = swiperData.findIndex(item=>{ //找到二维数组此分类下的第一张图片 第10张 索引为-9
return item.url == imgData[index][0]
})
// console.log(swiperCurIndex,"----");
this.setData({
tabIndex: index,
swiperCurIndex:-swiperCurIndex
})
},
updateTab(e){
const { tabIndex } = e.detail
this.setData({
tabIndex,
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
// console.log("页面隐藏了");
this.setData({
tabIndex: 0,
swiperCurIndex:0
})
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {
"CardSwiper": "../components/cardSwiper/cardSwiper"
}
}
\ No newline at end of file
... ...
<!--custom-pages/custom-product/index.wxml-->
<view class="container_box">
<CardSwiper data="{{swiperData}}" imgData='{{imgData}}' swiperCurIndex="{{swiperCurIndex}}" bindupdateTab="updateTab" bindloadmore="loadMore" back="#70a4d1"> </CardSwiper>
<!-- 分类导航条--选项卡 -->
<scroll-view class="cates_scroll" scroll-y="{{true}}" scroll-with-animation="{{true}}">
<view class="tab_box">
<!-- style="{{index == tabIndex ? 'color: #007bff;' : ''}}" -->
<view class="tab_item {{tabIndex==index ? 'tab_active' : ''}}" wx:for="{{tabs}}" wx:key="index" data-index="{{index}}" bindtap="changeTab">
{{item}}
</view>
</view>
</scroll-view>
</view>
\ No newline at end of file
... ...
/* custom-pages/custom-product/index.wxss */
page {
background: #F7F7F9;
height: 100vh;
/* align-items: center; */
display: flex;
justify-content: flex-start;
}
.container_box{
margin-left: 28rpx;
margin-top: 56rpx;
display: flex;
height: 80%;
/* width: 45%; */
}
.cates_scroll{
width: 70rpx;
/* height: 1160rpx; */
height: 100%;
/* border: 1px solid red; */
}
.tab_box{
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
min-height: 100%;
}
.tab_item {
width: 100%;
font-weight: 500;
font-size: 22rpx;
color: #666666;
padding: 14rpx 0;
writing-mode:vertical-lr;
display: flex;
justify-content: center;
align-items: center;
word-wrap: break-word;
/* transform: rotate(180deg); */
}
.tab_active{
display: flex;
justify-content: center;
align-items: flex-start;
font-weight: bold;
font-size: 30rpx;
color: #004487;
letter-spacing: 0;
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
display: none;
}
\ No newline at end of file
... ...
// custom-pages/custom-scan/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
active: 1,
isShow:false
})
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--custom-pages/custom-scan/index.wxml-->
<text>custom-pages/custom-scan/index.wxml</text>
... ...
/* custom-pages/custom-scan/index.wxss */
\ No newline at end of file
... ...
// custom-tab-bar/index.js
const app = getApp()
const urlMap = {
'coupon': '/pages/activityDetail/activityDetail',
'y': '/scanGroup/index/index', // /pages/ywymReward/index /scanGroup/jyScan/index/index /middlePage/pages/privacyGps/privacyGps /scanGroup/index/index /scanGroup/dahaoda/index/index
'jys': '/scanGroup/index/index',
'costa': '/pages/costa/index/index',
'x': '/scanGroup/index/index',
'h': '/scanGroup/index/index', // 吉士丁扫码
'jyo':'/scanGroup/index/index',
'singleProduct': '/pages/index/index',
'delivery-sxh': '/delivery/index/index',
't': '/subPackages/tickets/index/index'
}
const urls = {
'HTTPS://M.HH66.CN/': '/pages/qptest/index',
'https://test-utc-paltform.bzh001.com': '/subPackages/scan/middle/middle'
}
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
// tabbar 的列表
tabbarLists:[
{
pagePath: "/custom-pages/custom-index/index",
text: "首页",
type:'page',
iconPath: "/images/icon_index.png",
selectedIconPath: "/images/icon_index_act.png"
},
{
pagePath: "/custom-pages/custom-scan/index",
text: "扫一扫",
type:'scan',
// iconPath: "/images/icon-pack.png",
selectedIconPath: "/images/tab_scan.png"
},
{
pagePath: "/custom-pages/custom-product/index",
text: "产品介绍",
// type:'page_pro',
type:'page',
iconPath: "/images/icon_pro.png",
selectedIconPath: "/images/icon_pro_act.png"
}
],
active:null, //设为数字,会产生tabbar闪烁
isShow:true //控制显示隐藏tabbar
},
/**
* 组件的方法列表
*/
methods: {
switchTab(e){
const { index,url,item } = e.currentTarget.dataset;
if(item.type!=='scan'){
// if(item.type=='page_pro'){
// wx.showModal({
// title: '提示',
// content: '暂未开放,敬请期待',
// showCancel:false,
// confirmText:'知道了',
// confirmColor:'#00478b',
// complete: (res) => {
// if (res.cancel) {
// }
// if (res.confirm) {
// }
// }
// })
// return
// }
wx.switchTab({url})
}else{
console.log('扫码');
this.showScan()
}
},
showScan() {
wx.scanCode({
success(res) {
console.log(res,"res");
// success
var url = res.result
url = "HTTPS://AAX6.CN/JYS/:QD3T8+4:F-ZS19GIG,8DDHPVIT"
url = url.trim()
url = url.replace(/[\r\n]/g, '')
let type = app.GetUrlParh(url)
console.log(type,"--------");
// url = "HTTP://JY.AAX6.CN/Y/NZU-NWL.2BDJ8F$:IA,0000003101"
if (urlMap.hasOwnProperty(type)) {
wx.navigateTo({
url: `${urlMap[type]}?q=${encodeURIComponent(url)}`
})
return
}
for (const i in urls) {
if (url.indexOf(i) > -1) {
wx.navigateTo({
url: `${urls[i]}?q=${encodeURIComponent(url)}`
})
return
}
}
wx.showToast({
icon: 'none',
title: '无法找到页面资源'
})
}
})
},
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--custom-tab-bar/index.wxml-->
<view class="tab-bar" wx:if="{{isShow}}">
<block wx:for="{{tabbarLists}}" wx:key="item">
<view class="tab-bar-item"
data-index="{{index}}"
data-url="{{item.pagePath}}"
data-item="{{item}}"
bindtap="switchTab"
>
<block wx:if="{{item.type=='page'}}">
<view class="bar_item">
<image class="icon"
src="{{active == index?item.selectedIconPath:item.iconPath}}"></image>
<view class="text {{active == index ? 'active':''}}">{{item.text}}</view>
</view>
</block>
<block wx:else>
<view class="bar_item">
<image class="icon"
src="{{item.selectedIconPath}}"></image>
<view class="text">{{item.text}}</view>
</view>
</block>
<!-- 设置选中状态下的背景 -->
<!-- <view wx:if="{{active == index}}" class="bg-item"></view> -->
</view>
</block>
</view>
... ...
/* custom-tab-bar/index.wxss */
.tab-bar{
height: 148rpx;
background-color: #ffffff;
display: flex;
border-top: 1rpx solid #f9f9f9;
box-shadow: 0 0 5rpx #f8f8f8;
}
.tab-bar-item{
display: flex;
flex: 1;
justify-content: center;
/* align-items: center; */
position: relative;
}
.bar_item{
display: flex;
justify-content: flex-start;
align-items: center;
flex-direction: column;
margin-top: 19rpx;
}
.bar_scan_item{
margin-top: 13rpx;
}
.icon{
width: 36rpx;
height: 36rpx;
}
.icon_scan{
width: 80rpx;
height: 64rpx;
}
.text{
/* font-size: 26rpx;
padding: 0 5rpx;
letter-spacing: 0.1rem;
display: none; */
font-weight: 500;
font-size: 18rpx;
color: #8F9095;
margin-top: 2rpx;
}
.active{
/* color: #10B981;
display: block;
font-weight: 800; */
color: #004487;
}
.bg-item{
position: absolute;
width: 80%;
top: 15rpx;
bottom: 15rpx;
border-radius: 40rpx;
background-color:rgba(52, 211, 153,0.15);
}
\ No newline at end of file
... ...
{
"compilerOptions": {
"target": "es2015",
"module": "commonjs"
}
}
\ No newline at end of file
... ...
const appId = 'wx0f695ef70a18d602'; // 测试环境
// const appId = 'wx4eacc630b301f2dc'; // 正式环境
const webUrl = 'https://ucode-test-cdn.aax6.cn/front-end/project/junyao/junyaoH5/index.html';
// const webUrl = 'https://ucode-cdn.aax6.cn/front-end/project/junyao/junyaoH5/index.html';
... ...
// middlePage/pages/animal/ainmal.js
Page({
/**
* 页面的初始数据
*/
data: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
showAnimal() {
this.setData({ start: true });
},
onShareAppMessage() {},
});
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<!-- middlePage/pages/animal/ainmal.wxml -->
<view class="box">
<view class="animal_box">
<image class="{{ start ? 'action ' : ''}}bottle" bindload="showAnimal" src="https://ucode-test-cdn.aax6.cn/front-end/project/junyao/junyaoH5/bottleImg//bottle.png" mode="widthFix" />
<image class="{{ start ? 'action ' : ''}}cap" src="https://ucode-test-cdn.aax6.cn/front-end/project/junyao/junyaoH5/bottleImg//cap.png" mode="widthFix" />
<image class="{{ start ? 'action ' : ''}}ele1" src="https://ucode-test-cdn.aax6.cn/front-end/project/junyao/junyaoH5/bottleImg/ele1.png" mode="widthFix" />
<image class="{{ start ? 'action ' : ''}}ele2" src="https://ucode-test-cdn.aax6.cn/front-end/project/junyao/junyaoH5/bottleImg/ele2.png" mode="widthFix" />
<image class="{{ start ? 'action ' : ''}}ele3" src="https://ucode-test-cdn.aax6.cn/front-end/project/junyao/junyaoH5/bottleImg/ele3.png" mode="widthFix" />
<image class="{{ start ? 'action ' : ''}}ele_ball" src="https://ucode-test-cdn.aax6.cn/front-end/project/junyao/junyaoH5/bottleImg/ele-ball.png" mode="widthFix" />
<image class="{{ start ? 'action ' : ''}}ele_gold" src="https://ucode-test-cdn.aax6.cn/front-end/project/junyao/junyaoH5/bottleImg/ele-gold.png" mode="widthFix" />
<image class="{{ start ? 'action ' : ''}}ele_milk" src="https://ucode-test-cdn.aax6.cn/front-end/project/junyao/junyaoH5/bottleImg/ele-milk.png" mode="widthFix" />
<image class="{{ start ? 'action ' : ''}}ele_milk1" src="https://ucode-test-cdn.aax6.cn/front-end/project/junyao/junyaoH5/bottleImg/ele-milk1.png" mode="widthFix" />
<image class="{{ start ? 'action ' : ''}}ele_milk2" src="https://ucode-test-cdn.aax6.cn/front-end/project/junyao/junyaoH5/bottleImg/ele-milk2.png" mode="widthFix" />
<image class="{{ start ? 'action ' : ''}}ele_milk3" src="https://ucode-test-cdn.aax6.cn/front-end/project/junyao/junyaoH5/bottleImg/ele-milk3.png" mode="widthFix" />
<image class="{{ start ? 'action ' : ''}}ele_redbag" src="https://ucode-test-cdn.aax6.cn/front-end/project/junyao/junyaoH5/bottleImg/ele-redbag.png" mode="widthFix" />
</view>
</view>
\ No newline at end of file
... ...
/* middlePage/pages/animal/ainmal.wxss */
Page {
width: 100%;
height: 100%;
background: url('https://ucode-test-cdn.aax6.cn/front-end/project/junyao/junyaoH5/bottleImg/bg_animal.png') no-repeat center/cover;
/* background: url('https://ucode-cdn.aax6.cn/front-end/project/junyao/junyaoH5/bottleImg/bg_home.png') no-repeat center/contain,
url('https://ucode-cdn.aax6.cn/front-end/project/junyao/junyaoH5/bottleImg/bg.png') no-repeat center/cover; */
}
.box {
width: 100%;
height: 100%;
position: relative;
background-color: rgba(0, 0, 0, 0.75);
}
.animal_box {
position: absolute;
left: 50%;
top: 0%;
transform: translateX(-50%);
width: 750rpx;
height: 100%;
}
@keyframes box_animal {
0% {
transform: translateX(-50%) rotate(0);
}
/* 50% {
transform: translateX(-50%) rotate(-10deg);
} */
100% {
transform: translateX(-50%) rotate(-13deg);
}
}
.bottle {
z-index: 2;
position: absolute;
left: 50%;
bottom: 42rpx;
transform: translateX(-50%);
/* width: 417rpx;
height: 1325rpx; */
width: calc(209rpx * 1.25);
height: calc(662rpx * 1.25);
}
.action.bottle {
animation: box_animal 0.3s ease-in-out 0s 1 normal forwards;
/* animation: box_animal 0.6s ease-in-out 0s 1 normal forwards; */
}
.cap {
z-index: 2;
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
width: calc(209rpx * 1.2);
height: calc(55rpx * 1.2);
transform-origin: left bottom;
/* width: 417rpx;
height: 110rpx; */
}
.action.cap {
animation: cap_animal 0.2s ease-in 0s 1 normal forwards;
}
@keyframes cap_animal {
0% {
left: 300rpx;
bottom: 700rpx;
transform: translateX(-50%) rotate(0);
}
100% {
left: 240rpx;
bottom: 700rpx;
transform: translateX(-50%) rotate(-110deg);
}
}
.ele1 {
z-index: 0;
position: absolute;
left: 50%;
bottom: 55rpx;
transform: translateX(-50%) scale(0);
width: 334rpx;
height: 105rpx;
}
.action.ele1 {
animation: ele1_pos_animal 0.6s ease-in 0.1s 1 normal forwards;
animation: ele1_pos_animal 0.2s ease-in 0.1s 1 normal forwards;
}
@keyframes ele1_pos_animal {
0% {
left: 260rpx;
bottom: 700rpx;
transform: translateX(-50%) rotate(0) scale(0);
}
30% {
left: 260rpx;
bottom: 970rpx;
transform: translateX(-50%) rotate(-35deg) scale(1);
}
41% {
left: 250rpx;
bottom: 1070rpx;
transform: translateX(-50%) rotate(-35deg) scale(1);
}
100% {
left: 300rpx;
bottom: 1200rpx;
transform: translateX(-50%) rotate(0deg) scale(1.2);
}
}
.ele2 {
position: absolute;
left: 280rpx;
bottom: 870rpx;
transform: translateX(-50%) scale(0);
width: 72rpx;
height: 69rpx;
}
.action.ele2 {
animation: ele2_pos_animal 0.6s ease-in 0.4s 1 normal forwards;
animation: ele2_pos_animal 0.2s ease-in 0.1s 1 normal forwards;
}
@keyframes ele2_pos_animal {
0% {
left: 280rpx;
bottom: 870rpx;
transform: translateX(-50%) rotate(0) scale(0);
}
30% {
left: 300rpx;
bottom: 970rpx;
transform: translateX(-50%) rotate(0) scale(1);
}
41% {
left: 300rpx;
bottom: 970rpx;
transform: translateX(-50%) rotate(0) scale(1);
}
100% {
left: 450rpx;
bottom: 1070rpx;
transform: translateX(-50%) rotate(0deg) scale(1.8);
}
}
.ele3 {
position: absolute;
left: 50%;
bottom: 700rpx;
transform: translateX(-50%) scale(0);
width: 68rpx;
height: 68rpx;
}
.action.ele3 {
animation: ele3_pos_animal 0.6s ease-in 0.8s 1 normal forwards;
animation: ele3_pos_animal 0.2s ease-in 0.1s 1 normal forwards;
}
@keyframes ele3_pos_animal {
0% {
left: 300rpx;
bottom: 770rpx;
transform: translateX(-50%) rotate(0) scale(0);
}
30% {
left: 320rpx;
bottom: 870rpx;
transform: translateX(-50%) rotate(-10deg) scale(1);
}
41% {
left: 420rpx;
bottom: 900rpx;
transform: translateX(-50%) rotate(0deg) scale(1.5);
}
100% {
left: 580rpx;
bottom: 770rpx;
transform: translateX(-50%) rotate(0deg) scale(1.5);
}
}
.ele_ball {
position: absolute;
left: 580rpx;
bottom: 970rpx;
transform: translateX(-50%) scale(0);
width: 158rpx;
height: 164rpx;
}
.action.ele_ball {
/* animation: ele_ball_animal 0.6s ease-in 0s 1 normal forwards; */
animation: ele_ball_animal 0.3s ease-in 0.1s 1 normal forwards;
}
@keyframes ele_ball_animal {
0% {
left: 300rpx;
bottom: 700rpx;
transform: translateX(-50%) scale(0);
}
50% {
left: 270rpx;
bottom: 950rpx;
transform: translateX(-50%) scale(0.3);
}
100% {
left: 290rpx;
bottom: 950rpx;
transform: translateX(-50%) scale(0.5);
}
}
.ele_gold {
position: absolute;
left: 50%;
bottom: 30%;
transform: translateX(-50%) scale(0);
width: 174rpx;
height: 168rpx;
}
.action.ele_gold {
/* animation: ele_gold_animal 0.6s ease-in 0s 1 normal forwards; */
animation: ele_gold_animal 0.3s ease-in 0.1s 1 normal forwards;
}
@keyframes ele_gold_animal {
0% {
left: 300rpx;
bottom: 700rpx;
transform: translateX(-50%) scale(0);
}
30% {
left: 320rpx;
bottom: 950rpx;
transform: translateX(-50%) scale(0.3);
}
70% {
left: 450rpx;
bottom: 1130rpx;
transform: translateX(-50%) scale(0.3);
}
100% {
left: 660rpx;
bottom: 1100rpx;
transform: translateX(-50%) scale(0.5);
}
}
.ele_milk {
position: absolute;
left: 400rpx;
bottom: 500rpx;
transform: translateX(-50%) rotate(15deg) scale(0);
width: 298rpx;
height: 372rpx;
}
.action.ele_milk {
/* animation: ele_milk_animal 0.6s ease-in 0s 1 normal forwards; */
animation: ele_milk_animal 0.3s ease-in 0.1s 1 normal forwards;
}
@keyframes ele_milk_animal {
0% {
left: 400rpx;
bottom: 500rpx;
transform: translateX(-50%) rotate(15deg) scale(0);
}
100% {
left: 290rpx;
bottom: 700rpx;
transform: translateX(-50%) rotate(0deg) scale(0.55);
}
}
.ele_milk1 {
position: absolute;
left: 300rpx;
bottom: 700rpx;
transform: translateX(-50%) scale(0);
width: 264rpx;
height: 150rpx;
}
.action.ele_milk1 {
/* animation: ele_milk1_animal 0.6s ease-in 0s 1 normal forwards; */
animation: ele_milk1_animal 0.3s ease-in 0.1s 1 normal forwards;
}
@keyframes ele_milk1_animal {
0% {
left: 300rpx;
bottom: 700rpx;
transform: translateX(-50%) scale(0);
}
50% {
left: 250rpx;
bottom: 800rpx;
transform: translateX(-50%) scale(0.3);
}
80%{
left: 180rpx;
bottom: 850rpx;
transform: translateX(-50%) scale(0.5);
}
100% {
left: 140rpx;
bottom: 800rpx;
transform: translateX(-50%) rotate(-15deg) scale(0.5);
}
}
.ele_milk2 {
position: absolute;
left: 300rpx;
bottom: 700rpx;
transform: translateX(-50%) scale(0);
width: 366rpx;
height: 264rpx;
}
.action.ele_milk2 {
/* animation: ele_milk2_animal 0.6s ease-in 0s 1 normal forwards; */
animation: ele_milk2_animal 0.3s ease-in 0.1s 1 normal forwards;
}
@keyframes ele_milk2_animal {
0% {
left: 300rpx;
bottom: 700rpx;
transform: translateX(-50%) scale(0);
}
50% {
left: 240rpx;
bottom: 800rpx;
transform: translateX(-50%) scale(0.3);
}
100% {
left: 130rpx;
bottom: 880rpx;
transform: translateX(-50%) scale(0.5);
}
}
.ele_milk3 {
position: absolute;
left: 300rpx;
bottom: 700rpx;
transform: translateX(-50%) scale(0);
width: 300rpx;
height: 252rpx;
}
.action.ele_milk3 {
/* animation: ele_milk3_animal 0.6s ease-in 0s 1 normal forwards; */
animation: ele_milk3_animal 0.3s ease-in 0.1s 1 normal forwards;
}
@keyframes ele_milk3_animal {
0% {
left: 300rpx;
bottom: 700rpx;
transform: translateX(-50%) scale(0);
}
50% {
left: 330rpx;
bottom: 790rpx;
transform: translateX(-50%) scale(0.3);
}
100% {
left: 480rpx;
bottom: 830rpx;
transform: translateX(-50%) scale(0.5);
}
}
.ele_redbag {
position: absolute;
left: 300rpx;
bottom: 700rpx;
transform: translateX(-50%) scale(0);
width: 380rpx;
height: 272rpx;
}
.action.ele_redbag {
/* animation: ele_redbag_animal 0.6s ease-in 0s 1 normal forwards; */
animation: ele_redbag_animal 0.3s ease-in 0.1s 1 normal forwards;
}
@keyframes ele_redbag_animal {
0% {
left: 300rpx;
bottom: 700rpx;
transform: translateX(-50%) scale(0);
}
50% {
left: 450rpx;
bottom: 850rpx;
transform: translateX(-50%) scale(0.3);
}
100% {
left: 600rpx;
bottom: 820rpx;
transform: translateX(-50%) scale(0.5);
}
}
... ...
// middlePage/privacyGps/privacyGps.js
const app = getApp();
Page({
data: {
showPrivacy: false,
showGps: false,
contentPrivacyImage: decodeURIComponent(
'https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Ftip_privacy.png'
),
btnPrivacyAgree: decodeURIComponent(
'https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Fbtn_agree.png'),
btnPrivacyReject: decodeURIComponent(
'https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Fbtn_reject.png'
),
contentGpsImage: decodeURIComponent(
'https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Ftip_gps.png'),
},
onLoad(options) {
// options.q='HTTP://JY.AAX6.CN/Y/FXYRLD*C3MVD2-0JS7'
// latitude=34.80829&longitude=118.05272&openId=ozn1a5I4Ie_Bv3gITzMPgcowEFOU&q=HTTP://AAX6.CN/JY/DT5I+67$R$:I$70-SJ2J&bgImage=https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Fbg.png&contentPrivacyImage=https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Ftip_privacy.png&btnPrivacyAgree=https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Fbtn_agree.png&btnPrivacyReject=https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Fbtn_reject.png&contentGpsImage=https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Ftip_gps.png&btnGpsSetting=https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Ftip_gps.png&btnGpsReject=https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Ftip_gps.png&path=https%3A%2F%2Fucode-test-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2FjunyaoH5%2Findex.html%23%2Fhome&title=%E5%91%B3%E5%8A%A8%E5%8A%9B
// let opt = {
// latitude: '34.80829',
// longitude: '118.05272',
// openId: 'ozn1a5I4Ie_Bv3gITzMPgcowEFOU',
// q: 'HTTP://AAX6.CN/JY/DT5I+67$R$:I$70-SJ2J',
// bgImage: 'https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Fbg.png',
// contentPrivacyImage: 'https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Ftip_privacy.png',
// btnPrivacyAgree: 'https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Fbtn_agree.png',
// btnPrivacyReject: 'https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Fbtn_reject.png',
// contentGpsImage: 'https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Ftip_gps.png',
// btnGpsSetting: 'https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Ftip_gps.png',
// btnGpsReject: 'https%3A%2F%2Fucode-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2Fminiprogram%2Ftip_gps.png',
// path: 'https%3A%2F%2Fucode-test-cdn.aax6.cn%2Ffront-end%2Fproject%2Fjunyao%2FjunyaoH5%2Findex.html%23%2Fhome',
// title: '%E5%91%B3%E5%8A%A8%E5%8A%9B',
// };
// options = opt
let transitionStrArr = []; // 登录后跳转的参数
Object.keys(JSON.parse(JSON.stringify(options))).map((keys) => {
transitionStrArr.push(`${keys}=${JSON.parse(JSON.stringify(options))?.[keys]}`);
});
this.transitionStr = transitionStrArr.join('&');
let decodeOptions = {}; // 当前页面参数
Object.keys(JSON.parse(JSON.stringify(options))).map((item) => {
decodeOptions[item] = decodeURIComponent(JSON.parse(JSON.stringify(options))?.[item]);
});
const {
isLogin,
bgImage,
contentPrivacyImage,
btnPrivacyAgree,
btnPrivacyReject,
contentGpsImage,
btnGpsSetting,
btnGpsReject,
path,
title,
...others
} = decodeOptions;
this.options = others; // 逻辑参数
if (isLogin) this.isLogin = true;
this.setData({
bgImage,
contentPrivacyImage,
btnPrivacyAgree,
btnPrivacyReject,
contentGpsImage,
btnGpsSetting,
btnGpsReject,
path,
title
});
// 设置页面title
wx.setNavigationBarTitle({
title,
success: (result) => {},
fail: () => {},
complete: () => {},
});
},
onShow() {
// 查询是否需要展示隐私条款弹窗
console.error('onshow --onShow');
wx.getPrivacySetting({
success: (res) => {
if (res.needAuthorization) {
// 用户未同意隐私政策,提示用户同意
this.setData({
showPrivacy: true
});
// wx.onNeedPrivacyAuthorization((resolve) => {
// this.resolvePrivacyAuthorization = resolve;
// });
} else {
// 用户已同意隐私政策,调用后台数据获取接口
this.getLocation();
}
},
fail() {
},
});
},
// 打开隐私条款页面
openPrivacyContract() {
wx.openPrivacyContract({
success: () => {}, // 打开成功
fail: () => {}, // 打开失败
complete: () => {},
});
},
// 隐私条款 拒绝
privacyReject() {
// this.resolvePrivacyAuthorization({ event: 'disagree' });
wx.exitMiniProgram({});
},
// 隐私条款 同意
privacyAgree() {
// this.resolvePrivacyAuthorization({ buttonId: 'agree-btn', event: 'agree' });
this.setData({
showPrivacy: false
});
this.getLocation();
},
async getLoginCode() {
return new Promise((resolve, reject) => {
wx.login({
success: (result) => {
resolve(result.code);
},
fail: () => {
reject(false);
},
complete: () => {},
});
});
},
// 获取gps
getLocation() {
wx.getSetting({
success: (res) => {
if (!res.authSetting['scope.userFuzzyLocation']) {
// 用户未授权,请求授权
wx.authorize({
scope: 'scope.userFuzzyLocation',
success: () => {
console.log(1111);
// 用户已授权,调用 getFuzzyLocation
this.getFuzzyLocation();
},
fail: (err) => {
console.error('授权失败:', err);
wx.showModal({
title: '提示',
content: '需要获取您的地理位置权限,请前往设置开启',
success: (modalRes) => {
if (modalRes.confirm) {
wx.openSetting(); // 打开设置页面
}
},
});
},
});
} else {
// 用户已授权,直接调用 getFuzzyLocation
this.getFuzzyLocation();
}
},
fail: (err) => {
console.error('获取设置失败:', err);
},
})
},
getFuzzyLocation() {
let userInfo = getApp().globalData.userInfo
if(userInfo?.token){
//用户已登录
let qrCode = "HTTP://JY.AAX6.CN/Y/NZU-NWL.2BDJ8F$:IA,0000003101"
let id = "33426877997676"
let pageData = encodeURIComponent(JSON.stringify(Object.assign({ qrCode,id }, {})))
wx.navigateTo({
url: `/scanGroup/dahaoda/index/index?pageData=${pageData}`
})
}
else{
//未登录
wx.getFuzzyLocation({
type: 'wgs84',
success: async (res) => {
const latitude = res.latitude;
const longitude = res.longitude;
this.jumpFun({
latitude,
longitude
});
},
fail: (err) => {
console.log(err,"err");
const latitude = 22.793763;
const longitude = 108.346942;
this.jumpFun({
latitude,
longitude
});
return
if (this.isLogin) {
this.gpsReject();
} else {
this.setData({
showGps: true
});
}
},
});
}
},
// 跳转逻辑
async jumpFun(latLong) {
const {
latitude,
longitude
} = latLong || {};
const subData = wx.getStorageSync('subData');
if (!subData || !Object.keys(subData)?.length) {
wx.reLaunch({
url: `/pages/login/login?router=${encodeURIComponent(`/middlePage/pages/privacyGps/privacyGps?isLogin=${true}&${this.transitionStr}`)}`,
});
} else {
const code = await this.getLoginCode();
let query = latLong ?
`t=${+new Date()}&code=${code}&latitude=${latitude}&longitude=${longitude}` :
`code=${code}`;
Object.keys(subData).map((v) => {
if (!query.includes(`${v}=`)) query += `&${v}=${subData[v]}`;
});
if (this.options) {
Object.keys(this.options).map((v) => {
if (!query.includes(`${v}=`)) query += `&${v}=${this.options[v]}`;
});
}
const webUrl = `${this.data.path}?${query}`;
this.setData({
webUrl,
showGps: false,
showPrivacy: false
});
}
},
// gps 拒绝
gpsReject() {
this.getLocation();
// this.setData({ showGps: false, showPrivacy: false });
// this.jumpFun();
},
// gps 同意
gpsSetting() {
wx.openSetting({
success: (result) => {
console.log(result, "result");
},
fail: () => {
},
complete: () => {
this.getLocation();
},
});
},
onShareAppMessage() {},
});
\ No newline at end of file
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<!-- middlePage/privacyGps/privacyGps.wxml -->
<!-- <view>隐私授权+gps</view> -->
<view class="modal" style="background-image: url('{{bgImage}}')">
<view class="mask" wx:if="{{showPrivacy || showGps}}"></view>
<view class="modal_content" wx:if="{{showPrivacy || showGps}}">
<!-- 隐私条款弹窗 -->
<view class="tip_privacy_box" wx:if="{{showPrivacy}}">
<image class="tip_privacy" bind:tap="openPrivacyContract" src="{{contentPrivacyImage}}" mode="widthFix" />
<view class="btn_privacy_box">
<image class="btn_privacy" id="disagree-btn" bind:tap="privacyReject" src="{{btnPrivacyReject}}" mode="widthFix" />
<button class="btn_privacy" id="agree-btn" style="background-image: url('{{btnPrivacyAgree}}')" type="default" open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="privacyAgree"></button>
</view>
</view>
<!-- GPS弹窗 -->
<view class="tip_gps_box" wx:if="{{showGps}}">
<image class="tip_gps" src="{{contentGpsImage}}" mode="widthFix" />
<view class="btn_gps_box">
<view class="btn_gps" bind:tap="gpsReject"></view>
<view class="btn_gps" bind:tap="gpsSetting"></view>
</view>
</view>
</view>
</view>
<web-view src="{{webUrl}}" wx:if="{{webUrl}}" bindmessage=""></web-view>
\ No newline at end of file
... ...
/* middlePage/privacyGps/privacyGps.wxss */
.modal {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background: no-repeat center center/cover;
z-index: -2;
}
.mask {
position: absolute;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.75);
z-index: -1;
}
.modal_content {
position: relative;
width: 685rpx;
margin-top: -20%;
text-align: center;
}
.btn_privacy_box {
width: 600rpx;
box-sizing: border-box;
display: flex;
justify-content: space-around;
margin: 0 auto;
margin-top: 68rpx;
}
.btn_privacy_box .btn_privacy {
width: 282rpx;
height: 106rpx;
background: no-repeat center center/cover;
}
.tip_gps_box {
width: 670rpx;
height: 456rpx;
padding: 0;
}
.tip_gps {
width: 670rpx;
height: 456rpx;
}
.btn_gps_box {
height: 100rpx;
width: 670rpx;
position: absolute;
bottom: 2rpx;
display: flex;
justify-content: center;
align-items: flex-start;
}
.btn_gps_box .btn_gps {
flex: 1;
height: 100%;
}
... ...
// middlePage/pages/scanTest/scanTest.jsPage({
Page({
data: {},
onLoad(options) {
this.options = options;
},
onShow() {
const webUrl = `https://ucode-cdn.aax6.cn/front-end/project/junyao/junyaoH5/index.html#/rule`;
console.log(webUrl, 'webUrl');
this.setData({ webUrl });
},
onShareAppMessage() {},
});
... ...
{
"navigationBarTitleText": "味动力测试环境",
"usingComponents": {}
}
\ No newline at end of file
... ...