ソースを参照

FirstCommit

master
HolyKnightIX 2週間前
コミット
b1245f7eca
100個のファイルの変更5254行の追加0行の削除
  1. +5
    -0
      .gitignore
  2. バイナリ
      F53dxaEHpucqec703969e52f567a74953916a631cb8a.bin
  3. +408
    -0
      app.js
  4. +162
    -0
      app.json
  5. +132
    -0
      app.wxss
  6. バイナリ
      assets/images/QRCODE.png
  7. バイナリ
      assets/images/avatar8.png
  8. バイナリ
      assets/images/avatar9.png
  9. バイナリ
      assets/images/certification.png
  10. バイナリ
      assets/images/chevron.png
  11. バイナリ
      assets/images/confirm.png
  12. バイナリ
      assets/images/default.png
  13. バイナリ
      assets/images/delete.png
  14. +5
    -0
      assets/images/desktop.ini
  15. バイナリ
      assets/images/fail.png
  16. バイナリ
      assets/images/gift.png
  17. バイナリ
      assets/images/home-a.png
  18. バイナリ
      assets/images/home-a_red.png
  19. バイナリ
      assets/images/home.png
  20. バイナリ
      assets/images/mendian-a.png
  21. バイナリ
      assets/images/mendian.png
  22. バイナリ
      assets/images/merchantImgCover.png
  23. バイナリ
      assets/images/negatived.png
  24. バイナリ
      assets/images/next.png
  25. バイナリ
      assets/images/park-a.png
  26. バイナリ
      assets/images/park.png
  27. バイナリ
      assets/images/parking.png
  28. バイナリ
      assets/images/password-close.png
  29. バイナリ
      assets/images/password-show.png
  30. バイナリ
      assets/images/picture.png
  31. バイナリ
      assets/images/scan.png
  32. バイナリ
      assets/images/siteImg.png
  33. バイナリ
      assets/images/user-a.png
  34. バイナリ
      assets/images/user.png
  35. バイナリ
      assets/images/waitingConfirm.png
  36. バイナリ
      assets/images/wechat.png
  37. +40
    -0
      components/advertisement/advertisement.js
  38. +4
    -0
      components/advertisement/advertisement.json
  39. +12
    -0
      components/advertisement/advertisement.wxml
  40. +47
    -0
      components/advertisement/advertisement.wxss
  41. +96
    -0
      components/banner/index.js
  42. +3
    -0
      components/banner/index.json
  43. +20
    -0
      components/banner/index.wxml
  44. +83
    -0
      components/banner/index.wxss
  45. +133
    -0
      components/commodityMould/commodityMould.js
  46. +4
    -0
      components/commodityMould/commodityMould.json
  47. +65
    -0
      components/commodityMould/commodityMould.wxml
  48. +260
    -0
      components/commodityMould/commodityMould.wxss
  49. +62
    -0
      components/coupons/index.js
  50. +6
    -0
      components/coupons/index.json
  51. +62
    -0
      components/coupons/index.wxml
  52. +384
    -0
      components/coupons/index.wxss
  53. +32
    -0
      components/customModal/customModal.js
  54. +3
    -0
      components/customModal/customModal.json
  55. +13
    -0
      components/customModal/customModal.wxml
  56. +62
    -0
      components/customModal/customModal.wxss
  57. +366
    -0
      components/dateLsit/dateLsit.js
  58. +3
    -0
      components/dateLsit/dateLsit.json
  59. +15
    -0
      components/dateLsit/dateLsit.wxml
  60. +136
    -0
      components/dateLsit/dateLsit.wxss
  61. +32
    -0
      components/discountCard/index.js
  62. +6
    -0
      components/discountCard/index.json
  63. +5
    -0
      components/discountCard/index.wxml
  64. +6
    -0
      components/discountCard/index.wxss
  65. +98
    -0
      components/gameentry/gentry.js
  66. +6
    -0
      components/gameentry/gentry.json
  67. +9
    -0
      components/gameentry/gentry.wxml
  68. +28
    -0
      components/gameentry/gentry.wxss
  69. +142
    -0
      components/hot/index.js
  70. +4
    -0
      components/hot/index.json
  71. +60
    -0
      components/hot/index.wxml
  72. +156
    -0
      components/hot/index.wxss
  73. +1
    -0
      components/navbar/img/back.svg
  74. +1
    -0
      components/navbar/img/home.svg
  75. +81
    -0
      components/navbar/navbar.js
  76. +3
    -0
      components/navbar/navbar.json
  77. +20
    -0
      components/navbar/navbar.wxml
  78. +105
    -0
      components/navbar/navbar.wxss
  79. +59
    -0
      components/optimization/optimization.js
  80. +4
    -0
      components/optimization/optimization.json
  81. +43
    -0
      components/optimization/optimization.wxml
  82. +227
    -0
      components/optimization/optimization.wxss
  83. +71
    -0
      components/shareposter/index.js
  84. +3
    -0
      components/shareposter/index.json
  85. +14
    -0
      components/shareposter/index.wxml
  86. +46
    -0
      components/shareposter/index.wxss
  87. +100
    -0
      components/shop/shop.js
  88. +3
    -0
      components/shop/shop.json
  89. +62
    -0
      components/shop/shop.wxml
  90. +222
    -0
      components/shop/shop.wxss
  91. +45
    -0
      components/spellbanner/index.js
  92. +6
    -0
      components/spellbanner/index.json
  93. +14
    -0
      components/spellbanner/index.wxml
  94. +51
    -0
      components/spellbanner/index.wxss
  95. +78
    -0
      components/store/index.js
  96. +3
    -0
      components/store/index.json
  97. +19
    -0
      components/store/index.wxml
  98. +76
    -0
      components/store/index.wxss
  99. +460
    -0
      config/config.js
  100. +262
    -0
      custom-tab-bar/index.js

+ 5
- 0
.gitignore ファイルの表示

@@ -0,0 +1,5 @@
/jsconfig.json
/ext.json
/project.config.json
/.vscode/**
.DS_Store

バイナリ
F53dxaEHpucqec703969e52f567a74953916a631cb8a.bin ファイルの表示

変更前 変更後
幅: 2100  |  高さ: 2970  |  サイズ: 227 KiB

+ 408
- 0
app.js ファイルの表示

@@ -0,0 +1,408 @@
let config = require("./config/config.js");
const { defaultObj, huanLeChengObj } = require("./utils/mouldStyle.js")
const Http = require("./utils/HttpBasics");
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}

let businessSwitch = extConfig.attr.businessSwitch ? extConfig.attr.businessSwitch : false

if (businessSwitch) {
var myPluginInterface = requirePlugin('auto-points-plugin')
}
App({
data: {
newArr: [], //存放分享二维进入消息信息
businessSwitch: businessSwitch || null, //判断是否开启商圈自助积分
},

onLaunch: function (options) {
// wx.hideTabBar()
var that = this;
if (that.globalData.previewFlag) { //解决微信图片预览重复进入app.js onshow
that.globalData.previewFlag = false
return
}
if (options.query.scene) {
that.globalData.newArr = decodeURIComponent(options.query.scene).split(":");
}
that.globalData.sceneAddress = options.scene
/**
* 小程序版本更新
*/
that.autoUpdate();
/**
* 用户登录
*/
that.userLogin(options.scene);
wx.getSystemInfo({
success: res => {
that.statusBarHeight = res.statusBarHeight
}
})

},

onShow: function (options) {
//自助积分 需要openId 且必须写在onshow里面
let _this = this
if (businessSwitch && wx.getStorageSync('openId')) {
myPluginInterface.getLocation(wx.getStorageSync('openId')).then(res => { console.log("商圈位置授权onS") })
}
// if (businessSwitch) {
// wx.login({
// success: (res) => {
// if (wx.getStorageSync('openId')) {
// myPluginInterface.getLocation(wx.getStorageSync('openId')).then(res => {})
// } else {
// if (res.code) {
// let usrdata = {
// appId: config.weapp.AppId,
// code: res.code,
// }
// Http.post({
// url: config.api.login,
// data: usrdata
// }).then(res => {
// if (_this.data.businessSwitch) {
// myPluginInterface.getLocation(res.data.openId).then(res => {
// console.log(res, "我是地理位置")
// })
// }
// })
// }
// }

// }
// })
// }


},
statusBarHeight: 0,
/**
* 用户登录
*/
userLogin: function (sceneAddress) {
let that = this;
// 登录
wx.login({
success: ({
code
}) => {
let usrdata = {
appId: config.weapp.AppId,
code: code,
sceneAddress: sceneAddress
}
if (that.globalData.newArr && that.globalData.newArr[1] == 'in_u') {
usrdata.UId = that.globalData.newArr[2]
} else if (that.globalData.newArr && that.globalData.newArr[1] == 'md') {
usrdata.MId = that.globalData.newArr[2]
}
Http.post({
url: config.api.login,
data: usrdata
})
.then(res => {
console.log(res.data, "login!!!!!!!!!!!");
const isAgreeProtocol = res.data.agreeProtocol ? 1 : 0
wx.setStorageSync("isAgreeProtocol", isAgreeProtocol)

if (res.data.mall) {
that.globalData.marketName = res.data.mall.name ? res.data.mall.name : ""
}
wx.setStorageSync('openId', res.data.openId)
if (businessSwitch && res.data.openId) {
myPluginInterface.getLocation(res.data.openId).then(res => { console.log("商圈位置授权onL") }).catch(err => {
console.log(err, "商圈位置授权onL err")
})
}
if (res.data && res.data.mouldType == 0) {//原风格尺寸
this.globalData.goHomeUrl = "/index/index"
this.globalData.mouldConfig = defaultObj
} else if (res.data && res.data.mouldType == 1) {
this.globalData.goHomeUrl = "/pages/theme/index1/index"
this.globalData.mouldConfig = huanLeChengObj
}
that.globalData.mouldType = res.data.mouldType ? res.data.mouldType : 0
if (res.data.subMalls) {
const squareList = JSON.parse(res.data.subMalls)
wx.setStorageSync("squareList", squareList)
}
if (res.data.mall) {
wx.setStorageSync("selectedMall", res.data.mall.tenantId)
}
if (res.data && res.data.score) {
if (res.data.score != 0) {
that.globalData.score = res.data.score;
}
}
Http.setToken(res.data.token);
that.globalData.token = res.data.token;
console.log(that.tokenCallback, "that.tokenCallback")


if (that.tokenCallback) {
that.tokenCallback(res.data.token);
}
})
.catch(err => {
console.log(err)
wx.showModal({
title: '提示',
showCancel: false,
content: '登录失败,请重新尝试',
success: function (res) {
if (res.cancel) {
//点击取消,默认隐藏弹框
} else {
//点击确定
wx.reLaunch({
url: '/pages/index/index',
})
}
}
})
})
}
})
},
autoUpdate: function () {
let that = this;
if (wx.canIUse('getUpdateManager')) {
const updateManager = wx.getUpdateManager()
// 1. 检查小程序是否有新版本发布
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
if (res.hasUpdate) {
// 检测到新版本,需要更新,给出提示
wx.showModal({
title: '更新提示',
content: '检测到新版本,是否下载新版本并重启小程序?',
success: function (res) {
if (res.confirm) {
//2. 用户确定下载更新小程序,小程序下载及更新静默进行
that.downLoadAndUpdate(updateManager)
} else if (res.cancel) {
//用户点击取消按钮的处理,如果需要强制更新,则给出二次弹窗,如果不需要,则这里的代码都可以删掉了
wx.showModal({
title: '温馨提示~',
content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~',
showCancel: false, //隐藏取消按钮
confirmText: "确定更新", //只保留确定更新按钮
success: function (res) {
if (res.confirm) {
//下载新版本,并重新应用
that.downLoadAndUpdate(updateManager)
}
}
})
}
}
})
}
})
} else {
// 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
wx.showModal({
title: '提示',
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
})
}
},

/**
* 下载小程序新版本并重启应用
*/
downLoadAndUpdate: function (updateManager) {
let that = this
wx.showLoading();
//静默下载更新小程序新版本
updateManager.onUpdateReady(function () {
wx.hideLoading()
//新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
})
updateManager.onUpdateFailed(function () {
// 新的版本下载失败
wx.showModal({
title: '已经有新版本了哟~',
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~',
})
})
},
globalData: {
userName: "",//用户名
userAvatarUrl: "",//用户头像地址
goHomeUrl: '/index/index',
mouldConfig: {},//模板尺寸
mouldType: 0,//主题风格模板
styleLsit: {},
previewFlag: false, //解决图片预览调用noshow
activityId: '', //活动id方便授权数据回传
typeLsit: [], //初始哈样式
scene: "",
// token
token: null,
// user openId
openId: null,
// 渠道
sceneAddress: null,
// location info
locationInfo: null,
// 二维码参数
scene: null,
// 支持智慧停车, 用户名下有车
phone: null,
supportCar: false,
parkVendor: 1, // 1-ETCP, 2-TJD停简单 3-Dahua大华, 4-ShangAn尚安, 5-BoLink泊链
// ETCP token
etcpToken: null,
carLogin: false,
marketName: "",//商场,名称
// 当前商场信息
market: {
name: ""
},
// websocket
socketClient: null,
socketReceiver: function (e) { }, //收到消息回调
curHtml: '', //富文本相关,由于浏览器传参长度有限制
},

// 初始化websocket
initSocket: function () {
let that = this;
// socket是否连接
let socketConnected = false;
// 待发送的消息队列
let messageQueue = [];
// 是否断线重连
let reconnect = true;

// 发送消息
function sendSocketMessage(msg) {
// console.log(msg);
// 如果socket已连接则发送消息
if (socketConnected) {
wx.sendSocketMessage({
data: msg
})
} else {
// socket没有连接将消息放入队列中
messageQueue.push(msg);
}
}

// 关闭连接
function close() {
if (socketConnected) {
wx.closeSocket()
socketConnected = false;
}
}

// 符合WebSocket定义的对象
var ws = {
send: sendSocketMessage,
close: close
}

// 创建一个 WebSocket 连接
function connect() {
wx.connectSocket({
url: config.wsurl,
header: {
token: that.globalData.token //从服务端获取一个token,服务端验证token是否允许连接,案例中没做限制
}
})
}
connect();

// 监听 WebSocket 连接打开事件
wx.onSocketOpen(function (res) {
console.log("WebSocket 连接成功")
socketConnected = true;
ws.onopen();
// 连接成功后,将队列中的消息发送出去
let queueLength = messageQueue.length
for (let i = 0; i < queueLength; i++) {
sendSocketMessage(messageQueue.shift())
}
})

// 监听 WebSocket 接受到服务器的消息事件
wx.onSocketMessage(function (res) {
ws.onmessage(res);
})

// 监听 WebSocket 错误事件
wx.onSocketError(function (res) {
console.log("WebSocket 错误事件")
if (!socketConnected) {
// 断线重连
if (reconnect) {
connect();
}
}
})

// 监听 WebSocket 连接关闭事件
wx.onSocketClose(function (res) {
console.log("WebSocket 连接关闭")
socketConnected = false;
// 断线重连
if (reconnect) {
connect();
}
})

const Stomp = require('/utils/stomp.min.js').Stomp;

/**
* 定期发送心跳或检测服务器心跳
* The heart-beating is using window.setInterval() to regularly send heart-beats and/or check server heart-beats.
* 可看stomp.js的源码(195,207,489行),由于小程序没有window对象,所以我们要调用小程序的定时器api实现
*/
Stomp.setInterval = function (interval, f) {
return setInterval(f, interval);
};
// 结束定时器的循环调用
Stomp.clearInterval = function (id) {
return clearInterval(id);
};

const stompClient = Stomp.over(ws);

that.globalData.socketClient = stompClient;

stompClient.connect({}, function (callback) {

// 订阅自己的
stompClient.subscribe('/user/' + config.weapp.AppId + '/' + that.globalData.openId + '/message', function (message, headers) {
console.log('收到只发送给我的消息:', message);
that.globalData.socketReceiver(JSON.parse(message.body));
// 通知服务端收到消息
message.ack();
});

stompClient.subscribe('/topic/' + config.weapp.AppId, function (message, headers) {
console.log('收到TOPIC的消息:', message);
that.globalData.socketReceiver(JSON.parse(message.body));
// 通知服务端收到消息
//message.ack();
});

// 向服务端发送消息
stompClient.send("/app/message", {}, JSON.stringify({
'msg': 'client: ' + that.globalData.openId
}));
})
},

//统一发送消息
sendSocketMessage: function (msg) {
this.globalData.socketClient.send("/app/message", {}, JSON.stringify(msg));
}
});
// wxfa336cad86ed598d 测试
// wx453ae0d37f3550d0 生产

+ 162
- 0
app.json ファイルの表示

@@ -0,0 +1,162 @@
{
"pages": [
"pages/index/index",
"pages/main/index",
"index/searchbar",
"index/passCar",
"index/user",
"index/index",
"pages/searchbar/searchbar",
"pages/integralmall/integraHistory/index",
"pages/integralmall/payIntegcouponStatus/index",
"pages/integralmall/payIntegcoupondetail/index",
"pages/joinFrDpell/index",
"pages/spellDetail/index",
"pages/radetail/success/index",
"pages/spellTimeout/index",
"pages/spellGroup/mySpellGroup/index",
"pages/spellGroup/spellGroup",
"pages/complete/index",
"pages/topicDetail/index",
"pages/acSignIn/index",
"pages/index/merchantList/index",
"pages/index/searchbar/detail/index",
"pages/bargain/bargainDatail/bargainDatail",
"pages/bargain/bargain",
"pages/cardorder/index/index",
"pages/scanPay/scanPay",
"pages/edit/edit",
"pages/radetail/index",
"pages/radetail/joinActivity/edit",
"pages/bannerdetail/index",
"pages/getuserinfo/index",
"pages/phoneinput/phoneinput",
"pages/user/myactivity/index",
"pages/coupon/detail/index",
"pages/rushToBuy/index",
"pages/couponorder/index/index",
"pages/couponorder/detail/index",
"pages/cardorder/detail/index",
"pages/cardorder/userule/userule",
"pages/order/detail/index",
"pages/order/index/index",
"pages/ques/ques",
"pages/getphoneInfo/index",
"pages/addPark/addPark",
"pages/orderquanma/index",
"pages/passCar/couponList/couponList",
"pages/passCar/couponDetail/couponDetail",
"pages/passCar/showList/showList",
"pages/passCar/showDetail/showDetail",
"pages/managelicenseplate/managelicenseplate",
"pages/payrule/payrule",
"pages/grade/grade",
"pages/gradeII/gradeII",
"pages/game/index",
"pages/canvas/index",
"pages/specialcourtesy/specialcourtesy",
"pages/discountCardList/discountCardList",
"pages/cardListDetail/cardListDetail",
"pages/freeBannerDetail/index",
"pages/paySuccess/paySuccess",
"pages/ConsumeDetail/ConsumeDetail",
"pages/externallinks/index",
"pages/czdetail/czdetail",
"pages/spellGroup/paySpellGroup/index",
"pages/integralmall/index",
"pages/mallInfo/mallInfo",
"pages/location/location",
"pages/tcExplain/tcExplain",
"pages/marketAtlas/marketAtlas",
"pages/shareFriend/shareFriend",
"components/dateLsit/dateLsit",
"pages/dateLsit/dateLsit",
"pages/activityCalendar/activityCalendar",
"pages/questionnaire/questionnaire",
"pages/questionnaire/questionnaireLsit/questionnaireLsit",
"pages/site/site",
"pages/siteUser/siteUser",
"pages/siteAdd/siteAdd",
"pages/fillIndent/fillIndent",
"pages/coupon/childDetail/childDetail",
"pages/theme/index1/index",
"pages/cardorder/cardUse/cardUse"
],
"subpackages": [
{
"root": "pages2",
"name": "pages2",
"independent": false,
"pages": [
"live/livelist/index",
"fengMap/fengMap"
]
},
{
"root": "pages3",
"name": "pages3",
"pages": [
"setUserInfo/index",
"userProtocol/userProtocol",
"privateProtocol/privateProtocol",
"exchangeCard/exchangeCard",
"exchange/exchange",
"complaint/complaint",
"resume/resume"
]
}
],
"navigateToMiniProgramAppIdList": [
"wx192b7d2e8dcbefd0",
"wxc07f9d67923d676d",
"wxbd08b4baa10fcc1d"
],
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"tabBar": {
"custom": true,
"list": [
{
"pagePath": "index/index",
"iconPath": "assets/images/home.png",
"selectedIconPath": "assets/images/home-a.png",
"text": "首页"
},
{
"pagePath": "index/searchbar",
"iconPath": "assets/images/mendian.png",
"selectedIconPath": "assets/images/mendian-a.png",
"text": "门店"
},
{
"pagePath": "index/passCar",
"iconPath": "assets/images/park.png",
"selectedIconPath": "assets/images/park-a.png",
"text": "停车"
},
{
"pagePath": "index/user",
"iconPath": "assets/images/user.png",
"selectedIconPath": "assets/images/user-a.png",
"text": "我的"
}
]
},
"usingComponents": {},
"window": {
"backgroundTextStyle": "dark",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTitleText": "",
"navigationBarTextStyle": "black",
"navigationStyle": "custom"
},
"networkTimeout": {
"request": 30000,
"downloadFile": 10000
},
"debug": false,
"sitemapLocation": "sitemap.json"
}

+ 132
- 0
app.wxss ファイルの表示

@@ -0,0 +1,132 @@
/* @import "weui.wxss"; */
@font-face {
font-family: "iconfont"; /* project id 777313 */
src: url("//at.alicdn.com/t/font_777313_jq7td4d3uab.eot");
src: url("//at.alicdn.com/t/font_777313_jq7td4d3uab.eot?#iefix")
format("embedded-opentype"),
url("//at.alicdn.com/t/font_777313_jq7td4d3uab.woff") format("woff"),
url("//at.alicdn.com/t/font_777313_jq7td4d3uab.ttf") format("truetype"),
url("//at.alicdn.com/t/font_777313_jq7td4d3uab.svg#iconfont") format("svg");
}

.iconfont {
font-family: "iconfont" !important;
font-size: 36rpx;
font-style: normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2rpx;
-moz-osx-font-smoothing: grayscale;
}
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
/* 定位 */
.icon-dingweib:before {
content: "\e652";
}
/* 三角 */
.icon-choose:before {
content: "\e601";
}
/* 右箭头 */
.icon-right:before {
content: "\e612";
}

/* 边框 */

.app-border-top,
.app-border-bottom {
position: relative;
width: 100%;
}

.app-border-top::after,
.app-border-bottom::after {
content: "";
position: absolute;
background-color: #ddd;
display: block !important;
z-index: 1;
top: auto;
right: auto;
width: 100%;
height: 1rpx;
transform-origin: 50% 100%;
transform: scaleY(0.5);
}

.app-border-top:last-child:after,
.app-border-bottom:last-child::after {
display: none !important;
}

.app-border-top::after {
top: 0;
}

.app-border-bottom::after {
bottom: 0;
}

.app-border-left,
.app-border-right {
position: relative;
height: 100%;
}

.app-border-left::before,
.app-border-right::before {
content: "";
position: absolute;
background-color: #ddd;
display: block;
z-index: 1;
top: 0;
bottom: 0;
height: 100%;
width: 1rpx;
transform-origin: 50% 100%;
transform: scaleX(0.5);
}

.app-border-left::before {
left: 0;
}

.app-border-right::before {
right: 0;
}
view,
text {
font-family: PingFangSC-Regular;
}
page {
width: 100%;
min-height: 100vh;
font-weight: 400;
padding-bottom: 160rpx;
background: #F4F5F9;
}
.fl{
float: left;
}
.fr{
float: right;
}
.canWrap{
position: fixed;
bottom: -20000rpx;
left: -2000rpx;
width: 100%;
height: 100%;
overflow: visible;
}
.canWrap canvas{
width: 690rpx;
height: 450rpx;
}

バイナリ
assets/images/QRCODE.png ファイルの表示

変更前 変更後
幅: 128  |  高さ: 128  |  サイズ: 1.9 KiB

バイナリ
assets/images/avatar8.png ファイルの表示

変更前 変更後
幅: 200  |  高さ: 200  |  サイズ: 6.4 KiB

バイナリ
assets/images/avatar9.png ファイルの表示

変更前 変更後
幅: 200  |  高さ: 200  |  サイズ: 6.0 KiB

バイナリ
assets/images/certification.png ファイルの表示

変更前 変更後
幅: 32  |  高さ: 32  |  サイズ: 979 B

バイナリ
assets/images/chevron.png ファイルの表示

変更前 変更後
幅: 16  |  高さ: 30  |  サイズ: 376 B

バイナリ
assets/images/confirm.png ファイルの表示

変更前 変更後
幅: 128  |  高さ: 128  |  サイズ: 4.1 KiB

バイナリ
assets/images/default.png ファイルの表示

変更前 変更後
幅: 32  |  高さ: 32  |  サイズ: 1.3 KiB

バイナリ
assets/images/delete.png ファイルの表示

変更前 変更後
幅: 400  |  高さ: 400  |  サイズ: 15 KiB

+ 5
- 0
assets/images/desktop.ini ファイルの表示

@@ -0,0 +1,5 @@
[LocalizedFileNames]
user-b.png=@user-b,0
park-b.png=@park-b,0
mendian-b.png=@mendian-b,0
home-b.png=@home-b,0

バイナリ
assets/images/fail.png ファイルの表示

変更前 変更後
幅: 200  |  高さ: 200  |  サイズ: 8.3 KiB

バイナリ
assets/images/gift.png ファイルの表示

変更前 変更後
幅: 857  |  高さ: 691  |  サイズ: 66 KiB

バイナリ
assets/images/home-a.png ファイルの表示

変更前 変更後
幅: 52  |  高さ: 52  |  サイズ: 2.5 KiB

バイナリ
assets/images/home-a_red.png ファイルの表示

変更前 変更後
幅: 52  |  高さ: 52  |  サイズ: 2.3 KiB

バイナリ
assets/images/home.png ファイルの表示

変更前 変更後
幅: 52  |  高さ: 52  |  サイズ: 1.0 KiB

バイナリ
assets/images/mendian-a.png ファイルの表示

変更前 変更後
幅: 52  |  高さ: 52  |  サイズ: 2.8 KiB

バイナリ
assets/images/mendian.png ファイルの表示

変更前 変更後
幅: 52  |  高さ: 52  |  サイズ: 1006 B

バイナリ
assets/images/merchantImgCover.png ファイルの表示

変更前 変更後
幅: 128  |  高さ: 128  |  サイズ: 1.7 KiB

バイナリ
assets/images/negatived.png ファイルの表示

変更前 変更後
幅: 600  |  高さ: 572  |  サイズ: 62 KiB

バイナリ
assets/images/next.png ファイルの表示

変更前 変更後
幅: 200  |  高さ: 200  |  サイズ: 2.5 KiB

バイナリ
assets/images/park-a.png ファイルの表示

変更前 変更後
幅: 52  |  高さ: 52  |  サイズ: 3.2 KiB

バイナリ
assets/images/park.png ファイルの表示

変更前 変更後
幅: 52  |  高さ: 52  |  サイズ: 1.7 KiB

バイナリ
assets/images/parking.png ファイルの表示

変更前 変更後
幅: 128  |  高さ: 128  |  サイズ: 4.5 KiB

バイナリ
assets/images/password-close.png ファイルの表示

変更前 変更後
幅: 200  |  高さ: 200  |  サイズ: 5.5 KiB

バイナリ
assets/images/password-show.png ファイルの表示

変更前 変更後
幅: 128  |  高さ: 128  |  サイズ: 3.0 KiB

バイナリ
assets/images/picture.png ファイルの表示

変更前 変更後
幅: 512  |  高さ: 512  |  サイズ: 28 KiB

バイナリ
assets/images/scan.png ファイルの表示

変更前 変更後
幅: 128  |  高さ: 128  |  サイズ: 2.7 KiB

バイナリ
assets/images/siteImg.png ファイルの表示

変更前 変更後
幅: 32  |  高さ: 32  |  サイズ: 985 B

バイナリ
assets/images/user-a.png ファイルの表示

変更前 変更後
幅: 52  |  高さ: 52  |  サイズ: 2.6 KiB

バイナリ
assets/images/user.png ファイルの表示

変更前 変更後
幅: 52  |  高さ: 52  |  サイズ: 1.4 KiB

バイナリ
assets/images/waitingConfirm.png ファイルの表示

変更前 変更後
幅: 128  |  高さ: 128  |  サイズ: 4.4 KiB

バイナリ
assets/images/wechat.png ファイルの表示

変更前 変更後
幅: 200  |  高さ: 200  |  サイズ: 6.7 KiB

+ 40
- 0
components/advertisement/advertisement.js ファイルの表示

@@ -0,0 +1,40 @@
// components/advertisement.js
const Http = require("../../utils/HttpBasics");
var config = require("../../config/config.js");
Component({
properties: {
ggdata: {
type: Object,
value: {}
}
},
data: {
flag: false,
alphaData1: null,
},
methods: {
gotoGg: function (e) {
console.log(this.data.ggdata)
let that = this;
/* wx.navigateTo({
url: '/pages/coupon/detail/index?couponChannelId=' + e.currentTarget.dataset.data.produceId+'&g=1',
}) */
wx.navigateTo({
url: `/${that.data.ggdata.pagePath}&g=1`,
})
},
a: function () {
this.setData({ flag: false })
},
closeGg: function () {
let that = this;
var animation = wx.createAnimation({})
// animation.opacity(0).step({ duration: 1000 })
setTimeout(function () {
that.setData({ flag: true })
}, 500)
animation.rotateZ(180).scale(0).opacity(0.5).step({ duration: 1000 })
that.setData({ alphaData1: animation.export() });
},
},
});

+ 4
- 0
components/advertisement/advertisement.json ファイルの表示

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

+ 12
- 0
components/advertisement/advertisement.wxml ファイルの表示

@@ -0,0 +1,12 @@
<!--components/advertisement.wxml-->
<view class="b1" hidden="{{flag}}">
<view class='b3'>
<view class="t_w">
<view class="b2" animation="{{alphaData}}">
<icon type="cancel" size="30" color="#fff" class='cancel_icon' bindtap="closeGg"/>
<!-- <view class='line'></view> -->
<image class="t_image" data-data="{{ggdata}}" mode='widthFix' src="{{ggdata.coverImg}}" bindtap="gotoGg" data-couponChannelId="{{ggdata.produceId}}" />
</view>
</view>
</view>
</view>

+ 47
- 0
components/advertisement/advertisement.wxss ファイルの表示

@@ -0,0 +1,47 @@
/* components/advertisement.wxss */
.b1{
position:fixed;
width:100%;
height:100%;
top:0px;
background:rgba(0,0,0,0.8);
overflow: hidden;
z-index: 1000;
}
.b3{
/* margin:0 auto; */
width:100%;
height:100%;
position:relative;
}
.t_w{
width: 100%;
position: absolute;
top: 50%;
left: 50%;
margin-top: -50%;
margin-left: -50%;
}
.b2{
overflow: hidden;
border-radius: 10rpx;
}
.t_image{
width: 70%;
border-radius: 16rpx;
display: block;
margin: 0 auto;
}
.cancel_icon{
position: absolute;
right: 65rpx;
top: -40rpx;
}
.line{
width:2rpx;
height: 75rpx;
background: #fff;
position: absolute;
right: 370rpx;
bottom: -125rpx;
}

+ 96
- 0
components/banner/index.js ファイルの表示

@@ -0,0 +1,96 @@
// pages/index/sw/index.js
const imgurl = require("../../utils/imgurl");
const app = getApp()

Component({
/**
* 组件的属性列表
*/
properties: {
list: {
value: [],
type: Array
}
},

/**
* 组件的初始数据
*/
data: {
bannerUrl: imgurl.banner.url,
currentIndex: 0,
mouldType: 0,
},

/**
* 组件的方法列表
*/
methods: {
gotobannerdetail: function(e) {
console.log(this.data.list)
if (e.currentTarget.dataset.data.type == 3) {
// 小程序路径
let indexOf = (e.currentTarget.dataset.data.pagePath).indexOf("=");
console.log(indexOf, "123")
let id = (e.currentTarget.dataset.data.pagePath).substring(indexOf);
let type = (e.currentTarget.dataset.data.pagePath).substr(indexOf + 1, 2) // 2020/7/22 变量获取pagePath中的type
console.log(indexOf, id, type);
console.log(e.currentTarget.dataset.data.pagePath)
if (type == 'cd' || type == 'sd') {
wx.navigateTo({
url: `/${e.currentTarget.dataset.data.pagePath}`,
})
} else if (type == "wj") {
wx.navigateTo({
url: `/pages/questionnaire/questionnaire?id=${id}`,
})
} else if (type == 'ra') {
wx.navigateTo({
url: `/pages/radetail/index?id=${id}`,
})
}
} else if (e.currentTarget.dataset.data.type == 2) {
// 自由图文
wx.navigateTo({
url: `/pages/freeBannerDetail/index?id=${e.currentTarget.dataset.id}`
});
} else if (e.currentTarget.dataset.data.type == 4) {
let tempObj = {

appId: e.currentTarget.dataset.data.goAppid,
// path: 'page/index/index?id=123',
// extraData: {
// foo: 'bar'
// },
// envVersion: 'develop',
success(res) {
// 打开成功
}

}
if (e.currentTarget.dataset.data.pagePath){
tempObj.path = e.currentTarget.dataset.data.pagePath
}
wx.navigateToMiniProgram(tempObj)
} else {
// 固定格式
wx.navigateTo({
url: `/pages/bannerdetail/index?id=${e.currentTarget.dataset.id}`
});
}
},
handleChange: function(e) {
this.setData({
currentIndex: e.detail.current
})
},
},
attached: function() {
// 在组件实例进入页面节点树时执行
if (app.globalData.mouldType) {
this.setData({
mouldType: app.globalData.mouldType
})
}
},
});

+ 3
- 0
components/banner/index.json ファイルの表示

@@ -0,0 +1,3 @@
{
"component": true
}

+ 20
- 0
components/banner/index.wxml ファイルの表示

@@ -0,0 +1,20 @@
<!-- 原风格尺寸 -->
<view wx:if="{{list.length>0&&mouldType==0}}" class="index-slide-view">
<swiper class="imageContainer" bindchange="handleChange" previous-margin="39rpx" next-margin="40rpx" circular autoplay>
<block wx:for="{{list}}" wx:key="index">
<swiper-item class="item">
<image data-id="{{item.id}}" data-data="{{item}}" bindtap='gotobannerdetail' class="itemImg {{currentIndex == index ? 'active': ''}}" src="{{item.coverImg}}"></image>
</swiper-item>
</block>
</swiper>
</view>
<!-- 欢乐城风格尺寸 -->
<view wx:if="{{list.length>0&&mouldType==1}}" class="index-slide-view">
<swiper class="imageContainer1" bindchange="handleChange" indicator-color indicator-active-color="#fff" indicator-dots previous-margin="40rpx" next-margin="40rpx" circular autoplay>
<block wx:for="{{list}}" wx:key="index">
<swiper-item class="item1">
<image data-id="{{item.id}}" data-data="{{item}}" bindtap='gotobannerdetail' class="itemImg1 {{currentIndex == index ? 'active1_a': 'active1'}}" src="{{item.coverImg}}"></image>
</swiper-item>
</block>
</swiper>
</view>

+ 83
- 0
components/banner/index.wxss ファイルの表示

@@ -0,0 +1,83 @@
.imageContainer {
width: 100%;
height: 304rpx;
}
.imageContainer1 {
width: 100%;
height: 400rpx;
}

.itemImg {
position: absolute;
width: 640rpx;
height: 227rpx;
border-radius: 15rpx;
overflow: hidden;
z-index: 5;
opacity: 0.7;
top: 20%;
margin: 0 20rpx;
}

.active {
opacity: 1;
z-index: 10;
width: 640rpx;
height: 270rpx;
top: 11%;
transition: all 0.2s ease-in 0s;
}

.item {
width: 100%;
height: 304rpx;
overflow: hidden;
border-radius: 16rpx;
}

.item1 {
width: 100%;
height: 360rpx;
overflow: hidden;
border-radius: 16rpx;
}

.index-slide-view {
margin-top: -30rpx;
}
.index-slide-view1 {
margin-top: -40rpx;
}



.itemImg1 {
position: absolute;
width: 640rpx;
height: 360rpx;
border-radius: 15rpx;
overflow: hidden;
z-index: 5;
opacity: 0.7;
top: 12%;
margin: 0 20rpx;
}

.active1_a {
opacity: 1;
z-index: 10;
width: 640rpx;
top: 11%;
transition: all 0.2s ease-in 0s;
}

.active1 {
opacity: 1;
z-index: 10;
width: 640rpx;
height: 310rpx;
top: 17%;
transition: all 0.2s ease-in 0s;
}



+ 133
- 0
components/commodityMould/commodityMould.js ファイルの表示

@@ -0,0 +1,133 @@
const util = require("../../utils/util");
Component({
/**
* 组件的属性列表 util.toHHmmss(res.data.endTime,);
*/
properties: {
special:{
type: Boolean,
value: false
},
titleImgUrl:{
type:String,
value:"",
},
isShowCount:{
type: Boolean,
value: false
},
obj:{
type:Object,
value:{}
}
},

/**
* 组件的初始数据
*/
data: {
setIntervalLsit:[]
},

attached: function () {
let this_ =this
let arr = []
let tempLsit = []
// 处理首页定时
if (this_.properties.obj.couponList!=null&&this_.properties.obj.couponList.length>0){
//限时抢购 倒计时
this_.properties.obj.couponList.map((item,index)=>{//初次渲染
if (item.targetAd==2){
let tempObj = {}
let beginTime = item.beginTime;//开始时间
let endTime = item.endTime;//结束时间
let present = new Date().getTime()//当前时间
let textTime = item.beginTime >= present?"距开始":"距结束"
tempObj={
value: item.beginTime >= present ? beginTime - present : endTime - present,
valueText: item.beginTime >= present ? util.toHHmmss(beginTime - present) : util.toHHmmss(endTime - present),
// vaFlag: tempObj.value<=0?true:false,//活动是否结束
index:index,
interval:"" ,
beginTime: beginTime,//开始时间
endTime: endTime,//开始时间
textTime: textTime
}
arr.push(tempObj)
this_.setData({
setIntervalLsit: arr
})
}
})
}
tempLsit =this_.data.setIntervalLsit
tempLsit.map((item,index)=>{//再次渲染
item.interval = setInterval(function(){
let present = new Date().getTime()//当前时间
if(item.value<=1){
clearInterval(item.interval)
item.vaFlag = true,//活动是否结束
console.log(item.value, "活动已经结束")
}else{
let tempTime = item.beginTime >= present ? item.beginTime - present : item.endTime - present
// console.log(tempTime, "presents")
item.value = tempTime,
item.valueText = util.toHHmmss(tempTime - 1000)
item.textTime = item.beginTime >= present ? "距开始" : "距结束",
item.vaFlag= item.value <= 0 ? true : false,//活动是否结束
this_.setData({
setIntervalLsit: tempLsit
})
}
},1000)
})
// 处理首页定时
},
detached: function () {
this.data.setIntervalLsit.map(item=>{
clearInterval(item.interval)
})
console.log("88888")
// 在组件实例被从页面节点树移除时执行 ;
},

/**
* 组件的方法列表
*/
methods: {
lookAll(){
wx.navigateTo({
url: `/${this.properties.obj.weappPath}`,
})
},
goDetail(e){
console.log(e.currentTarget.dataset)
let couponChannelId = e.currentTarget.dataset.id
let couponId = e.currentTarget.dataset.couponid
let type = e.currentTarget.dataset.type
if (type==9){
wx.navigateTo({
url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${couponChannelId}&couponId=${couponId}`,
})
}else{
wx.navigateTo({
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`,
})
}

},
gotoTopic(e) {

let id = e.currentTarget.dataset.id
wx.navigateTo({
url: `/pages/topicDetail/index?id=${id}`
})
},
}
})

+ 4
- 0
components/commodityMould/commodityMould.json ファイルの表示

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

+ 65
- 0
components/commodityMould/commodityMould.wxml ファイルの表示

@@ -0,0 +1,65 @@
<!-- <view class='product' wx:if="{{showTopic}}" bindtap='gotoTopic'>
<image src='{{cover}}' mode='widthFix'></image>
</view> -->

<view wx:if="{{obj.couponList.length>0||obj.isOnlyAd==1}}">
<view class='product' bindtap='gotoTopic' data-id="{{obj.id}}" wx:if="{{obj.isOnlyAd==1}}">
<image class="img" src='{{obj.cover}}' mode='scaleToFill'></image>
</view>


<view class="commBox" wx:if="{{obj.topicType!=1||(obj.topicType==1&&obj.isOnlyAd==0)}}">
<view class="titleBox">
<image class="titleImg" src="{{titleImgUrl}}" wx:if="{{!special}}"></image>
<view class="specialTitle" wx:if="{{special}}">{{obj.name}}</view>
<view class="more" bindtap="lookAll">查看更多优惠活动
<image class="rup" src="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_icon_jt.png"></image>
</view>
</view>

<view class="contBox">
<view class="topImg" wx:if="{{obj.cover}}" bindtap="lookAll">
<image class="img" src="{{obj.cover}}" mode='scaleToFill'></image>
</view>
<div class="itemBox" wx:if="{{obj.couponList&&obj.couponList.length>0}}">
<view class="item" wx:for="{{obj.couponList}}" wx:key="index" bindtap="goDetail" data-type="{{item.type}}" data-id="{{item.id}}" data-couponid="{{item.couponId}}">
<view class="itemImg">
<image class="img" src="{{item.coverImg}}" mode='scaleToFill'></image>
<view class="sellout" wx:if="{{item.remainInventory==0}}">
<image class="selloutImg" src="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_img_ysx.png"></image>
</view>

</view>
<view class="titleNameBox">
<view class="titleName">{{item.title}}</view>
</view>

<view class="priceBox">
<view class="sellingBox f">
<view class="fuhao">¥</view>
<view class="int" wx:if="{{item.type!=50}}">{{item.salePriceStrQ?item.salePriceStrQ:item.salePriceStr}}</view>
<view class="fuhao" wx:if="{{item.type!=50}}">{{item.salePriceStrH?'.'+item.salePriceStrH:''}}</view>

<view class="int" wx:if="{{item.type==50}}">{{item.creditPrice}}</view>
<view class="fuhao" wx:if="{{item.type==50}}"> 积分</view>
</view>
<view class="originalBox r">
<view class="origina">¥{{item.priceStr}}</view>
</view>
</view>
<view class="countBox" wx:if="{{isShowCount}}">
<view class="countText f">{{setIntervalLsit[index].textTime}}</view>
<view class="countDate r">{{setIntervalLsit[index].vaFlag?'活动已结束':setIntervalLsit[index].valueText}}</view>
</view>
</view>
<view class="item moreItem" bindtap="lookAll">
<view class="noDataImg">
<image class="img" src="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_img_zwlp_1.png"></image>
</view>
<view class="noDataText">查看更多优惠活动</view>
</view>
</div>
</view>
</view>

</view>

+ 260
- 0
components/commodityMould/commodityMould.wxss ファイルの表示

@@ -0,0 +1,260 @@
.commBox {
width: 96%;
margin: 27rpx auto;
background-color: #fff;
border-radius: 20rpx;
overflow: hidden;
}

.titleBox {
width: 100%;
overflow: hidden;
height: 140rpx;
background-image: url("https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_icon_d9qt.png");
background-size: 100% 100%;
background-repeat: no-repeat;
}

.titleImg {
width: 180rpx;
height: 40rpx;
float: left;
margin: 20rpx;
display: block;
}

.specialTitle {
float: left;
margin: 10rpx 20rpx;
font-size: 38rpx;
font-family: YouSheBiaoTiHei;
font-weight: 600;
color: #37332d;
}

.more {
float: right;
font-size: 24rpx;
font-family: OPPOSans;
font-weight: 500;
color: #866741;
margin: 16rpx 20rpx;
}

.rup {
width: 13rpx;
height: 20rpx;
margin: 2rpx 0 0 6rpx;
}

.contBox {
overflow: hidden;
/* width: 96%; */
margin: -50rpx auto 0 auto;
}

.topImg {
width: 100%;
height: 140rpx;
border-radius: 16rpx;
margin-bottom: 40rpx;
/* background-color: chartreuse; */
}

.topImg .img {
border-radius: 16rpx;
width: 100%;
height: 100%;
}

.itemBox {
overflow: hidden;
display: -webkit-box;
overflow-x: scroll;
-webkit-overflow-scrolling: touch;
margin: 20rpx auto;
width: 96%;
}

.itemBox::-webkit-scrollbar {
display: none;
}

.item {
width: 240rpx;
/* background-color: antiquewhite; */
margin-right: 20rpx;
}

.itemImg {
position: relative;
width: 240rpx;
height: 240rpx;
border-radius: 16rpx;
/* background-color: aquamarine; */
}

.itemImg .img {
width: 100%;
height: 100%;
border-radius: 16rpx;
}

.sellout {
position: absolute;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.5);
width: 240rpx;
height: 240rpx;
border-radius: 20rpx;
}

.selloutImg {
width: 195rpx !important;
height: 154rpx !important;
margin: 18% auto;
display: block;
}

.titleNameBox {
/* font-size: 18px; */
height: 80rpx;
line-height: 40rpx;
display: flex;
align-items: center;
justify-content: center;
}

.titleName {
width: 100%;
font-size: 28rpx;
font-family: OPPOSans;
font-weight: 500;
color: #333;
margin-top: 10rpx;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}

.priceBox {
overflow: hidden;
margin: 10rpx 0;
}

.f {
float: left;
}

.r {
float: right;
}

.sellingBox {
overflow: hidden;
}

.fuhao {
color: #df2d2d;
font-size: 24rpx;
float: left;
font-family: OPPOSans;
/* font-weight: bold; */
margin-top: 10rpx;
}

.int {
float: left;
font-size: 36rpx;
font-family: OPPOSans;
font-weight: bold;
color: #df2d2d;
}

.originalBox {
overflow: hidden;
}

.origina {
text-align: right;
font-size: 24rpx;
font-family: OPPOSans;
font-weight: 400;
text-decoration: line-through;
color: #999;
margin-top: 10rpx;
margin-right: 10rpx;
}

.countBox {
width: 100%;
height: 46rpx;
background-image: url("https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_icon_bq.png");
background-size: 100% 100%;
background-repeat: no-repeat;
margin-bottom: 20rpx;
line-height: 46rpx;
overflow: hidden;
}

.countText {
font-size: 22rpx;
font-family: OPPOSans;
font-weight: 400;
color: #999;
background: linear-gradient(180deg, #dcb07d 0%, #f5e0bf 100%);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
margin-left: 8rpx;
}

.countDate {
font-size: 24rpx;
font-family: OPPOSans;
font-weight: bold;
color: #4c3820;
margin-right: 8rpx;
}

.moreItem {
background: #f7f7f7;
border-radius: 8px;
}

.noDataImg {
width: 160rpx;
height: 160rpx;
margin: 25% auto 5% auto;
}

.noDataImg .img {
width: 100%;
height: 100%;
}

.noDataText {
text-align: center;
font-size: 22rpx;
font-family: OPPOSans;
font-weight: 500;
color: #999;
margin-top: 50rpx;
}

.product {
width: 96%;
height: 140rpx;
margin: 30rpx auto 10rpx;
border-radius: 16rpx;
overflow: hidden;
}

.product .img {
height: 100%;
display: block;
width: 100%;
}

+ 62
- 0
components/coupons/index.js ファイルの表示

@@ -0,0 +1,62 @@
const app = getApp()
const Http = require("../../utils/HttpBasics");
const config = require("../../config/config");
Component({
/**
* 组件的属性列表
*/
properties: {
paramAtoB: String,
from: String,
data: {
value: {},
type: Object
},
},

/**
* 组件的初始数据
*/
data: {
mouldType: 0,
mouldConfig: {},
couponListShowSelled: ''
},
attached: function () {
// 在组件实例进入页面节点树时执行
if (app.globalData.mouldType) {
this.setData({
mouldType: app.globalData.mouldType,
mouldConfig: app.globalData.mouldConfig
})
}

Http.get({
url: config.api.couponListShowSelled,
}).then(res => {
this.setData({
couponListShowSelled: res.data || ""
})
}).catch(err => {

})

},
methods: {
gotoDetail(e) {
let couponId = e.currentTarget.dataset.couponid;
let title = e.currentTarget.dataset.title;
let id = e.currentTarget.dataset.id;
let targetAd = e.currentTarget.dataset.targetad;
if (id && targetAd != 7) {
wx.navigateTo({
url: `/pages/coupon/detail/index?couponChannelId=${id}&couponId=${couponId}&title=${title}`,
})
} else if (targetAd == 7) {
wx.navigateTo({
url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${id}&couponId=${couponId}&title=${title}`,
})
}
}
}
});

+ 6
- 0
components/coupons/index.json ファイルの表示

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"i-button": "../../dist/button/index"
}
}

+ 62
- 0
components/coupons/index.wxml ファイルの表示

@@ -0,0 +1,62 @@
<view class='navigator' bindtap='gotoDetail' data-id='{{data.id}}' data-targetAd='{{data.targetAd}}' hover-class='hover' data-couponId='{{data.couponId}}' data-title='{{data.title}}'>
<view class="presell" wx:if="{{data.type==10}}" style="{{mouldType==1?'top: 280rpx;':''}}">预售 </view>
<!-- 首页优惠券列表页面 -->
<view class="coupons">
<!-- fromMerchant 根据这个字段判断 -->
<view class="superscript" wx:if="{{from == 'fromMerchant'}}">
<!-- 角标的三种实现 -->
<view class="rect" style='background: #31b968;' wx:if="{{data.targetAd == 2}}"></view>
<view class="rect" style='background: orange;' wx:if="{{data.targetAd == 6}}"></view>
<view class="rect" style='background: #d900ae;' wx:if="{{data.targetAd == 7}}"></view>
<view class="rect" style='background: #5dae01;' wx:if="{{data.targetAd == 5}}"></view>
<view class="desc" wx:if="{{data.targetAd == 2}}">限时券</view>
<view class="desc" wx:if="{{data.targetAd == 6}}">砍价券</view>
<view class="desc" wx:if="{{data.targetAd == 7}}">拼团券</view>
<view class="desc" wx:if="{{data.targetAd == 5}}">消费卡</view>
</view>
<view class="coupons-img">
<image class="img" src="{{data.coverImg}}" style="{{mouldConfig.imgHomeH}}" mode='aspectFill' lazy-load="true"></image>
</view>
<view class="coupons-info">
<view class="coupons-info-name tit">{{data.title}}</view>
<text class='saleRamin' wx:if="{{couponListShowSelled && couponListShowSelled==1}}">已售{{data.inventory - data.remainInventory}}</text>
<view class="coupons-info-name subtitle">{{data.subTitle}}</view>
<view class="coupons-info-price-p">
<view class='price' wx:if="{{data.type!=10}}">
<text wx:if="{{data.targetAd == 1||data.targetAd == 5}}"><text class='rmb'>¥</text>
<text class='num'>{{data.salePriceStr}}</text>
<text wx:if="{{!(data.type==5&&data.unit==1)}}" class='view02'>¥{{data.priceStr}}</text></text>
<text wx:if="{{data.targetAd == 2}}"><text class='saleprice'>抢购价</text>
<text class='rmb'>¥</text>{{data.salePriceStr}}</text>

<text wx:if="{{data.targetAd == 6}}"><text class='saleprice'>可砍至</text>
<text class='rmb'>¥</text>{{data.salePriceStr}}</text>
<text wx:if="{{data.targetAd == 7}}"><text class='saleprice'>拼团价</text>
<text class='rmb'>¥</text>{{data.salePriceStr}}</text>

<view class="coupons-info-manjian" style="margin-top:10rpx;" wx:if="{{data.type == 1}}">
<!-- <view class='view01' wx:if="{{data.unit==0}}">¥{{data.priceStr}}</view> -->
<view wx:if="{{data.unit==1}}">{{data.priceStr}}小时</view>
</view>
<view class="coupons-info-manjian" wx:elif="{{data.type == 3||data.type==4||data.type==5}}">
<!-- <text class='view01' wx:if="{{data.unit==0}}">¥{{data.priceStr}}</text> -->
<text class="text" wx:if="{{data.unit==1}}">{{data.priceStr}}小时</text>
</view>
</view>
<view class="earnest" wx:if="{{data.type==10}}">
预售定金:¥{{data.salePriceStr}}
</view>
</view>
</view>
<view class="coupons-btn">
<!-- 优惠券价格 -->
<i-button i-class="coupons-btn-gm" wx:if="{{data.salePriceStr==0&&data.remainInventory!=0&&data.targetAd == 1}}" data-date='{{data}}'>免费领</i-button>
<i-button i-class="coupons-btn-gm" wx:if="{{data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 1||data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 5}}" data-date='{{data}}'>购买</i-button>
<i-button i-class="coupons-btn-gm" wx:if="{{data.remainInventory!=0&&data.targetAd == 2}}" data-date='{{data}}'>去抢购</i-button>
<i-button i-class="coupons-btn-gm" wx:if="{{data.remainInventory!=0&&data.targetAd == 6}}" data-date='{{data}}'>去砍价</i-button>
<i-button i-class="coupons-btn-gm" wx:if="{{data.remainInventory!=0&&data.targetAd == 7}}" data-date='{{data}}'>去拼团</i-button>
<i-button i-class="coupons-btn-gms" wx:if="{{data.remainInventory==0}}" data-date='{{data}}'>已售罄</i-button>
<i-button i-class="coupons-btn-gms" wx:if="{{data.status==1}}" data-date='{{data}}'>已下架</i-button>
</view>
</view>
</view>

+ 384
- 0
components/coupons/index.wxss ファイルの表示

@@ -0,0 +1,384 @@
@import "../../app.wxss";

.coupons {
position: relative;
width: 340rpx;
display: inline-block;
overflow: hidden;
border-radius: 12rpx;
}

.earnest {
color: red;
font-size: 24rpx;
padding-left: 10rpx;
}

.coupons-border {
height: 1rpx;
left: 30rpx;
right: 30rpx;
background: #f5f5f5;
position: absolute;
bottom: 0;
}

.coupons-img .img {
display: block;
width: 300rpx;
height: 176rpx;
margin: 20rpx auto 0;
/* border-top-left-radius: 10rpx;
border-top-right-radius: 10rpx; */
}

.coupons-info {
width: 90%;
height: 152rpx;
border-radius: 0rpx 0rpx 10rpx 10rpx;
background: #fff;
margin: 0 auto;
}

.coupons-info-name {
font-size: 30rpx;
color: #3c3c3c;
letter-spacing: 0;
line-height: 38rpx;
}

.coupons-info-price {
padding: 16rpx 0 0;
}

.i {
font-size: 24rpx;
font-style: normal;
}

.coupons-info-price-p {
display: inline-block;
font-size: 50rpx;
margin-bottom: 26rpx;
width: 100%;
}



.price {
font-size: 36rpx;
font-family: PingFang-SC-Bold;
font-weight: bold;
line-height: 44rpx;
margin-left: 16rpx;
padding-top: 16rpx;
color: #fd832d;
width: 60%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.rmb {
font-size: 24rpx !important;
margin-right: 4rpx !important;
color: #FD782D !;
}

.num {
color: #fd782d;
}

.tit {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 28rpx;
line-height: 32rpx;
padding-top: 20rpx;
padding-left: 10rpx;
color: #333;
letter-spacing: 0;
}

.saleRamin {
position: absolute;
font-size: 25rpx;
bottom: 60rpx;
right: 25rpx;
color: #b4b4b4;
}

.coupons-info-price-o {
display: block;
text-align: center;
font-size: 26rpx;
color: #b4b4b4;
letter-spacing: 0.96rpx;
text-decoration: line-through;
line-height: 24rpx;
}

.coupons-info-distance {
font-size: 22rpx;
color: #c0c0c0;
letter-spacing: 0;
padding-bottom: 10rpx;
line-height: 30rpx;
}

.coupons-info-address {
font-size: 22rpx;
color: #585858;
letter-spacing: 0;
line-height: 30rpx;
}

.coupons-btn {
position: absolute;
bottom: 14rpx;
right: 24rpx;
}

.coupons-btn-gm {
border-radius: 10px !important;
margin: 0 !important;
padding: 0 !important;
font-size: 26rpx;
color: #fff !important;
letter-spacing: 0;
height: 42rpx !important;
width: 80rpx !important;
line-height: 42rpx !important;
background: linear-gradient(127deg, rgba(252, 177, 74, 1) 0%, rgba(254, 70, 20, 1) 100%) !important;
}

.coupons-btn-gms {
background: #b9b9b9 !important;
border-radius: 10px !important;
opacity: 0.6;
margin: 0 !important;
padding: 0 !important;
font-family: PingFangSC-Semibold;
font-size: 26rpx;
font-weight: 400;
color: #fff !important;
letter-spacing: 0;
height: 51rpx !important;
width: 100rpx !important;
line-height: 51rpx !important;
}

.subtitle {
font-size: 24rpx;
color: #999;
overflow: hidden;
height: 24rpx;
width: 65%;
padding-left: 10rpx;
line-height: 24rpx;
white-space: nowrap;
text-overflow: ellipsis;
margin-top: 12rpx;
}

.coupons-info-manjian {
font-weight: normal;
font-size: 20rpx;
line-height: 34rpx;
display: inline-block;
color: #ff4949;
letter-spacing: 0;
}

.coupons-info-manjian1 {
font-weight: normal;
font-size: 20rpx;
line-height: 22rpx;
color: #919191;
letter-spacing: 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 300rpx;
margin-top: 16rpx;
}

.coupons-info-manjian .text {
display: block;
line-height: 20rpx;
}

.coupons-info-manjian>.text:nth-of-type(1) {
display: block;
/* color: #FF4949; */
opacity: 0.6;
}

.view02 {
font-size: 20rpx;
line-height: 34rpx;
text-decoration: line-through;
color: #999 !important;
font-weight: normal;
letter-spacing: 0;
margin-left: 10rpx;
}

.view01 {
text-decoration: line-through;
color: #999 !important;
}

.txt2 {
display: block;
color: #ccc;
}

/**上拉加载更多**/

.userinfo {
display: flex;
flex-direction: column;
align-items: center;
}

.userinfo-avatar {
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
}

.userinfo-nickname {
color: #aaa;
}

.sy {
display: block;
text-align: right;
width: 181rpx;
font-size: 24rpx;
color: #999;
height: 40rpx;
margin-top: 106rpx;
}

.usermotto {
margin-top: 200px;
}

scroll-view {
width: 100%;
}

.item {
width: 90%;
height: 300rpx;
margin: 20rpx auto;
background: brown;
overflow: hidden;
}

.item .img {
width: 430rpx;
margin-right: 20rpx;
float: left;
}

.title {
font-size: 30rpx;
display: block;
margin: 30rpx auto;
}

.description {
font-size: 26rpx;
line-height: 15rpx;
}

.navigator-hover {
opacity: 1 !important;
background: #fff;
}

.hover {
opacity: 0.6;
}

.navigator {
display: inline-block;
background: #fff;
border-radius: 12rpx;
position: relative;
}

.presell {
position: absolute;
width: 300rpx;
height: 40rpx;
background-color: rgba(247, 21, 21, 0.6);
z-index: 100;
top: 158rpx;
line-height: 20px;
text-align: center;
color: #fff;
margin-left: 20rpx;
font-size: 26rpx;
}

/* .navigator:nth-of-type(2n+1) {
margin-right: 10rpx;
} */

.superscript {
position: absolute;
top: -10rpx;
left: -12rpx;
width: 86rpx;
height: 86rpx;
overflow: hidden;
}

/* 使用背景色渐变 */

.superscript .gradual {
width: 100%;
height: 100%;
background: linear-gradient(135deg, #31b968 50%, transparent 50%);
}

/* 使用三角形 */

.superscript .triangle {
width: 0;
height: 0;
border-top: 130rpx solid #31b968;
border-right: 130rpx solid transparent;
}

/* 使用矩形旋转, 和父节点的 overflow:hidden 配合 */

.superscript .rect {
width: 176rpx;
height: 183rpx;
margin: -91rpx 0 0 -91rpx;
transform: rotateZ(45deg);
}

.superscript .desc {
position: absolute;
top: 29%;
left: 16%;
z-index: 1;
color: #fff;
font-size: 23rpx;
transform: rotate(-45deg);
}

.saleprice {
font-size: 24rpx;
display: inline-block;
margin-right: 10rpx;
font-weight: 400;
}

+ 32
- 0
components/customModal/customModal.js ファイルの表示

@@ -0,0 +1,32 @@
Component({
properties: {
visible: {
type: Boolean,
value: false,
},
text: {
type: String,
value: '模态框内容',
},
},
methods: {
exit() {
this.triggerEvent('exit');
},
continue() {
this.triggerEvent('continue');
},

goUser() {
wx.navigateTo({
url: '/pages3/userProtocol/userProtocol',
})
},

goPrivate() {
wx.navigateTo({
url: '/pages3/privateProtocol/privateProtocol',
})
},
},
});

+ 3
- 0
components/customModal/customModal.json ファイルの表示

@@ -0,0 +1,3 @@
{
"component": true
}

+ 13
- 0
components/customModal/customModal.wxml ファイルの表示

@@ -0,0 +1,13 @@
<view class="modal" wx:if="{{visible}}">
<view class="modal-content">
<view class="title">用户协议及隐私保护</view>
<view class="mainContent">
为了更好地保障您的合法权益,请阅读并同意<text class="protocol" bind:tap="goUser">用户协议</text>、<text class="protocol" bind:tap="goPrivate">隐私条款</text>
</view>
<view class="bottomBtn">
<view class="btn exit" style=" border-right:1px solid #929292;" bind:tap="exit">退出</view>
<view class="btn continue" bind:tap="continue">同意并继续</view>
</view>
</view>

</view>

+ 62
- 0
components/customModal/customModal.wxss ファイルの表示

@@ -0,0 +1,62 @@
.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
}

.modal-content {
background-color: white;
color: #7a7a7a;
padding-top: 20rpx;
border-radius: 20rpx;
width: 80%;
}

.modal-content .protocol {
color: #0c66db;
}

.modal-content .title {
/* color: #000; */
font-weight: 600;
font-size: 34rpx;
text-align: center;
margin-bottom: 15rpx;
}

.modal-content .mainContent {
text-indent: 2em;
font-size: 32rpx;
line-height: 50rpx;
margin-bottom: 15rpx;
padding: 0 20rpx 20rpx 20rpx;
}

.modal-content .bottomBtn {
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid #929292;
}

.modal-content .bottomBtn .btn {
width: 50%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
}

.modal-content .bottomBtn .btn.exit {
/* color: #ff204e; */
}

.modal-content .bottomBtn .btn.continue {
/* color: #0c66db; */
/* font-weight: 600; */
}

+ 366
- 0
components/dateLsit/dateLsit.js ファイルの表示

@@ -0,0 +1,366 @@
const imgurl = require("../../utils/imgurl");
const util = require("../../utils/util");
const Http = require("../../utils/HttpBasics");
const config = require("../../config/config");
Component({
/**
* 组件的属性列表
*/
properties: {
activityStyle: String,
allFlag: Boolean,
childUrl: String,
},
/**
* 组件的初始数据
*/
data: {
week: ['日', '一', '二', '三', '四', '五', '六'],
dateLsit: [],
year: new Date().getFullYear(),
month: new Date().getMonth() + 1,
yearFlgh: new Date().getFullYear(), //当前年
monthFlgh: new Date().getMonth() + 1, //当前月
dey: new Date().getDate(),
thendata: [], //当前这一周的数组
xiala: imgurl.concealBnt.url,
xiangshang: imgurl.xiangshang.url,
switchFlag: true,
activityDateList: [],
activiyFalg:"",
context: -1 ,//-1表示取一周下标 1表示取一个月的下标
},

/**
* 组件的方法列表
*/
methods: {
itiActivityLst() { //初始哈活动列表
let tempDateLsit = this.data.dateLsit
let tempThenData = this.data.thendata
this.data.activityDateList.map(item0 => { //初始化当月 标记
tempDateLsit.map(item1 => {
if (item0.yyyy == item1.y && item0.mm == item1.m && item0.dd == item1.value) {
item1.act = 1
}
})
})
this.data.activityDateList.map(item0 => { //初始化 当周标记
tempThenData.map(item1 => {
if (item0.yyyy == item1.y && item0.mm == item1.m && item0.dd == item1.value) {
item1.act = 1
}
})
})
this.setData({
dateLsit: tempDateLsit,
thendata: tempThenData
})
this.setThenDye(0)
},

getDey() { //查询当月标记日期
let tempMonth = this.data.month
let tempDey = this.getDays(this.data.year, this.data.month) //获取每月有多少天
if (tempMonth < 10) {
tempMonth = '0' + (tempMonth + '')
}
let param = {
startDate: this.data.year + '-' + tempMonth + "-01" + " 00:00:00",
endDate: this.data.year + "-" + tempMonth + "-" + tempDey + " 23:59:59"
}
Http.get({
url: this.data.childUrl,
data: param
}).then(res => {
let {
code,
data
} = res
if (code == 200) {
this.setData({
activityDateList: data
})
this.showDate(this.data.year, this.data.month)
}
})
},
switchs() {
let temp = this.data.switchFlag
this.setData({
switchFlag: !temp
})
if(this.data.switchFlag){
this.setData({
context:-1
})
this.setThenDye()
}else{
this.setData({
context: 1
})
this.setThenDye()
}
// console.log(this.data.switchFlag)
},
showDate(year, month) { //刷新日历
let thenDey = this.getThenWeek(year, month) //每个月第一天星期几
let thenMonth = this.getDays(year, month) //获取每月有多少天
let lastMonth = this.getLastMonth(year, month) //上月最后一天是多少天
let tempDey = []
let tmepArr = []
for (let i = 0; i < 42; i++) { //初始化日历数组
tempDey.splice(i, 0, "")
}
for (let i = 0; i < thenMonth; i++) { //获取当前选中月份天数
tmepArr.splice(i, 0, {
style: "0",
value: i + 1,
y: year,
m: month
})
}
tempDey.splice(thenDey, thenMonth, ...tmepArr)
for (let i = 0; i < thenDey; i++) { //添加上一个月的天数
tempDey.splice(i, 1, {
style: "1",
value: lastMonth - (thenDey - 1),
y: year,
m: month==1?12:month-1
})
lastMonth++
}
for (let i = 0; i < 42 - (thenDey + thenMonth); i++) { //设置下一个月
tempDey.splice(thenDey + thenMonth + i, 1, {
style: "2",
value: i + 1,
y: year,
m: month == 12 ? 1 : month + 1
})
}
this.setData({
dateLsit: tempDey
})
this.itiActivityLst()
this.setThenDye()
},

setThenDye(){//设置当天index
if (this.data.context==-1){//-1表示一周
console.log(this.data.thendata,this.data.dey,this.data.monthFlgh,this.data.yearFlgh,"this.data.thendata")
let index_ = ""
this.data.thendata.map((item,index)=>{
if(item.value == this.data.dey && this.data.monthFlgh == item.m && item.y == this.data.yearFlgh){
index_ = index
this.setData({
activiyFalg: index_
})
return
}
})
}else{
let index_ = ""
if(this.data.year==this.data.yearFlgh&&this.data.month==this.data.monthFlgh){
this.data.dateLsit.map((item, index) => {
if (item.value == this.data.dey && this.data.monthFlgh == item.m && item.y == this.data.yearFlgh) {
console.log(index, "index")
index_ = index
this.setData({
activiyFalg: index_
})
return
}
})
}else{
this.setData({
activiyFalg: -1
})
}

}
},
handle(e) { //点击号数
let item = e.currentTarget.dataset.item
let index = e.currentTarget.dataset.index
if (this.data.allFlag){
this.setData({
activiyFalg:index
})
}
if (item.style==0){
this.triggerEvent("setDate", {
y: this.data.year,
m: this.data.month,
value: item.value
})
}else{
return
}
},
getDays(year, month) { //获取每月有多少天
let tempDateArr = []
let thenDate = new Date(year, month, 0).getDate()
return thenDate
},
getLastMonth(year, month) { //上一个月最后一天是多少号
if (month == 1) {
month = 12
year = year - 1
} else {
month = month - 1
}
let tempDateArr = []
let thenDate = new Date(year, month, 0).getDate()
return thenDate
},
getThenWeek(year, month) { //获取每个月第一天是星期几
if (month == 1) {
month = 12
year = year - 1
} else {
month = month - 1
}
let date = new Date()
date.setFullYear(year)
date.setMonth(month)
date.setDate(1)
return date.getDay()
},
getactivityDate(year, month, mode) { //mode == 0 查询当月 mode == 1 查询当天
let tempMonth = month
let tempDey = this.getDays(year, month) //获取每月有多少天
if (tempMonth < 10) {
tempMonth = '0' + (tempMonth + '')
}
let param = {
startDate: year + '-' + tempMonth + "-01" + " 00:00:00",
endDate: year + "-" + tempMonth + "-" + tempDey + " 23:59:59"
}
Http.get({
url: this.data.childUrl,
data: param
}).then(res => {
let {
code,
data
} = res
if (code == 200) {
this.setData({
activityDateList: data
})
}
})
},
front() { //前面
this.setData({
context:1
})
if (this.data.month == 1) {
let temp = this.data.switchFlag
this.setData({
switchFlag: false
})
this.setData({
year: this.data.year - 1,
month: 12
})
} else {
this.setData({
month: this.data.month - 1
})
}
this.triggerEvent("setDate", {
y: this.data.year,
m: this.data.month
}) //第一个是自定义事件名,第二个是要传递的值(可以为空)
this.getDey()
},

behind() { //后面
this.setData({
context: 1
})
let temp = this.data.switchFlag
this.setData({
switchFlag: false
})
if (this.data.month == 12) {
this.setData({
year: this.data.year + 1,
month: 1
})
this.showDate(this.data.year, this.data.month)
} else {
this.setData({
month: this.data.month + 1
})
this.showDate(this.data.year, this.data.month)
}
this.getDey()
this.triggerEvent("setDate", {
y: this.data.year,
m: this.data.month
})
},

},
lifetimes: {
attached: function() {
this.getDey() //查询当月活动
// 设置单周数组
let thenDey = new Date().getDay() //今天是周几
let thenDate = new Date().getDate() //今天是多少号
let tempArr = []
if (thenDey == 0) {
for (let i = 0; i < 7; i++) {
tempArr.splice(i, 1, {
thenFalg: "1",
value: thenDate,
style: "0",
y: this.data.year,
m: this.data.month
})
thenDate++
}
} else {
let temp = new Date().getDay() //今天是周几
let tmpeDey = new Date().getDate() //今天是多少号
for (let i = 0; i <= temp; i++) {
tempArr.splice(i, 0, {
style: "0",
value: thenDate - thenDey,
y: this.data.year,
m: this.data.month
})
thenDey--
}
for (let i = temp + 1; i < 7; i++) {
tmpeDey++
tempArr.splice(i, 0, {
style: "0",
value: tmpeDey,
y: this.data.year,
m: this.data.month
})
}
}
this.setData({
thendata: tempArr,
context:this.data.allFlag ? -1 : 1
})

// 设置单周数组
// setTimeout(() => {
// this.showDate(this.data.year, this.data.month)
// }, 300)

},
detached: function() {
// 在组件实例被从页面节点树移除时执行
},
},
})

+ 3
- 0
components/dateLsit/dateLsit.json ファイルの表示

@@ -0,0 +1,3 @@
{
"component": true
}

+ 15
- 0
components/dateLsit/dateLsit.wxml ファイルの表示

@@ -0,0 +1,15 @@
<view class="Box">
<view class="dateText_box">
<!-- <view class="dateMinus" bindtap="front">{{'<'}}</view> -->
<image src="https://formall.oss-accelerate.aliyuncs.com/cimg/xiangzuo.png" class="dateMinus" bindtap="front"></image>
<view class="dateText">{{year+'年 '+month+'月 '}}</view>
<image src="https://formall.oss-accelerate.aliyuncs.com/cimg/xiangyou.png" class="dateAdd" bindtap="behind"></image>
</view>
<view class="weekBox">
<view class="weekItme" wx:for="{{week}}" wx:key="index">{{item}}</view>
<view class="{{((item.value==dey&&monthFlgh==item.m&&item.y==yearFlgh)&&activiyFalg==index)?'today_a':((item.value==dey&&monthFlgh==item.m&&item.y==yearFlgh)&&activiyFalg!=index)?'today':((item.style == '0'&&activiyFalg==index)?'weekItme_a':(item.style=='0'&&activiyFalg!=index)?'weekItme':activiyFalg==index?'noThen_a':'noThen')}}" wx:for="{{allFlag?(switchFlag? thendata:dateLsit):dateLsit}}" wx:key="index" bindtap="handle" data-item="{{item}}" data-index="{{index}}" style="{{item.act==1?activityStyle:''}}">{{ (item.value==dey&&monthFlgh==item.m&&item.y==yearFlgh)?'':item.value }}</view>
</view>
<view class="concealBnt" bindtap="switchs" wx:if="{{allFlag&&yearFlgh==year&&month==monthFlgh}}">
<image class="concealBnt" src="{{ switchFlag?xiala:xiangshang}}"></image>
</view>
</view>

+ 136
- 0
components/dateLsit/dateLsit.wxss ファイルの表示

@@ -0,0 +1,136 @@
.dateText_box {
width: 60%;
margin: 0 auto;
overflow: hidden;
text-align: center;
}

.Box {
width: 94%;
margin: 30rpx auto;
border-radius: 16rpx;
background-color: #fff;
}

.dateMinus {
float: left;
line-height: 60rpx;
padding: 10rpx;
height: 50rpx;
margin-left: 40rpx;
width: 50rpx;
margin-top: 6rpx;
}

.dateText {
float: left;
padding: 10rpx 20rpx;
line-height: 60rpx;
height: 60rpx;
}

.dateAdd {
padding: 10rpx;
line-height: 60rpx;
height: 50rpx;
float: left;
/* font-size: 36rpx;
*/
margin-top: 6rpx;
width: 50rpx;
}

.weekBox {
overflow: hidden;
font-family: SimHei;
}

.weekItme {
height: 80rpx;
line-height: 80rpx;
width: 80rpx;
margin: 0 10rpx;
text-align: center;
float: left;
/* background-color: red;
border-radius: 50%; */
}

.weekItme_a {
height: 80rpx;
line-height: 80rpx;
width: 80rpx;
margin: 0 10rpx;
text-align: center;
float: left;
/* background-color: red;*/
border-radius: 50%;
background-color: #ff990050;
}

.deyBox {
height: 80rpx;
line-height: 80rpx;
width: 80rpx;
margin: 0 10rpx;
text-align: center;
}

.noThen {
height: 80rpx;
line-height: 80rpx;
width: 80rpx;
margin: 0 10rpx;
text-align: center;
float: left;
color: rgba(0, 0, 0, 0.1);
}

.noThen_a {
height: 80rpx;
line-height: 80rpx;
width: 80rpx;
margin: 0 10rpx;
text-align: center;
float: left;
color: rgba(0, 0, 0, 0.1);
border-radius: 50%;
background-color: #f90;
}

.today_a {
height: 80rpx;
line-height: 80rpx;
width: 80rpx;
margin: 0 10rpx;
text-align: center;
float: left;
color: #fff;
/* background-color: rgba(50,177,252,1); */
background-image: url('https://formall.oss-accelerate.aliyuncs.com/cimg/jinri.png');
background-size: 50rpx 50rpx;
background-repeat: no-repeat;
background-position: 50% 50%;
}

.today {
height: 80rpx;
line-height: 80rpx;
width: 80rpx;
margin: 0 10rpx;
text-align: center;
float: left;
color: #fff;
/* background-color: rgba(50,177,252,1); */
background-image: url('https://formall.oss-accelerate.aliyuncs.com/cimg/jintian_huise.png');
background-size: 50rpx 50rpx;
background-repeat: no-repeat;
background-position: 50% 50%;
}

.concealBnt {
width: 60rpx;
height: 60rpx;
/* background-color: rebeccapurple; */
margin: 0 auto;
}

+ 32
- 0
components/discountCard/index.js ファイルの表示

@@ -0,0 +1,32 @@
// pages/index/sw/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
list: {
value: [],
type: Array
}
},

/**
* 组件的初始数据
*/
data: {
swiperCurrent: 0,
discountcardUrl: ''
},

/**
* 组件的方法列表
*/
ready() {},
methods: {
gotoDiscountCardList:function(){
wx.navigateTo({
url: '/pages/discountCardList/discountCardList',
})
}
}
});

+ 6
- 0
components/discountCard/index.json ファイルの表示

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
}
}

+ 5
- 0
components/discountCard/index.wxml ファイルの表示

@@ -0,0 +1,5 @@
<view class='content' >
<view bindtap='gotoDiscountCardList'>
<image class="img" src='{{discountcardUrl}}' mode='widthFix'></image>
</view>
</view>

+ 6
- 0
components/discountCard/index.wxss ファイルの表示

@@ -0,0 +1,6 @@
.content .img {
display: block;
margin: 30rpx auto 0;
border: 1px solid red;
height: 100rpx;
}

+ 98
- 0
components/gameentry/gentry.js ファイルの表示

@@ -0,0 +1,98 @@
// pages/index/sw/index.js
const Http = require("../../utils/HttpBasics");
var config = require("../../config/config.js");
let app = getApp();
Component({
properties: {
gamedata: {
type: Object,
value: {}
}
},
data: {
flag: false,
alphaData: null,
gameUrl: ''
},
methods:{
gotogame: function (e) {
let that=this;
Http.get({
url: config.api.checkUserStatus,
data: {
token: app.globalData.token
}
}).then(res1 => {
Http.get({
url: config.api.checkPhoneStatus,
data: {}
}).then(res => {
var data = {
couponChannelId: "" + that.data.couponChannelId,
couponId: "" + that.data.couponId
};
if (that.data.couponChannelId == null) {
var data = {
couponId: "" + that.data.couponId
};
}
wx.redirectTo({
url: '/pages/game/index?url=' + e.target.dataset.data.url + "&id=" + e.target.dataset.data.id + "&gameId=" + e.target.dataset.data.gameId,
})
}).catch(err => {
if (err.code == 11005) {
// 用户手机未授权
/**
* 将值传到用户手机号授权的页面
*
*/
app.globalData.skipUrl = '/pages/game/index?url=' + e.target.dataset.data.url + "&id=" + e.target.dataset.data.id + "&gameId=" + e.target.dataset.data.gameId,
app.globalData.skip = 'redirectTo'
wx.redirectTo({
url: "/pages/getphoneInfo/index?path=index&url=" + e.target.dataset.data.url + "&id=" + e.target.dataset.data.id + "&gameId=" + e.target.dataset.data.gameId,
});
} else if (err.code == 11006) {
// 用户手机已加密
wx.redirectTo({
url: "/pages/phoneinput/phoneinput?path=index&url=" + e.target.dataset.data.url + "&id=" + e.target.dataset.data.id + "&gameId=" + e.target.dataset.data.gameId,
});
} else {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
}
})
}).catch(err => {
if (err.code == 11004) { //未授权微信
app.globalData.type = 'gm'
wx.redirectTo({
url: "/pages/getuserinfo/index?path=index&url=" + e.target.dataset.data.url + "&id=" + e.target.dataset.data.id + "&gameId=" + e.target.dataset.data.gameId,
});
} else {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
}
})
},
a: function () {
this.setData({ flag: false })
},
closeGame: function () {
let that = this;
var animation = wx.createAnimation({})
// animation.opacity(0).step({ duration: 1000 })
setTimeout(function () {
that.setData({ flag: true })
}, 500)
animation.rotateZ(180).scale(0).opacity(0.5).step({ duration: 1000 })
that.setData({ alphaData: animation.export() });
},
},
});

+ 6
- 0
components/gameentry/gentry.json ファイルの表示

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
}
}

+ 9
- 0
components/gameentry/gentry.wxml ファイルの表示

@@ -0,0 +1,9 @@

<view class="b1" hidden="{{flag}}">
<view class="t_w">
<view class="b2" animation="{{alphaData}}">
<icon type="cancel" size="40" color="rgb(0,255,255)" class='cancel_icon' bindtap="closeGame"/>
<image class="t_image" data-data="{{gamedata}}" mode='widthFix' src="{{gamedata.imgUrl}}" bindtap="gotogame" />
</view>
</view>
</view>

+ 28
- 0
components/gameentry/gentry.wxss ファイルの表示

@@ -0,0 +1,28 @@
.b1{
position:fixed;
width:100%;
height:100%;
top:0px;
background:rgba(0,0,0,0.8);
overflow: hidden;
z-index: 1000;
}
.t_w{
position:relative;
}
.b2{
width: 90%;
margin:55% auto;
overflow: hidden;
border-radius: 10rpx;
}
.t_image{
width: 100%;
display: block;
margin: 0 auto;
}
.cancel_icon{
position: absolute;
right: 30rpx;
top: -30rpx;
}

+ 142
- 0
components/hot/index.js ファイルの表示

@@ -0,0 +1,142 @@
// pages/index/sw/index.js
let config = require("../../config/config.js");
let Http = require("../../utils/HttpBasics");
let app = getApp();
const imgurl = require("../../utils/imgurl");
const bgColor = require("../../utils/bgColor.js")
Component({
/**
* 组件的属性列表
*/
properties: {},

/**
* 组件的初始数据
*/
data: {
sql: bgColor.colorFirst.main.sql,
txt: bgColor.colorFirst.main.txt,
change: imgurl.change.url,
None: imgurl.None.url,
jianUrl: imgurl.jian.url,
barginicon: imgurl.barginicon.url,
wangmeimeibargin: imgurl.wangmeimeibargin.url,
kData:[],
kSize:'',
pSize: '',
pData:[],
couponId:'',
couponId1: '',
},
/**
* 组件的方法列表
*/
methods: {
//获取砍价拼团数据
getList(val) {
let that = this;
let param = ''
if(val=='1'){
param={
targetAd : 6,
couponId: this.data.couponId
}
}else{
param = {
targetAd : 7,
couponId: this.data.couponId1
}
}
Http.get({
url: config.api.change,
data:param,
}).then(res => {
if(res.data != undefined && res.data){
if(val=='1'){
that.setData({
kData: res.data.data,
kSize: res.data.size,
couponId: res.data.data.couponId,
});
}else{
that.setData({
pData: res.data.data,
pSize:res.data.size,
couponId1: res.data.data.couponId
});
}
} else {
if(val=='1'){
that.setData({
kData: '',
kSize: '',
couponId: '',
});
}else{
that.setData({
pData: '',
pSize:'',
couponId1: ''
});
}
}

})
.catch(err => {
console.log(err)
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
},
// 换一换
getChange(){
let that = this
if (that.kSize != 1 && that.kSize != 0){
that.getList(1)
}
if (that.pSize!=1 && that.pSize !=0) {
that.getList(2)
}
},
//跳转砍价详情
gotokjdetail: function (e) {
wx.navigateTo({
url: `/pages/coupon/detail/index?couponChannelId=${
e.currentTarget.dataset.couponchannelid
}&couponId=${
e.currentTarget.dataset.couponid
}&targetAd=${
e.currentTarget.dataset.targetad
}`
});
},
//跳转拼团详情
gotoptdetail: function (e) {
wx.navigateTo({
url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${
e.currentTarget.dataset.couponchannelid
}&couponId=${
e.currentTarget.dataset.couponid
}&targetAd=${
e.currentTarget.dataset.targetad
}`
});
},
},
ready() {
app.couponChannelListCallback = (token,val) => {
Http.setToken(token);
this.getList(1);
this.getList(2);
};
if (app.globalData.token && app.globalData.token != null) {
app.couponChannelListCallback(app.globalData.token);
}
}
});

+ 4
- 0
components/hot/index.json ファイルの表示

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

+ 60
- 0
components/hot/index.wxml ファイルの表示

@@ -0,0 +1,60 @@
<!--components/hot/hot.wxml-->
<view class='hotBox'>
<view class='hotTitle'>
<view class='titleL'>
<view class='sql' style='background:{{sql}}'></view>
<text>爆款专区</text>
</view>
<view class='titleR' bindtap='getChange' wx:if="{{pSize>=2||kSize>=2}}">
<text class="text" style='color:{{txt}}'>换一换</text>
<view class="view">
<image class="img" src='{{change}}' bindtap='' mode='aspectFill'></image>
</view>
</view>
</view>
<view class='hotCon clearfix'>
<view class='kanjia' wx:if="{{kSize}}" bindtap="gotokjdetail" data-couponId='{{kData.couponId}}' data-couponChannelId="{{kData.id}}" data-targetAd="{{kData.targetAd}}">
<view>
<image class="img" mode='aspectFill' lazy-load='true' src="{{kData.coverImg}}" />
</view>
<view class='kjText'>
<text class='title'>{{kData.title}}</text>
<text class='price'>¥{{kData.priceStr}}</text>
<text class='sale'><text class="simple">¥</text>{{kData.salePriceStr}}</text>
<view class=' btn btnk'>砍价</view>
</view>
</view>
<view class='kanjia' wx:if="{{!kSize}}">
<view>
<image class="img" src='{{None}}' bindtap='' mode='aspectFill'></image>
</view>
<view class='kjText'>
<text class='title'>疯狂补货中…</text>
<text class='expect'>敬请期待</text>
<view class='btnk btnNone'>砍价</view>
</view>
</view>

<view class='pintuan' wx:if="{{pSize}}" bindtap="gotoptdetail" data-couponId='{{pData.couponId}}' data-couponChannelId="{{pData.id}}" data-targetAd="{{pData.targetAd}}">
<view>
<image class="img" mode='aspectFill' lazy-load='true' src="{{pData.coverImg}}" />
</view>
<view class='ptText'>
<text class='title'>{{pData.title}}</text>
<text class='price'>¥{{pData.priceStr}}</text>
<text class='sale' class="simple"> <text>¥</text>{{pData.salePriceStr}}</text>
<view class='btn btnp'>拼团</view>
</view>
</view>
<view class='pintuan' wx:if="{{!pSize}}">
<view>
<image class="img" src='{{None}}' bindtap='' mode='aspectFill'></image>
</view>
<view class='ptText'>
<text class='title'>疯狂补货中...</text>
<text class='expect'>敬请期待</text>
<view class='btnp btnNone'>拼团</view>
</view>
</view>
</view>
</view>

+ 156
- 0
components/hot/index.wxss ファイルの表示

@@ -0,0 +1,156 @@
/* components/hot/hot.wxss */
@import "../../app.wxss";

.hotBox {
width: 710rpx;
margin: 0 auto;
}

.hotTitle {
width: 100%;
height: 60rpx;
line-height: 60rpx;
font-size: 30rpx;
display: flex;
justify-content: space-between;
font-family: PingFangSC-Medium;
}

.titleL .titleR {
width: 100rpx;
}

.titleR .text {
float: left;
margin-right: 10rpx;
font-family: PingFangSC-Regular !important;
}

.titleR .view {
height: 40rpx;
width: 40rpx;
/* margin-top: 10rpx; */
float: left;
}

.titleR .img {
height: 28rpx;
width: 28rpx;
}

.sql {
width: 12rpx;
height: 24rpx;
border-radius: 8rpx;
float: left;
margin: 20rpx 10rpx 0 0;
}

.hotCon {
width: 100%;
}

.kanjia,
.pintuan {
width: 346rpx;
height: 156rpx;
float: left;
border-radius: 12rpx;
display: flex;
justify-content: space-between;
position: relative;
}

.kanjia {
margin-right: 18rpx;
background: linear-gradient(130deg, rgba(50, 177, 252, 1) 0%, rgba(47, 108, 255, 1) 100%);
}

.pintuan {
background: linear-gradient(127deg, rgba(252, 177, 74, 1) 0%, rgba(254, 70, 20, 1) 100%);
}

.hotCon .img {
width: 86rpx;
height: 86rpx;
margin: 24rpx 0 46rpx 16rpx;
}

.hotCon .btn {
width: 80rpx;
height: 44rpx;
line-height: 44rpx;
background: rgba(255, 255, 255, 1);
border-radius: 18rpx;
font-size: 24rpx;
position: absolute;
right: 20rpx;
bottom: 20rpx;
text-align: center;
}

.btnk {
color: #2C8DFF;
}

.btnp {
color: #FD782D;
}

.btnNone {
width: 80rpx;
height: 44rpx;
line-height: 44rpx;
border-radius: 18rpx;
font-size: 24rpx;
position: absolute;
right: 20rpx;
bottom: 20rpx;
text-align: center;
background: rgba(255, 255, 255, 0.5)
}

.kjText,
.ptText {
color: #FFFFFF;
margin: 14rpx 10rpx 20rpx 10rpx;
}

.title {
width: 210rpx;
font-size: 30rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
float: left;
}

.price {
width: 128rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 22rpx;
text-decoration: line-through;
float: left;
}

.expect {
width: 210rpx;
font-size: 22rpx;
float: left;
}

.sale {
width: 140rpx;
font-size: 32rpx;
float: left;
margin-top: -8rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}

.sale .simple {
font-size: 20rpx !important;
}

+ 1
- 0
components/navbar/img/back.svg ファイルの表示

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="128px" height="128.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#202020" d="M711.1 928.3c-13.2 0-26.3-5-36.4-15.2L297.8 532.9c-20.1-20.2-20.1-53.1 0-73.3L674.7 79.2c20.1-20.3 52.6-20.3 72.7 0 20.1 20.2 20.1 53.1 0 73.3L406.9 496.2l340.5 343.6c20.1 20.3 20.1 53.1 0 73.3-10 10.1-23.2 15.2-36.3 15.2z" /></svg>

+ 1
- 0
components/navbar/img/home.svg ファイルの表示

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="128px" height="128.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#202020" d="M962.986667 480.426667l-422.4-379.733334a42.666667 42.666667 0 0 0-57.173334 0l-422.4 379.733334a42.666667 42.666667 0 0 0 57.173334 63.146666l9.813333-8.533333V896a42.666667 42.666667 0 0 0 42.666667 42.666667h682.666666a42.666667 42.666667 0 0 0 42.666667-42.666667v-360.96l9.813333 8.533333a42.666667 42.666667 0 0 0 28.586667 11.093334 42.666667 42.666667 0 0 0 31.573333-14.08 42.666667 42.666667 0 0 0-2.986666-60.16zM469.333333 853.333333v-170.666666h85.333334v170.666666z m341.333334-384v384h-170.666667v-213.333333a42.666667 42.666667 0 0 0-42.666667-42.666667h-170.666666a42.666667 42.666667 0 0 0-42.666667 42.666667v213.333333H213.333333v-384a61.013333 61.013333 0 0 0 0-9.386666l298.666667-270.08 298.666667 270.08a61.013333 61.013333 0 0 0 0 9.386666z" /></svg>

+ 81
- 0
components/navbar/navbar.js ファイルの表示

@@ -0,0 +1,81 @@
const app = getApp()

Component({
properties: {
background: {
type: String,
value: '#F4F5F9'
},
color: {
type: String,
value: '#000'
},
text: {
type: String,
value: 'Wechat'
},
showLocationIf: {
type: Boolean,
value: false
},
back: {
type: Boolean,
value: false
},
home: {
type: Boolean,
value: false
},

},

data: {
array: ['A广场', 'B广场-北京西单'],
index: 1,
statusBarHeight: app.statusBarHeight + 'px',
navigationBarHeight: (app.statusBarHeight + 44) + 'px',
},
methods: {

backHome: function () {
let url = app.globalData.goHomeUrl
wx.switchTab({
url: url,
})
},
bindPickerChange: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
index: e.detail.value
})
},
back: function () {
wx.navigateBack({
delta: 1
})
// const pages = getCurrentPages();
// console.log(`页面栈:${JSON.stringify(pages)}`, pages.length);
// if (pages.length === 2) {
// wx.navigateBack({
// delta: 1
// });
// } else if (pages.length === 1) {
// wx.reLaunch({
// url: '/pages/theme/index1/index',
// })
// } else {
// wx.navigateBack({
// delta: 1
// });
// }
}
},
attached: function () {
let pages = getCurrentPages();
if (pages.length <= 1) {
this.setData({
back: false
})
}
}
})

+ 3
- 0
components/navbar/navbar.json ファイルの表示

@@ -0,0 +1,3 @@
{
"component": true
}

+ 20
- 0
components/navbar/navbar.wxml ファイルの表示

@@ -0,0 +1,20 @@
<view class="navbar" style="background:{{background}}!important;">
<view style="{{'height: ' + statusBarHeight}}"></view>
<view class='title-container'>
<view class='capsule' wx:if="{{ back || home}}">
<view class="view" bindtap='back' wx:if="{{back}}">
<image class="img" style="left:36%;" src='img/back.svg'></image>
</view>
<view class="view" bindtap='backHome' wx:if="{{home}}">
<image class="img" src='img/home.svg' style="width:90%;"></image>
</view>
</view>
<view class='title' style="color:{{color}}!important">{{text}}</view>
<picker bindchange="bindPickerChange" wx:if="{{showLocationIf}}" class="pick-box" value="{{index}}" range="{{array}}">
<icon class='iconfont icon-daohangdizhiweizhi'></icon>
<view class="picker locations">
{{array[index]}}
</view>
</picker>
</view>
</view>

+ 105
- 0
components/navbar/navbar.wxss ファイルの表示

@@ -0,0 +1,105 @@
.navbar {
width: 100vw;
background-color: #F4F5F9;
position: fixed;
left: 0;
top: 0;
/* height:150rpx; */
overflow: hidden;
z-index: 400000000;
}

.title-container {
height: 44px;
display: flex;
align-items: center;
position: relative;
}

.capsule {
margin-left: 10px;
height: 32px;
border: 1px solid #e1e1e3;
border-radius: 60px;
display: flex;
align-items: center;
padding: 0 20rpx;
background: #fff!important;
}

.capsule > .view {
width: 35px;
height: 60%;
position: relative;
}

.capsule > .view:nth-child(2) {
border-left: 1px solid #777;
}

.capsule .img {
width: 70%;
height: 100%;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
}


@font-face {
font-family: 'iconfont'; /* project id 1353695 */
src: url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.eot');
src: url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.eot?#iefix') format('embedded-opentype'),
url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.woff2') format('woff2'),
url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.woff') format('woff'),
url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.ttf') format('truetype'),
url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.svg#iconfont') format('svg');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.icon-daohangdizhiweizhi:before {
content: "\e787";
}
.locations{
font-size: 28rpx;
display: inline-block;
width: 200rpx;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.pick-box{
width: 260rpx;
padding-left: 20rpx;
}
.titleBox{
width: 100%;
display: flex;
justify-content: center;
}
.title {
color: #000;
position: absolute;
left: 104px;
right: 104px;
font-weight: 600;
font-size: 32rpx;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* .jituan{
width: 24rpx;
height: 14rpx;
color: #000;
margin-top: 16rpx;
margin-left: 10rpx;
} */

+ 59
- 0
components/optimization/optimization.js ファイルの表示

@@ -0,0 +1,59 @@
const Http = require("../../utils/HttpBasics");
const config = require("../../config/config");
Component({
/**
* 组件的属性列表
*/
properties: {
businessList: {
type: Array,
value: []
},
businessData: {
type: Array,
value: []
},
},

/**
* 组件的初始数据
*/
data: {
classIndex: 0,
couponListShowSelled: ""
},

/**
* 组件的方法列表
*/
methods: {
goDetail(e) {
let couponChannelId = e.currentTarget.dataset.id
let couponId = e.currentTarget.dataset.couponid
wx.navigateTo({
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`,
})
},
setIndex(e) {
let index = e.currentTarget.dataset.index
let id = e.currentTarget.dataset.id
this.triggerEvent('businessid', id)
this.setData({
classIndex: index
})
},


},
attached() {
Http.get({
url: config.api.couponListShowSelled,
}).then(res => {
this.setData({
couponListShowSelled: res.data || ""
})
}).catch(err => {

})
}
})

+ 4
- 0
components/optimization/optimization.json ファイルの表示

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

+ 43
- 0
components/optimization/optimization.wxml ファイルの表示

@@ -0,0 +1,43 @@
<view class="optimizationBox">
<view class="titleImg">
<view class="textl f">优选好物</view>
<view class="textr r">Preferred Good</view>
</view>


<view class="classifyBox">
<view class="itemBox" wx:for="{{businessList}}" wx:key="index" bindtap="setIndex" data-index="{{index}}" data-id="{{item.id}}">
<view class="{{classIndex==index?'className_a':'className'}}">{{item.title}}</view>
<view class="xian" wx:if="{{classIndex==index}}"></view>
</view>
</view>

<view class="contBox">
<view class="contLsitBox">
<view class="item" wx:for="{{businessData}}" wx:key="index" bindtap="goDetail" data-couponid="{{item.couponId}}" data-id="{{item.id}}">
<view class="itemImg">
<image class="img" src="{{item.coverImg}}" mode='scaleToFill'></image>
</view>
<view class="titleName">{{item.title}}</view>
<!-- <view wx:if="{{ item.creditPrice }}" class="titleName">
<text class="credit">{{ item.creditPrice }}积分</text>
</view> -->
<view class="priceBox">
<view class="sellingBox f">
<view class="fuhao">¥</view>
<view class="int">{{item.salePriceStrQ?item.salePriceStrQ:item.salePriceStr}}</view>
<view class="fuhao">{{item.salePriceStrH?'.'+item.salePriceStrH:''}}</view>
</view>
<view wx:if="{{couponListShowSelled && couponListShowSelled==1}}" class="priceNum r">已售 {{item.sale}}</view>
<view class="originalBox r">
<view class="origina">¥{{item.priceStr}}</view>
</view>
</view>

<view class="sellout" wx:if="{{item.remainInventory==0}}">
<image class="selloutImg" src="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_img_ysx.png"></image>
</view>
</view>
</view>
</view>
</view>

+ 227
- 0
components/optimization/optimization.wxss ファイルの表示

@@ -0,0 +1,227 @@
.optimizationBox {
/* overflow: hidden; */
margin-top: 20rpx;
}

.titleImg {
width: 96%;
height: 80rpx;
margin: 0rpx auto;
background-image: url("https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_ggw_yxhw.png");
background-size: 100% 100%;
background-repeat: no-repeat;
}

.textl {
font-size: 34rpx;
font-family: OPPOSans;
font-weight: bold;
color: #dfbe99;
margin: 20rpx;
}

.textr {
font-size: 30rpx;
font-family: OPPOSans;
font-weight: 300;
color: #91897e;
margin: 20rpx;
}

.f {
float: left;
}

.r {
float: right;
}

.classifyBox {
width: 100%;
border-radius: 20rpx 20rpx 0 0;
background-color: #fff;
overflow: hidden;
display: -webkit-box;
overflow-x: scroll;
-webkit-overflow-scrolling: touch;
/* margin: 10rpx 0; */
/* background: linear-gradient(0deg, #F5F5F5, #fff); */
}

.classifyBox::-webkit-scrollbar {
display: none;
}

.itemBox {
/* width: 100rpx; */
height: 100rpx;
margin: 0 30rpx;
}

.className {
font-size: 28rpx;
font-family: OPPOSans;
font-weight: 500;
color: #454340;
text-align: center;
margin: 20rpx auto 10rpx auto;
}

.className_a {
font-size: 30rpx;
font-family: OPPOSans;
font-weight: 800;
color: #c99f67;
text-align: center;
background: linear-gradient(180deg, #cc9a60 0%, #dfbf8e 100%);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
margin: 20rpx auto 10rpx auto;
}

.xian {
width: 22rpx;
height: 5rpx;
background: linear-gradient(180deg, #D5A56E, #E9D0AA);
border-radius: 3px;
margin: 0 auto;
}

.contBox {

background: linear-gradient(0deg, #F5F5F5, #fff);
height: 350rpx;
}

.contLsitBox {
width: 96%;
margin: 0 auto;
display: flex;
overflow: hidden;
justify-content: space-between;
flex-wrap: wrap;
padding-bottom: 170rpx;

}

.item {
width: 49%;
background-color: #fff;
border-radius: 20rpx;
margin: 12rpx 0;
position: relative;
}

.itemImg {
width: 100%;
height: 350rpx;
border-radius: 20rpx;
/* background-color: aquamarine; */
}

.itemImg .img {
width: 100%;
height: 100%;
border-radius: 20rpx 20rpx 0 0;
}

.titleName {
width: 90%;
height: 50rpx;
line-height: 50rpx;
font-size: 28rpx;
font-family: OPPOSans;
font-weight: 500;
color: #333333;
margin: 10rpx auto 0 auto;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
white-space: normal;
}

.credit {
color: #DF2D2D;

}

.priceBox {
width: 90%;
overflow: hidden;
margin: 10rpx auto;
}

.f {
float: left;
}

.r {
float: right;
}

.sellingBox {
overflow: hidden
}

.fuhao {
color: #DF2D2D;
font-size: 24rpx;
float: left;
font-family: OPPOSans;
/* font-weight: bold; */
margin-top: 10rpx
}

.int {
float: left;
font-size: 36rpx;
font-family: OPPOSans;
font-weight: bold;
color: #DF2D2D;
}

.originalBox {
overflow: hidden
}

.origina {
text-align: right;
font-size: 24rpx;
font-family: OPPOSans;
font-weight: 400;
text-decoration: line-through;
color: #999999;
margin-top: 10rpx;
margin-right: 10rpx;
}

.priceNum {
text-align: right;
font-size: 24rpx;
font-family: OPPOSans;
font-weight: 400;

color: #999999;
margin-top: 10rpx;
/* margin-right: 10rpx; */
}

.sellout {
position: absolute;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
border-radius: 20rpx;
}

.selloutImg {
width: 195rpx !important;
height: 154rpx !important;
margin: 50% auto;
display: block
}

+ 71
- 0
components/shareposter/index.js ファイルの表示

@@ -0,0 +1,71 @@
// pages/index/sw/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
paramAtoB: String,
from: String,
data: {
value: {},
type: Object
},
},

/**
* 组件的初始数据
*/
data: {
isshare: true,
},
methods: {
/**
* 隐藏分享弹框
*/
hidemodal: function() {
this.setData({
isshare: false,
})
},
/**
* 显示分享海报
*/
/* showPoster: function() {
//跳转到海报生成页
wx.navigateTo({
url: `/pages/canvas/index?merchantId=${this.data.id}`
})
}, */
showPoster: function() {
//跳转到海报生成页
console.log(this.data.fromflag)
let that = this;
Http.get({
url: config.api.checkUserStatus,
data: {
token: app.globalData.token
}
}).then(res => {
wx.navigateTo({
url: `/pages/canvas/index?couponChannelId=${that.data.id}`
})
}).catch(err => {
console.log(err)
if (err.code == 11004) {
// 用户昵称未授权
wx.redirectTo({
url: `/pages/getuserinfo/index?couponChannelId=${that.data.id}&fromflag=poster`
})
}
})

},




}
});

+ 3
- 0
components/shareposter/index.json ファイルの表示

@@ -0,0 +1,3 @@
{
"component": true
}

+ 14
- 0
components/shareposter/index.wxml ファイルの表示

@@ -0,0 +1,14 @@
<!-- 分享弹框 -->
<view class='modal' bindtap='hidemodal'>
<view class='modal-content'>
<view>
<button class='share user-motto' data-id="{{data.id}}" data-title='{{data.title}}' id="shareBtn" open-type="share" hover-class="other-button-hover"></button>
<image src='./../../assets/images/wechat.png' mode='aspectFit'></image>
<text>微信好友</text>
</view>
<view bindtap='showPoster'>
<image src='./../../assets/images/picture.png' mode='aspectFit'></image>
<text>生成海报</text>
</view>
</view>
</view>

+ 46
- 0
components/shareposter/index.wxss ファイルの表示

@@ -0,0 +1,46 @@
.modal {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.5);
overflow: hidden;
z-index: 10000;
color: #fff;
}

.modal-content {
width: 540rpx;
height: 233rpx;
line-height: 60rpx;
overflow: hidden;
position: fixed;
top: 50%;
left: 0;
z-index: 11;
background: #f9f9f9;
margin: -130rpx 105rpx;
border-radius: 36rpx;
display: flex;
}

.modal-content view {
display: inline-block;
flex: 1;
text-align: center;
}

.modal-content view>text {
color: #000;
display: block;
font-size: 30rpx;
height: 80rpx;
line-height: 80rpx;
}

.modal-content view>image {
margin-top: 30rpx;
width: 90rpx;
height: 90rpx;
}

+ 100
- 0
components/shop/shop.js ファイルの表示

@@ -0,0 +1,100 @@
const imgurl = require("../../utils/imgurl");
Component({
properties: {
mallList: {
value: [],
type: Array
}
},

data: {
teljpgUrl: imgurl.teljpg.url,
list: [], // 广场、商户列表
mallNum: 0, // 适用商户数量
},

methods: {
// 跳转详情页
gotoDetail(e) {
console.log(e);
wx.navigateTo({
url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}&mallTenantId=${e.currentTarget.dataset.tenantid}`
})
},
phone: function (e) {
let that = this;
wx.makePhoneCall({
phoneNumber: e.target.dataset.merchantlinkphone
});
},

// 跳转资质页面
// goCertification(e) {
// wx.navigateTo({
// url: `/pages/shopCertification/index?id=${e.currentTarget.dataset.id}`
// })
// },

//跳转地图页面
goMap(e) {
let {
latitude,
longitude
} = e.currentTarget.dataset.item
console.log(latitude, longitude);
wx.openLocation({
latitude: Number(latitude),
longitude: Number(longitude),
scale: 18,
success() {
console.log("打开地图成功");
},
fail(err) {
console.log("打开地图失败:", err.errMsg);
},
});
},

goFitShop() {
const arr = []
this.data.list.forEach(item => {
item.merchantVoList.forEach(el => {
arr.push(el)
})
})
wx.navigateTo({
url: `/pages/fitShop/fitShop?list=${JSON.stringify(arr)}`,
success: (res) => { },
fail: (res) => { },
});
},

expandList(e) {
const index = e.currentTarget.dataset.index
const arr = this.data.list
arr[index].expand = !arr[index].expand
this.setData({
list: arr
})
}
},

ready() {
this.setData({
list: JSON.parse(JSON.stringify(this.properties.mallList))
})

console.log(this.data.mallList, 'mallList');
let mallNum = 0
this.data.list.forEach(item => {
mallNum += item.merchantVoList.length
})
this.setData({
mallNum: mallNum
})
},

created() {

}
})

+ 3
- 0
components/shop/shop.json ファイルの表示

@@ -0,0 +1,3 @@
{
"component": true
}

+ 62
- 0
components/shop/shop.wxml ファイルの表示

@@ -0,0 +1,62 @@
<view class="components">
<view class="header">
<view class='applyshop'>{{"适用门店("+mallNum+"家)"}}</view>
<!-- <image src="../../assets/itemImg/chevron.png" mode="widthFix" class="rightArrow">
</image> -->
<!-- <view class="goShop">{{'共'+mallNum+'家门店适用'}}</view> -->
</view>
<view wx:for="{{list}}" wx:for-index="index" wx:key="index" class="body">
<view class="mall">
<view>
<image class="img" src="../../assets/images/merchantImgCover.png"></image>
<view class="mallItem">
<view class="title">{{item.mallName}}</view>
</view>
</view>

<!-- 当商户数量不大于三个时 -->
<view class="goExpand" catchtap="expandList" data-index="{{index}}">
<view>
<view class="text">{{item.merchantVoList.length+'家门店适用'}}</view>
<image wx:if="{{!item.expand}}" src="../../assets/images/chevron.png" mode="widthFix" class="rightArrowDown">
</image>
<image wx:else src="../../assets/images/chevron.png" mode="widthFix" class="rightArrowUp"></image>
</view>
</view>
</view>

<!-- 当item.expand为true且商户数量不大于三个时 -->
<view class="shop" wx:if="{{item.expand}}">
<view class='posi' wx:for="{{item.merchantVoList}}" wx:for-index="itemIndex" wx:key="itemIndex">
<view class='posi_logo'>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
<image class="img" src='{{item.merchantImgUrl}}'></image>
</view>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
<view class='name'>{{item.merchantName}}</view>
<view class='shopVoList'>
<view wx:for="{{item.shopVoList}}" wx:key="index" wx:for-item="itemName">
<text class="name">{{itemName.buildingName}}{{itemName.floorName}}--{{itemName.shopNumber}}</text>
<text class='douhao' wx:if="{{item.shopVoList.length>1}}">,</text>
</view>
</view>
</view>
<view class="telBox" wx:if="{{item.linkLinePhone}}">
<image bindtap='phone' data-merchantLinkPhone='{{item.linkLinePhone}}' class="telImg" src="{{teljpgUrl}}" mode="widthFix" />
<view class="telText">电话</view>
</view>
<!-- <view class="certificationBox" wx:if="{{item.latitude&&item.longitude}}" bindtap="goCertification" data-id="{{item.id}}">
<image class="certificationImg" src="../../assets/images/certification.png" mode="widthFix" />
<view class="telText">资质</view>
</view> -->
</view>
<view class="siteBox" wx:if="{{item.latitude&&item.longitude}}" bindtap="goMap" data-item="{{item}}">
<view class="siteText">{{item.addr}}</view>
<image class="siteImg" src="../../assets/images/siteImg.png" mode="widthFix" />
</view>
<view class="dividerInside" wx:if="{{(itemIndex+1)<list[index].merchantVoList.length}}"></view>
</view>
</view>
<view class="divider" wx:if="{{(index+1)<list.length}}"></view>
</view>
</view>

+ 222
- 0
components/shop/shop.wxss ファイルの表示

@@ -0,0 +1,222 @@
.components {
display: block;
height: auto;
margin-top: 15rpx;
margin-bottom: 15rpx;
background-color: #fff;
}

.components .header {
height: 70rpx;
}

.components .header .applyshop {
float: left;
font-size: 30rpx;
line-height: 70rpx;
text-indent: 1em;
color: #333;
background: #fff;
font-weight: bold;
}

.components .header .goShop {
float: left;
font-size: 22rpx;
height: 70rpx;
line-height: 70rpx;
text-indent: 1em;
color: #a6a6a6;
background: #fff;
font-weight: bold;
margin-right: 25rpx;
}

.components .header .rightArrow {
float: right;
display: block;
width: 14rpx;
margin: 24rpx 30rpx 0 10rpx;
}

.components .body {
border-bottom: 10rpx solid #f4f5f9;
}

.components .body .mall {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 15rpx;
margin-bottom: 15rpx;
padding-left: 25rpx;
padding-right: 65rpx;
}

.components .body .mall .img {
display: inline-block;
width: 75rpx;
height: 75rpx;
}

.components .body .mall .mallItem {
position: relative;
top: -26rpx;
display: inline-block;
margin-left: 25rpx;
}

.components .body .mall .mallItem .title {
font-size: 28rpx;
}

.components .body .mall .goExpand {
font-size: 25rpx;
color: #a6a6a6;
}

.components .body .mall .goExpand .text {
display: inline-block;
margin-right: 20rpx;
}

.components .body .mall .goExpand .rightArrowDown {
display: inline-block;
position: relative;
top: 5rpx;
width: 14rpx;
transform: rotate(90deg);
}

.components .body .mall .goExpand .rightArrowUp {
display: inline-block;
position: relative;
top: 5rpx;
width: 14rpx;
transform: rotate(-90deg);
}

.components .body .shop .posi {
/* position: relative; */
width: 100%;
background: #FFF;
margin-bottom: 20rpx;
}

.components .body .shop .posi .posi_logo {
position: relative;
width: 92%;
display: flex;
padding: 20rpx 0;
background: #fff;
margin: 0 auto;
}

.components .body .shop .posi .posi_logo .img {
display: block;
width: 100rpx;
height: 100rpx;
border-radius: 16rpx;
margin-right: 16rpx;
border: 1px solid #e5e5e5;
}

.components .body .shop .posi .posi_logo .name {
font-size: 32rpx;
color: #333;
letter-spacing: 0;
width: 500rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}

.components .body .shop .posi .posi_logo .shopVoList {
white-space: nowrap !important;
overflow-y: scroll;
/* height: 60rpx !important; */
width: 360rpx;
font-size: 16px;
color: #333;
letter-spacing: 0;
}

.components .body .shop .posi .posi_logo .shopVoList .name {
font-size: 23rpx !important;
color: #b8b8b8 !important;
}

.components .body .shop .posi .posi_logo .telBox {
position: absolute;
right: 0;
top: 0;
bottom: 0;
margin: auto;
}

.components .body .shop .posi .posi_logo .telBox .telImg {
width: 50rpx;
height: 50rpx;
margin-top: 20rpx;
}

.components .body .shop .posi .posi_logo .telBox .telText {
text-align: center;
color: #b8b8b8 !important;
font-size: 20rpx;
}

.components .body .shop .posi .posi_logo .certificationBox {
position: absolute;
right: 35rpx;
top: 0;
bottom: 0;
margin: auto;
}

.components .body .shop .posi .posi_logo .certificationBox .certificationImg {
width: 50rpx;
height: 50rpx;
margin-top: 20rpx;
}

.components .body .shop .posi .posi_logo .certificationBox .telText {
text-align: center;
color: #b8b8b8 !important;
font-size: 20rpx;
}

.components .body .shop .posi .siteBox {
overflow: hidden;
width: 92%;
margin: 0 auto 1rpx auto;
padding-bottom: 10rpx;
}

.components .body .shop .posi .siteBox .siteText {
width: 90%;
float: left;
font-size: 24rpx;
color: #333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.components .body .shop .posi .siteBox .siteImg {
float: right;
width: 40rpx;
height: 40rpx;
}

.components .body .shop .posi .dividerInside {
width: 100%;
height: 5rpx;
background-color: #DCDFE6;
}

.components .body .divider {
width: 100%;
height: 12rpx;
background-color: #f4f5f9;
}

+ 45
- 0
components/spellbanner/index.js ファイルの表示

@@ -0,0 +1,45 @@
// pages/index/sw/index.js
const imgurl = require("../../utils/imgurl");
Component({
/**
* 组件的属性列表
*/
properties: {
list: {
value: [],
type: Array
}
},

/**
* 组件的初始数据
*/
data: {
swiperCurrent: 0,
bannerUrl: imgurl.banner.url
},

/**
* 组件的方法列表
*/
ready() {},
methods: {
swiperChange: function(e) {
this.setData({
swiperCurrent: e.detail.current
});
},
gotobannerdetail: function(e) {
console.log(e)
if(e.currentTarget.dataset.data.type==2){
wx.navigateTo({
url: `/pages/freeBannerDetail/index?id=${e.currentTarget.dataset.id}`
});
}else{
wx.navigateTo({
url: `/pages/bannerdetail/index?id=${e.currentTarget.dataset.id}`
});
}
}
}
});

+ 6
- 0
components/spellbanner/index.json ファイルの表示

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
}
}

+ 14
- 0
components/spellbanner/index.wxml ファイルの表示

@@ -0,0 +1,14 @@
<view wx:if="{{list.length!=0}}" class="index-slide-view">
<swiper class="index-slide" bindchange="swiperChange" autoplay="true" circular="false">
<block wx:for="{{list}}" wx:key="unique">
<swiper-item>
<image data-id="{{item.id}}" data-data="{{item}}" bindtap='gotobannerdetail' src="{{item.coverImg}}" class="index-slide-image" />
</swiper-item>
</block>
</swiper>
<!-- <view class="dots">
<block wx:for="{{list}}" wx:key="unique">
<view class="dot{{index == swiperCurrent ? ' active' : ''}}"></view>
</block>
</view> -->
</view>

+ 51
- 0
components/spellbanner/index.wxss ファイルの表示

@@ -0,0 +1,51 @@
.index-slide-view{
position: relative;
width: 710rpx;
height: 260rpx;
overflow: hidden;
/* margin:-132rpx auto 0; */
border-radius:16rpx;
box-shadow: 0 6px 20px 0 rgba(0,0,0,0.15);
}
.index-slide,
swiper-item
.index-slide-image {
display: block;
width: 710rpx;
height: 260rpx;
margin: 0 auto;
border-radius:16rpx;
overflow: hidden;
position: relative;

}
.index-slide-view .dots{
position: absolute;
left: 0;
right: 0;
bottom: 20rpx;
display: flex;
justify-content: center;
}
.index-slide-view .dots .dot{
margin: 0 8rpx;
width: 12rpx;
height: 12rpx;
background: #b6b6b7;
border-radius: 50%;
transition: all .6s;
}
.index-slide-view .dots .dot.active{
background: #02C0FF;
width: 30rpx;
height: 12rpx;
border-radius:10rpx;
opacity: 1;
}
.bannerbg{
width: 100%;
}
.bannerbg image{
display: block;
width: 100%;
}

+ 78
- 0
components/store/index.js ファイルの表示

@@ -0,0 +1,78 @@
const imgurl = require("../../utils/imgurl");
Component({
/**
* 组件的属性列表
*/
properties: {
merchantVoList: {
value: [],
type: Array
}
},

/**
* 组件的初始数据
*/
data: {
teljpgUrl: imgurl.teljpg.url,
showMore:true,
more: "点击查看更多",
hidden:"hidden",
height: ""
},
/**
* 组件的方法列表
*/
methods: {
/**
* 跳转到门店列表的详情页面
*/
gotoDetail(e) {
wx.navigateTo({
url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}`
})
},
// 点击查看更多
more: function () {
let that = this;
if (that.data.more == '点击查看更多') {
this.setData({
hidden: "",
height: 'auto!important',
more: "点击收起",
showMore: true
})
} else {
that.setData({
hidden: "hidden",
height: 4 * 140 + 'rpx',
more: "点击查看更多",
showMore: true
})
}
},
phone: function (e) {
let that = this;
wx.makePhoneCall({
phoneNumber: e.target.dataset.merchantlinkphone
});
}
},
ready: function () {
let merchantVoList = this.properties.merchantVoList;
if (merchantVoList.length>0){
if (merchantVoList.length <= 4) {
this.setData({
height: merchantVoList.length * 140 + 'rpx',
showMore: false,
hidden:"hidden"
})
} else if (merchantVoList && merchantVoList.length > 4) {
this.setData({
height: 4 * 140 + 'rpx'
})
}
}
}
});

+ 3
- 0
components/store/index.json ファイルの表示

@@ -0,0 +1,3 @@
{
"component": true
}

+ 19
- 0
components/store/index.wxml ファイルの表示

@@ -0,0 +1,19 @@
<view class='applyshop'>适用门店</view>
<view class='posi' style='overflow:{{hidden}};height:{{height}}'>
<view class='posi_logo' wx:for="{{merchantVoList}}" wx:key="index">
<view bindtap='gotoDetail' data-id='{{item.id}}'>
<image src='{{item.merchantImgUrl}}'></image>
</view>
<view bindtap='gotoDetail' data-id='{{item.id}}'>
<view class='name'>{{item.merchantName}}</view>
<view class='shopVoList'>
<view wx:for="{{item.shopVoList}}" wx:key="index" wx:for-item="itemName">
<text>{{itemName.buildingName}}{{itemName.floorName}}--{{itemName.shopNumber}}</text>
<text class='douhao' wx:if="{{item.shopVoList.length>1}}">,</text>
</view>
</view>
</view>
<image wx:if="{{item.linkLinePhone}}" bindtap='phone' data-merchantLinkPhone='{{item.linkLinePhone}}' class="tel" src="{{teljpgUrl}}" mode="widthFix" />
</view>
</view>
<view class='bottom' bindtap='more' wx:if="{{showMore}}">{{more}}</view>

+ 76
- 0
components/store/index.wxss ファイルの表示

@@ -0,0 +1,76 @@
.applyshop {
font-size: 30rpx;
height: 70rpx;
line-height: 70rpx;
text-indent: 1em;
color: #333;
background: #fff;
}

.posi {
position: relative;
width: 100%;
background: #FFF;
}
.posi_logo {
position: relative;
width: 92%;
display: flex;
padding: 20rpx 0;
background: #fff;
margin: 0 auto;
}

.posi_logo view:nth-child(1) {
border-radius: 16rpx;
}

.posi_logo view:nth-child(1) image {
display: block;
width: 100rpx;
height: 100rpx;
border-radius: 16rpx;
margin-right: 16rpx;
border: 1px solid #e5e5e5;
}
.name{
font-size: 32rpx;
color: #333;
letter-spacing: 0;
width: 500rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.posi_logo view:nth-child(2) view {
font-size: 32rpx;
color: #333;
letter-spacing: 0;
}

.shopVoList {
display: flex !important;
padding-left: 0 !important;
flex-direction: row !important;
}

.shopVoList text {
font-size: 20rpx !important;
color: #b8b8b8 !important;
}
.bottom{
background: #fff;
color: #666;
text-align: center;
padding: 20rpx 0;
font-size: 32rpx;
}
.tel {
position: absolute;
right: 0;
top: 0;
bottom: 0;
margin: auto;
width: 50rpx;
height: 50rpx;
}

+ 460
- 0
config/config.js ファイルの表示

@@ -0,0 +1,460 @@
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
let weappId = extConfig.weappId;
let configUrls = extConfig.attr.configUrl;
let sockUrls = extConfig.attr.socketUrl;
var config = {
url: configUrls,
wsurl: sockUrls,
api: {
/*
*欢乐城首页专题
*/
showList: "/topic/showList",
/*
*记录微信订阅
*/
activityDey: "/wxActivity/listStatus",//活动日历日期
activityCalendar: '/wxActivity/list',//活动日历列表
signDey: "/userSign/listStatus",//签到日期列表
continuousDye: "/userSign/signInStatus",//连续签到天数
userSign: "/userSign/signIn",//签到
signRule: "/credit/credit_rules",//签到规则
wxMsg: '/user/updateMsg',
/**
* 获取首页按钮
*/
wxCustomizeModule: "/wxCustomizeModule/list",
/**
* 微信消息推送获取模板id
*/
templateId: "/wxMsg/templateList",
//问卷列表
questionnaire: "/wxQuestionOneself/list",
//问卷详情
questionnaireDetail: "/wxQuestionOneself/detailsById",
//提交问卷
submitQuestin: "/wxQuestionOneself/userAdd",
//投诉建议add
suggest: "/wxOpinion/add",
/**
* 接口用途:login
*/
login: "/user/login",
/**
* 授权后获取用户的昵称,unionId等信息
*/
getUserInfo: "/user/getUserInfo",


/**
* 文件上传
*/
fileUpload: '/upload/awsFileUpload',

/**
* 图片上传
*/
imgUpload: '/upload/awsImgUpload',

/**
* 接口用途:授权后获取用户的手机号
*/
getUserPhone: "/user/getUserPhone",
/**
* 检查用户授权状态
*/
checkUserStatus: "/user/checkUserStatus",
/**
* 检查用户手机授权状态
*/
checkPhoneStatus: "/user/checkPhoneStatus",
/**
* 商户优惠信息
*/
listByMerchant: "/wxCouponChannel/listByMerchant",

/**
* 获取券价格与库存
*/
couponPriceAndStock: "/wxCoupon/couponPriceAndStock",

couponInfo: "/wxCoupon/couponInfo",

/**
* 获取券适用门店List
*/
couponMerchant: "/wxCoupon/couponMerchant",

/**
* 获取券详情
*/
newCouponDetail: '/wxCoupon/couponDetail',

/**
* 优惠券详情
*/
couponDetail: "/wxCoupon/detail",
/**
* 购物车订单详情
*/
goodsDetail: "/order/goodsDetail",
/**
* 优惠券图文混排详情
*/
couponHtmlDetail: "/wxCoupon/html",
couponHtmlDetailForPkg: "/couponOrder/html",
/**
* 获取样式
*/
setType: '/wxMiniappTheme/getOne',
/**
* 业态查询
* filter
* 2 券
* 1 商户
*/
businessList: "/wxBusiness/listAll",
/**
* 频道查询
*/
couponChannelList: "/wxCouponChannel/list",
/**
* 是否显示已售
*/
couponListShowSelled: "/sysConfig/getByKey?key=couponListShowSelled",
/**
* 换一换change
*/
change: "/wxCouponChannel/change",
/**
* 下订单
*/
orderSave: "/order/save",
/**
* 多少量下单
*/
goodsShopCartSave: "/order/goodsShopCartSave",
/**
* 支付订单
*/
payOrderCreate: "/pay/create",
/**
* 订单状态更新
*/
payOrderUpdate: "/pay/updatePayOrder",
/**
* 订单列表 /order/list
*/
orderList: "/order/listGoods_v1",

getWeRunData: '/user/getWeRunData',
/**
* 订单详情
*/
orderDetail: "/order/detail_v1",
// 券包详情
// orderDetailAll: "/order/detail_v1",
/**
* 券包
*/
couponOrderList: "/couponOrder/list",
/**
* 券包详情
*/
couponOrderDetail: "/couponOrder/detail", /// TODO
/**
* 验证码发送
*/
sendValidationCode: "/wxMsgValidationcode/sendvalidationcode",
/**
* 验证码确认
*/
validationCode: "/wxMsgValidationcode/hasvalidationcode",
/**
* 车场信息获取
*/
scoreLevelInfo: '/mall/scoreLevelInfo',
creditRules: '/credit/credit_rules',
getParkInfo: "/wxPark/info",
/**
* 用户所绑车牌获取
*/
userCarCount: "/user/carCount",
/**
* 用户所绑车牌获取
*/
getUserCarList: "/user/carList",
/**
* 联合登录
*/
carInit: "/car/init",
/**
* 停车支付订单列表
*/
carPayOrderList: "/car/payOrderList",
/**
* 绑车牌
*/
bindCar: "/car/bindCar",
/**
* 解绑车牌
*/
unbindCar: "/car/unbindCar",
/**
* 停车费
*/
getCarStopFee: "/car/getCarStopFee",
/**
* 停车费抵扣 (TJD)
*/
deductionFee: "/car/deductionFee",
/**
* 优免券领取
*/
getCarCoupon: "/car/getCoupon",
/**
* 停车券包
*/
couponOrderCarList: "/car/couponOrderList",
/**
* banner
*/
bannerlist: "/wxCampaign/list",
/**
* banner详情页面
*/
bannerDetail: "/wxCampaign/findById",
/**
* 授权个人信息
* 和授权手机号
* 和login页面
* 页面的图标
*/
marketicon: '/mall/getAppIcon',
/**
* 获取停车场状态
*/
getParkStatus: '/car/getParkStatus',
/**
* 检查核销的状态
*/
getStatus: "/couponOrder/getStatus",
/**
* 获得成长值
*/
getScore: '/user/userinfo',
/**
* 小程序分享
* title
* 描述
*/
getWeapNote: '/mall/getWeapNote',
/**
* 商场信息(小程序分享)
*/
getMallInfo: '/mall/mallInfo',
/**
* 小程序获取游戏路径
*/
getGame: '/game/getOne',
/**
* 小程序获取广告路径
*/
getGg: '/floatingLayer/getFloatingLayer',
/**
* 小程序某一个游戏信息
*/
getOneGame: '/game/getOneGame',
/**
* 用户更新信息
*/
updateInfo: "/user/updateUserInfo",
/**
* 查询问卷
*/
getQuestion: "/wxQuestion/getQuestion",
/**
* 提交问卷
*/
answerQuestion: "/wxQuestion/answerQuestion",
/**
*
获取打折商户列表
*/
discountMerchantList: "/mall/discountMerchantList",
/**
* 卡包分页列表接口
*/
cardorderList: "/couponOrder/cardList",
/**
* 卡券详情接口
*/
cardDetail: "/couponOrder/cardDetail",
/**
* C端扫B端储值卡支付订单
*/
cardPayOrder: "/cardPay/order_create",
/**
* 兑换历史列表
*/
scoreHistory: "/scoreHistory/list",
/**
* 获取用户折扣率
*/
getDiscountInfo: "/user/getDiscountInfo",
/**
* C端扫B端储值卡交易流水列表接口
*/
cardpayList: "/cardPay/list",
/**
* 根据code查询接口
*/
findByCode: "/merchant/findByCode",
/**
* 设置密码
*/
updatePayPassword: "/couponOrder/updatePayPassword",
/**
* 参与砍价
*/
pressOrderJoin: "/press/pressOrderJoin",
/**
* 我的砍价列表
*/
pressOrderList: "/order/pressOrderList",
/**
* 砍价订单详情
*/
pressOrderDetail: "/order/pressOrderDetail",
/**
*
*/
getPressOrderStatus: "/press/getPressOrderStatus",
/**
* 查询转赠卡状态
*/
queryCardStatus: "/couponOrder/queryCardStatus",
/**
* 领取转赠卡
*/
cardAccept: '/couponOrder/cardAccept',
/**
* 获取我的拼团列表
*/
getMySepllList: '/orderGroup/queryOrderGroup',
/**
*查询差1个的团购信息
*/
queryRemainOne: '/orderGroup/queryRemainOne',
/**
* *分页列表接口
*/
merchantList: "/merchant/list",
/*
* 查询拼团状态
*/
queryOrderGroupStatus: '/orderGroup/queryOrderGroupStatus',
/**
* 去拼团
*/
toOrderGroup: '/orderGroup/toOrderGroup',
/**
* 查询是否已参团
*/
queryAttendStatus: '/orderGroup/queryAttendStatus',
/**
* 专题
*/
topicShow: "/topic/show",
/**
* 专题详情
*/
topicFindById: "/topic/findById",
/**
* 积分券详情
*/
integralDetail: '/wxCoupon/findById',
/**
* 会员积分记录
*/
integralList: '/credit/list',
/**
* 用户更新位置信息
*/
updateLBS: "/user/updateLBS",
/**
* 用户更新信息
*/
updateUserInfo: "/user/updateUserInfo",
/**
* 用户更新scene
*/
updateScene: "/user/updateScene",
/**
* 富文本详情
*/
printHtmlById: "/wxCampaign/printHtmlById",
acfindById: "/wxActivity/findById",
acPrintHtmlById: "/wxActivity/printHtmlById",
//参与活动
activityJoin: "/wxActivityJoin/join",
//签到
activitySign: "/wxActivityJoin/sign",
activityList: "/wxActivityJoin/list",
//获取未支付的订单
getUnPaidOrder: "/order/getUnPaidOrder",
getCouponOrderByPassword: '/couponPassword/getCouponOrderByPassword',
getbuildingfloorlist: '/wxMallBuilding/getbuildingfloorlist',
//商场信息接口
getMallInfo: "/mall/mallInfo",
// 获取楼层楼座数据
getbuildingfloorlist: "/wxMallBuilding/getbuildingfloorlist",
// 获取所有直播间和商品信息
getReplayList: "/live/replayList",
// 获取直播房间回放数据和商品信息
getRoomList: "/live/roomList",
//商城地图
getStoreMap: "/wxMallBuilding/getbuildingfloorlist",
//判断有没有蜂鸟地图
ifFengMap: '/fengniaomap/getConfig',
//分享小程序二维码
getQrcodeFx: "/user/userinfoQrCode",
//添加收货地址
collectSite: "/userBasicInfoAddress/saveOrUpdate",
//收货地址列表
siteList: "/userBasicInfoAddress/list",
//查询收货地址
siteCheck: "/userBasicInfoAddress/findById",
//删除收获地址
siteDel: "/userBasicInfoAddress/del",
//确认收货
verify: "/couponOrder/verify",
//全包下订单
couponPackageSave: "/order/couponPackageSave",
//获取动态核销码
dynamicId: "/couponOrder/dynamicId",
// 获取卡详情
getCardDetail: "/couponPassword/getCardDetail",
resumeAdd: "/resume/add",
resumeDetail: "/resume/myResume",
resumeFileUpload: "/upload/awsFileUpload",
needAgreeProtocol: "/user/needAgreeProtocol",
appInfoDetail: "/user/appInfoDetail",
agreementProtocol: "/user/agreementProtocol",

},
weapp: {
AppId: weappId
},
ErrorCode: {
NICK_NOT_AUTH: 11004,
PHONE_NOT_AUTH: 11005,
PHONE_IS_ENCRYPTED: 11006
}
};
/*
for (var key in config.api) {
config.api[key] = apiPrefix + config.api[key];
}
*/
module.exports = config;

+ 262
- 0
custom-tab-bar/index.js ファイルの表示

@@ -0,0 +1,262 @@
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
let ifStoreApp = extConfig.attr.ifStoreApp;
const Http = require("../utils/HttpBasics");
var config = require("../config/config.js");
let app = getApp();
Component({
data: {
home_a_img: [],
selected: 0,
"color": "#abb1be",
"selectedColor": "#FD782D",
"list": [{
"pagePath": "/index/index",
"iconPath": "../assets/images/home.png",
"selectedIconPath": "../assets/images/home-a.png",
"text": "首页"
},
{
"pagePath": "/index/searchbar",
"iconPath": "../assets/images/mendian.png",
"selectedIconPath": "../assets/images/mendian-a.png",
"text": "门店"
},
{
"pagePath": "/index/passCar",
"iconPath": "../assets/images/park.png",
"selectedIconPath": "../assets/images/park-a.png",
"text": "停车"
},
{
"pagePath": "/index/user",
"iconPath": "../assets/images/user.png",
"selectedIconPath": "../assets/images/user-a.png",
"text": "我的"
}
]
},
created() {
if (app.globalData.token) {
this.getType()
}
},
// lifetimes: {
// attached: function () {
// // 在组件实例进入页面节点树时执行

// },
// },
attached() {
if (ifStoreApp == 1) {
this.setData({
list: [{
"pagePath": "/index/index",
"iconPath": "../assets/images/home.png",
"selectedIconPath": "../assets/images/home-a.png",
"text": "首页"
},
{
"pagePath": "/index/user",
"iconPath": "../assets/images/user.png",
"selectedIconPath": "../assets/images/user-a.png",
"text": "我的"
}
]
})
} else if (ifStoreApp == 2) {
this.setData({
list: [{
"pagePath": "/index/index",
"iconPath": "../assets/images/home.png",
"selectedIconPath": "../assets/images/home-a.png",
"text": "首页"
},
{
"pagePath": "/index/searchbar",
"iconPath": "../assets/images/mendian.png",
"selectedIconPath": "../assets/images/mendian-a.png",
"text": "门店"
},
{
"pagePath": "/index/user",
"iconPath": "../assets/images/user.png",
"selectedIconPath": "../assets/images/user-a.png",
"text": "我的"
}
]
})
}
},
methods: {
switchTab(e) {

// this.setData({
// list: this.data.home_a_img
// })
// console.log(this.data.home_a_img)

const data = e.currentTarget.dataset;
this.setData({
selected: data.index
})
console.log(data.index)
const url = data.path;
if (data.index == 0 || data.index == 3) {
this.getTemplateId()
}

wx.switchTab({
url
});
},
/**
* 获取全局样式
*/
getType() {
Http.get({
url: config.api.setType,
data: {
mouldType: app.globalData.mouldType
}
}).then(res => {
const {
code,
data
} = res
if (code == 200) {
app.globalData.styleLsit = data
this.setTabStyle()
}
// console.log(this.data.list[0].selectedIconPath, '99999999999999999999999999999999999999999')
})
},
// 初始换底部导航栏
setTabStyle: function () {
const that = this
console.log(app.globalData.mouldType, "mouldType")
if (app.globalData.mouldType == 0) {
that.setData({
selectedColor: `${app.globalData.styleLsit.t_in_std.styleClass}`,
list: [{
"pagePath": "/index/index",
"iconPath": `${app.globalData.styleLsit.t_in.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`,
"text": "首页"
},
{
"pagePath": "/index/searchbar",
"iconPath": `${app.globalData.styleLsit.t_md.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`,
"text": "门店"
},
{
"pagePath": "/index/passCar",
"iconPath": `${app.globalData.styleLsit.t_tc.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`,
"text": "停车"
},
{
"pagePath": "/index/user",
"iconPath": `${app.globalData.styleLsit.t_uc.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`,
"text": "我的"
}
],
})
} else if (app.globalData.mouldType == 1) {
that.setData({ //getTabBar().
selectedColor: `${app.globalData.styleLsit.t_in_std.styleClass}`,
list: [{
"pagePath": "/pages/theme/index1/index",
"iconPath": `${app.globalData.styleLsit.t_in.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`,
"text": "首页"
},
{
"pagePath": "/index/searchbar",
"iconPath": `${app.globalData.styleLsit.t_md.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`,
"text": "门店"
},
{
"pagePath": "/index/passCar",
"iconPath": `${app.globalData.styleLsit.t_tc.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`,
"text": "停车"
},
{
"pagePath": "/index/user",
"iconPath": `${app.globalData.styleLsit.t_uc.icon}`,
"selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`,
"text": "我的"
}
],
})

}

},

getTemplateId() {
// console.log("隐藏")
// wx.hideTabBar()
Http.get({
url: config.api.templateId,
// data: {
// pageNum: 1,
// pageSize: 100
// }
}).then(res => {
const {
code,
data
} = res
if (code == 200) {
this.setData({
templateId: data || ''
})
this.setWxMessage()
} else {
return
}
})
},
setWxMessage() {
let tmplIds = []
this.data.templateId.map(res => {
tmplIds.push(res.templateId)
})
wx.requestSubscribeMessage({
tmplIds: tmplIds,
success(res) {
console.log("我重复订阅")
let _statue = null
tmplIds.map((item, index) => { //判读用户是否点击了确定
if (res[item] == "accept") {
_statue = 'ok'
}
})
if (_statue == 'ok') {
Http.post({
url: config.api.wxMsg
}).then(res => {

wx.setStorageSync({
key: 'ifShowTab',
data: true,
})
console.log(res)
})
return
}

},
complete() {

}
})
},

}

})

変更されたファイルが多すぎるため、一部のファイルは表示されません

読み込み中…
キャンセル
保存