diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5077e7c --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +# Windows +[Dd]esktop.ini +Thumbs.db +$RECYCLE.BIN/ + +# macOS +.DS_Store +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes + +# Node.js +node_modules/ +.idea/workspace.xml +.idea/wexinapp.iml +.idea/vcs.xml +.idea/modules.xml +.idea/misc.xml +.idea/encodings.xml diff --git a/api/api.js b/api/api.js new file mode 100644 index 0000000..f6f6f08 --- /dev/null +++ b/api/api.js @@ -0,0 +1,21 @@ +//这个页面只调用接口 +var rq = require("../utils/request.js") +var regeneratorRuntime = require('../utils/runtime.js'); + +const wxRequest = async(params = {}, url) => { + let data = params.query || {}; + let res = await rq.promiseGet(url,data) + return res; +}; +//--检查是否购买自定义模板-- +const check_isbuy = (params) => wxRequest({}, "/store/storemoduleendtime/page?store_id=" + params.store_id + "&type=" + params.type); +//--获取config-- +const get_config=(stoid)=>wxRequest({},"/api/weshop/store/get/"+stoid); +//--获取自定义模板首页-- +const get_template_fir=(stoid)=>wxRequest({},"/api/weshop/store_module/gets/"+stoid+"/1/4"); + +module.exports = { + check_isbuy, + get_config, + get_template_fir, +} diff --git a/app.js b/app.js new file mode 100644 index 0000000..95fab52 --- /dev/null +++ b/app.js @@ -0,0 +1,292 @@ +var t = require("setting.js"), o = require("./utils/auth.js"), a = require("./utils/request.js"), e = require("./utils/common.js"), ut = require("./utils/util.js"); +var os=t; +var regeneratorRuntime = require('./utils/runtime.js'); +var api = require("./api/api.js") + +//公共方法和变量 +App({ + globalData: { + setting: t, + wechatUser: null, + userInfo: null, + config: null, + config2: null, + code: null, + heigth:0, + user_id: 5682068,// 4379287,// null,// 5682068, + buy_now:null, + picklist:null, //门店列表 + wuliuprice: null, //物流价格表 + wuliu: null, //物流公司 + baddr:null, + mobile: null, //记录手机 + getu:null, //记录会员信息 + sessionKey: null,//记录会员信息 + openid: null, //记录会员信息 + + to_group:null, //参团传递的数据 + wxapp_buy_obj:null,//微信小程序购买的Object + + }, + auth: o, + request: a, + onLaunch: function() { + this.initExt(); + var t = this.globalData.setting; + t.resourceUrl = t.url + "/template/mobile/rainbow"; + var clientWidth = wx.getSystemInfoSync().windowWidth; + var rpxR = 750 / clientWidth; + var calc = wx.getSystemInfoSync().windowHeight * rpxR; + this.globalData.heigth=calc; + + var app=this; + if(!app.globalData.userInfo){ + var user = wx.getStorageSync("userinfo"); + if (user && user.user_id){ + app.globalData.userInfo=wx.getStorageSync("userinfo"); + app.globalData.user_id= app.globalData.userInfo.user_id; + } + } + + }, + + //---初始化第三方---- + initExt: function() { + var tt=t; + console.log("initExt"); + console.log(11); + var t = wx.getExtConfigSync(), o = this.globalData.setting; + console.log(t); + t.appName ? (o.appName = t.appName, o.stoid = t.stoid) : tt=1; + }, + + //首页的第一次登录 + getUserFir(t){ + var s = this; + if (o.isAuth()) "function" == typeof t && t(s.globalData.userInfo, s.globalData.wechatUser); else { + if (!o.isAuth()) return o.wxLogin_fir(t); + if (null == s.globalData.userInfo) { + return o.wxLogin_fir(t); + } + } + }, + + getUserInfo: function(t, n, i) { + var s = this; + if (o.isAuth()) "function" == typeof t && t(s.globalData.userInfo, s.globalData.wechatUser); else { + if (!o.isAuth()) return o.auth(t); + if (null == s.globalData.userInfo){ + return o.auth(t); + } + /*--- + a.get("/api/user/userInfo", { + isShowLoading: void 0 === i || i, + success: function(o) { + s.globalData.userInfo = o.data.result, s.globalData.userInfo.head_pic = e.getFullUrl(s.globalData.userInfo.head_pic), + "function" == typeof t && t(s.globalData.userInfo, s.globalData.wechatUser); + } + });--*/ + } + }, + //----------------获取配置参数-------------------- + getConfig: function(t, o) { + var e = this; if(this.globalData.config==undefined) this.globalData.config=null; + this.globalData.config ? "function" == typeof t && t(this.globalData.config) : e.request.get("/api/weshop/store/get/" + e.globalData.setting.stoid, { + success: function(o) { + console.log('getConfig'); + if(o.data.code==0){ + e.globalData.config = o.data.data, "function" == typeof t && t(e.globalData.config); + } + } + }); + }, + + //----------------获取配置参数-------------------- + getConfig2: function (t, o) { + var e = this; + this.globalData.config2 && !o ? + "function" == typeof t && t(this.globalData.config2) : a.get("/api/weshop/storeconfig/get/" + e.globalData.setting.stoid, { + success: function (o) { + console.log('getConfig2'); + if (o.data.code == 0) { + e.globalData.config = o.data.data, "function" == typeof t && t(e.globalData.config); + } + } + }); + }, + + //----------------获取商家开启的物流-------------------- + getwuliu: function (t, o){ + var th = this, st = this.globalData.setting; + this.globalData.wuliu && !o ? + "function" == typeof t && t(this.globalData.wuliu) : a.get("/api/weshop/storeshipping/list", { + data: { store_id: st.stoid, status: 1, pageSize:600 }, + success: function (o) { + console.log('getwuliu'); + console.log(o); + if (o.data.code == 0) { + var arr = o.data.data.pageData; + console.log(arr); + arr.forEach(function(item,index){ + arr[index].code = item.shipping_code; arr[index].name = item.shipping_name; + }) + th.globalData.wuliu = arr, "function" == typeof t && t(arr); + } + } + }); + }, + + //----------------获取物流价格表-------------------- + getwuliuprice: function (t, o) { + var e = this,th=e, st = this.globalData.setting; + this.globalData.wuliuprice && !o ? + "function" == typeof t && t(this.globalData.wuliuprice) : a.get("/api/weshop/shippingarea/list",{ + data: { store_id: st.stoid,pageSize: 600 }, + success: function (o) { + console.log('getwuliuprice'); + console.log(o); + if (o.data.code == 0) { + var arr=o.data.data.pageData; + console.log(arr); + if (arr.length>0){ + for (var i = 0; i < arr.length;i++){ + arr[i].code = arr[i].shipping_code; + if (arr[i].json_config != "" && arr[i].json_config != undefined && arr[i].json_config != null ) + arr[i].config = JSON.parse(arr[i].json_config); + } + } + th.globalData.wuliuprice = o.data.data, "function" == typeof t && t(e.globalData.wuliuprice); + } + } + }); + }, + //----------------设置立即购买数组-------------------- + set_b_now: function (d) { this.globalData.buy_now=d;}, + get_b_now: function () {return this.globalData.buy_now}, + + getPrevPageData: function(t) { + void 0 === t && (t = 1); + var o = getCurrentPages(); + return o[o.length - t - 1].data; + }, + showLoading: function(t, o) { + void 0 === o && (o = 1500), wx.showToast({ + title: "加载中", + icon: "loading", + duration: o, + mask: !0, + complete: function() { + "function" == typeof t && setTimeout(t, o); + } + }); + }, + showSuccess: function(t, o, a) { + void 0 === a && (a = 1e3), wx.showToast({ + title: t, + icon: "success", + duration: a, + mask: !0, + complete: function() { + "function" == typeof o && setTimeout(o, a); + } + }); + }, + showWarning: function(t, o, a, e) { + //var imghost=this.globalData.setting.imghost; + !a && (a = 1500), void 0 === e && (e = !0), wx.showToast({ + title: t, + mask: e, + duration: a, + image:"/images/gt.png", + complete: function() { + "function" == typeof o && setTimeout(o, a); + } + }); + }, + + confirmBox: function(t, o) { + wx.showModal({ + title: t, + showCancel: !1, + complete: function() { + "function" == typeof o && o(); + } + }); + }, + + //----------获取所有的门店------------ + get_allsto(func){ + var th=this; + if (this.globalData.picklist!=null){ + "function" == typeof func && func(th.globalData.picklist); + }else{ + th.request.get("/api/weshop/pickup/page", { + data: { store_id: th.globalData.setting.stoid, pageSize: 600 }, + success: function (da) { + //设置门店 + //th.setData({ allsto: da.data.data.pageData }); + th.globalData.picklist = da.data.data.pageData; + "function" == typeof func && func(th.globalData.picklist); + } + }) + } + }, + + //同步化,在调用的时候要await + async get_isbuy() { + + var th=this; + await api.check_isbuy({ store_id: t.stoid, type: 5 }).then(res=>{ + var o=res; + if (o.data.code == 0) { + var ob = { isout: 0, isbuy: 1 }; + var arr = o.data.data.pageData; + var isbuy = 0; + //----如果数组不为空---- + if (arr.length > 0) { + arr.forEach(function (val, ind) { + if (val.is_sy == 0 && val.type == 5) { + isbuy = 1; + var now = ut.gettimestamp(); + if (now > val.end_time) ob.isout = 1; + return false; + } + }) + } + ob.isbuy = isbuy; + th.globalData.wxapp_buy_obj=ob; + } + }) + }, + + //--同步化,在调用的时候要await,获取商家config-- + async getConfig_ays(){ + if(this.globalData.config!=null) return false; + var th=this; + await api.get_config(this.globalData.setting.stoid).then(res=>{ + var o=res; + if(o.data.code==0){ + th.globalData.config = o.data.data; + } + }) + }, + + //----智能跳转,判断 非tabBar,tabBar页面的跳转---- + goto:function (url) { + var arr_tabbar=["/pages/index/index/index","/pages/goods/categoryList/categoryList", + "/pages/cart/cart/cart","/pages/user/index/index"]; + if(arr_tabbar.indexOf(url)!=-1){ + wx.switchTab({ url: url, }) //跳到tabbar页 + }else{ + wx.navigateTo({ url: url, }) //跳到非tabbar页 + } + }, + + //显示提示,word提示内容,type 0失败,提示 1成功 + my_warnning(word,type,that){ + var warn = that.selectComponent("#warn"); //组件的id + warn.open(word,type); + return 1; + } + +}); diff --git a/app.json b/app.json new file mode 100644 index 0000000..190518b --- /dev/null +++ b/app.json @@ -0,0 +1,116 @@ +{ + "pages": [ + "pages/index/index/index", + "pages/goods/categoryList/categoryList", + "pages/cart/cart/cart", + "pages/cart/cart2/cart2", + "pages/cart/cart4/cart4", + "pages/goods/goodsInfo/goodsInfo", + "pages/goods/goodsList/goodsList", + "pages/goods/search/search", + "pages/order/refund_order/refund_order", + "pages/payment/payment/payment", + "pages/user/index/index", + "pages/user/order_list/order_list", + "pages/user/order_detail/order_detail", + "pages/user/visit_log/visit_log", + "pages/user/address_list/address_list", + "pages/user/userinfo/userinfo", + "pages/user/account/account", + "pages/user/comment/comment", + "pages/user/return_goods_list/return_goods_list", + "pages/user/userinfo_edit/userinfo_edit", + "pages/user/collect_list/collect_list", + "pages/user/coupon/coupon", + "pages/user/checkcoupon/checkcoupon", + "pages/user/add_address/add_address", + "pages/user/account_list/account_list", + "pages/user/points_list/points_list", + "pages/user/recharge_list/recharge_list", + "pages/user/withdrawals_list/withdrawals_list", + "pages/user/add_comment/add_comment", + "pages/user/return_goods_info/return_goods_info", + "pages/user/return_goods/return_goods", + "pages/user/withdrawals/withdrawals", + "pages/user/recharge/recharge", + "pages/user/message_notice/message_notice", + "pages/user/express/express", + "pages/user/binding_info/binding_info", + "pages/user/get_user_info/get_user_info", + "pages/activity/seckill_list/seckill_list", + "pages/activity/pind_list/pind_list", + "pages/togoin/togoin", + "pages/getphone/getphone", + "pages/team/team_success/team_success", + "pages/team/team_show/team_show", + "pages/team/team_ping/team_ping", + "pages/cart/cart2_pt/cart2_pt", + "pages/cart/cart_wk/cart_wk", + + "pages/user/member/menber", + "pages/user/member/bring/bring", + "pages/user/member/bring/msg/msg", + "pages/user/member/account/account", + "pages/user/member/account_unable/account_unable", + "pages/user/member/cash_record/cash_record", + "pages/user/deposit/deposit", + "pages/user/deposit/prepaid/prepaid", + "pages/user/deposit/prepaid/msg/msg", + "pages/user/coupons/coupons", + "pages/user/coupons/qr_code/qr_code", + "pages/user/coupons/query/index", + "pages/user/coupons/exchange/exchange", + "pages/user/integral/integral", + "pages/user/integral/query/index", + "pages/user/integral/msg/msg", + + "pages/user/userqy/userqy", + "pages/user/user_spsy/user_spsy", + "pages/user/user_fw/user_fw", + "pages/user/user_coupon/user_coupon", + "pages/user/grow_value/grow_value" + + ], + "window": { + "backgroundTextStyle": "light", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "加载中...", + "navigationBarBackgroundColor": "#ffffff", + "backgroundColor": "#eeeeee", + "enablePullDownRefresh": true + }, + "tabBar": { + "color": "#6e6d6b", + "selectedColor": "#f23030", + "borderStyle": "white", + "backgroundColor": "#ffffff", + "list": [ + { + "pagePath": "pages/index/index/index", + "text": "首页", + "iconPath": "images/bar/index.png", + "selectedIconPath": "images/bar/index_on.png" + }, + { + "pagePath": "pages/goods/categoryList/categoryList", + "text": "分类", + "iconPath": "images/bar/fl.png", + "selectedIconPath": "images/bar/fl_on.png" + }, + { + "pagePath": "pages/cart/cart/cart", + "text": "购物车", + "iconPath": "images/bar/car.png", + "selectedIconPath": "images/bar/car_on.png" + }, + { + "pagePath": "pages/user/index/index", + "text": "我的", + "iconPath": "images/bar/user.png", + "selectedIconPath": "images/bar/user_on.png" + } + ] + }, + "debug": false, + "sitemapLocation": "sitemap.json" +} \ No newline at end of file diff --git a/app.wxss b/app.wxss new file mode 100644 index 0000000..4a90e28 --- /dev/null +++ b/app.wxss @@ -0,0 +1,301 @@ + +.flex { + display: flex; +} +.flex_auto { + flex: 1; +} +.container { + /*font-family: "iconfont" !important; */ + display: flex; flex-direction: column; + justify-content: space-between; + box-sizing: border-box; +} +page { + /*background-color: #f2f2f2;*/ +} +button { + border-radius: 0; padding-left: 0; + padding-right: 0; background-color: transparent; + font-size: 28rpx; +} +.wh100 { + width: 100%; + height: 100%; +} +.ellipsis-1 { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.ellipsis-2 { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; +} +.ellipsis-3 { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 3; +} +.pd-bg-fff { + padding: 0 30rpx; + background-color: #fff; + font-size: 32rpx; +} +.co-red { + color: #f23030; +} +.hide { + display: none; +} +.t-c { + text-align: center; +} +.cover-layer { + position: fixed; + left: 0; + top: 0; + right: 0; + bottom: 0; + z-index: 11; + background: rgba(0,0,0,0.4); + width: 100%; + height: 100%; +} +.modal-close { + position: absolute; + right: 25rpx; + top: 25rpx; +} +.no-data { + width: 100%; + text-align: center; +} +.no-data .no-data-title { + color: #9b9b9b; + margin-bottom: 30rpx; + font-size: 35rpx; +} +.no-data .cart-image { + width: 140px; + height: 140px; + margin-top: 100rpx; +} +.no-data .lookat { + padding: 16rpx 40rpx; + background-color: white; + display: inline; + margin: 0 auto; +} +.big{font-size:32rpx;} +.one-level-word{ + font-size: 60rpx; +} +.two-level-word{ + font-size:40rpx; +} +.three-level-word{ + font-size:28rpx; +} +.four-level-word{ + font-size:24rpx; +} +.five-level-word{ + font-size:20rpx; +} +/* 圆 */ +.circle{ + border-radius: 50%; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; +} +/* 水平垂直 */ +.flex-center{ +display:flex; +justify-content:center; +align-items:center; +} +/* 水平居中 */ +.flex-level{ + display:flex; +justify-content:center; +} +/* 垂直居中 */ +.flex-vertical{ + display:flex; +align-items:center; +} +/* 水平左垂直对齐 */ +.flex-left-center{ + display:flex; +justify-content:flex-start; +align-items:center; +} +/* 水平左对齐 */ +.flex-level-left{ + display:flex; +justify-content:flex-start; +} +/* 水平右对齐 */ +.flex-level-right{ + display:flex; +justify-content:flex-end; +} + +/* 水平右对垂直对齐 */ +.flex-right-vertical{ + display:flex; +justify-content:flex-end; +align-items:center; +} +/* 水平两端等距离*/ +.flex-equality{ + display:flex; +justify-content:space-around; +} +/* 相对定位 */ +.rel{ + position: relative; + +} +/* 相对定位 */ +.abs{ + position: absolute; +} +/* 隐藏溢出 */ +.hidden{ +overflow: hidden; +} +/*内容溢出滑动 */ +.slide{ +overflow:auto; +} +/* 处于底部 */ +.fixed{ +position:fixed; + bottom:0; +} +/* 中间等距两边贴边 */ +.flex-space-between{ + display: flex; + justify-content:space-between; +} + + +/* 垂直居中 中间等距两边贴边 7.13*/ +.flex-vertical-between{ + display:flex; +align-items:center; +justify-content:space-between; +} +/* 垂直居中 各项周围留有空白 */ +.flex-center-around{ + display:flex; +align-items:center; +justify-content:space-around; +} +/* 右向箭头 */ +.bg_right{ + border-top: 2rpx solid ; + border-right: 2rpx solid ; + transform: rotate(45deg); + display:inline-block; + width:18rpx;height:18rpx;border-color:#da0b31;margin-top:6rpx; + +} +/*********************** 7.15 */ +/* 左向箭头 */ +.bg_left{ + border-top: 2rpx solid ; + border-right: 2rpx solid ; + transform: rotate(225deg); + display:inline-block; + +} + +/* 文字中间加线条 */ +.word-line{ + text-decoration:line-through; +} + +.t-r{ + text-align: right; +} +.t-l{ + text-align: right; +} +.white{ + color: #fff; +} +.img_gray{ + -webkit-filter: grayscale(1);/* Webkit */ + filter:gray;/* IE6-9 */ + filter: grayscale(1);/* W3C */ +} +.ib{ + display:inline-block; +} + +@font-face { + font-family: '思源黑体'; + src: url(data:application/font-woff2;charset=utf-8;base64,d09GMgABAAAAAAyEABAAAAAAGSAAAAwoAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0ZGVE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/y4pdGR773dKs+bYcCVLuM65bu76k5MxTmHJ5yvDMizvjVp2ttcyTVM7ktddRkqdqqvI0o/sOw9xRbBnYnick2bWfCnba9m1nZJak92jjDx4YiQQAeNptj7dOQ0EUBXceweScc87BfjY2r9y7mJ7PoKHj+wHBuONKq2lWMzqpSr/39Zbq9N8Nfh6pomKMcSaYpMUU08wwyxzzLLDIEsussMoa62ywyRbb7LDLHvsccMgRx5xwyhnnXHDJFdfccMsd9zzwSJsONV16PLU+P96H/aYtO7KWXdmTo/99OZDPspFZhizyRQ7l6x+z/Ww/28/2s/1sP9vP9rP9bD/0hb7QF/pCX+gLfaEv9MXI555wT7gn3BPuCfcU+8V+sV/sF/vFfrFf7Bf7pfkGzMB9lwAAAAAAAAH//wACeNpjYGRgYOABYjEgZmJgBEIzIGYB8xgABfAAZXjaY2BgYGQAgqtL1DlA9M2IqW9hNABC6QcQAAB42mNgFGBgPP2PhyGK+cV/ZgYGZnUGBgZGBmTAAgB2EQReAAB42mN+wdDGwMCswPwChBncgNAKTCJoNyS+FRbxfwysDP9B+P9PMFseCFmB8C8Q/oeS/xkKGbngkBsAS/IYXAAA) format('woff'); + font-weight: 300; + font-style: normal; +} + +.fs20{ + font-size: 20rpx; +} +.fs22{ + font-size: 22rpx; +} +.fs24{ + font-size: 24rpx; +} +.fs26{ + font-size: 26rpx; +} +.fs28{ + font-size: 28rpx; +} + +.fs30{ + font-size:30rpx; +} +.fs32{ + font-size:32rpx; +} +.fs35{ + font-size:35rpx; +} +.fs45{ + font-size: 45rpx; +} +.fs50{ + font-size: 50rpx; +} +.fs60{ font-size:60rpx;} + +/* 7.26 */ +.xc-wc{ + color: #e4374d; +} +.oh{ + overflow: hidden; +} + +.xc-ash{ +color: #b9b9b9; +} +.xc-black{ + color: #000; +} + + + diff --git a/components/diy_advertising/diy_advertising.js b/components/diy_advertising/diy_advertising.js new file mode 100644 index 0000000..ea08dbc --- /dev/null +++ b/components/diy_advertising/diy_advertising.js @@ -0,0 +1,28 @@ +Component({ + properties: { + // 这里定义了innerText属性,属性值可以在组件使用时指定 + object:{ + type:Object, + value:null + }, + + }, + data: { + // 这里是一些组件内部数据 + yc:false, + btn: 1, + ad:false, + autoplay:false, + interval:5000, + duration:1000, + someData: {} + }, + methods: { + customMethod: function () { }, + //---智能跳转--- + go_url:function(e){ + var url=e.currentTarget.dataset.url; + getApp().goto(url); + } + } +}) \ No newline at end of file diff --git a/components/diy_advertising/diy_advertising.json b/components/diy_advertising/diy_advertising.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/diy_advertising/diy_advertising.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/diy_advertising/diy_advertising.wxml b/components/diy_advertising/diy_advertising.wxml new file mode 100644 index 0000000..f7b376d --- /dev/null +++ b/components/diy_advertising/diy_advertising.wxml @@ -0,0 +1,360 @@ + + + + + + + + + 建议宽度640 + + + + + + + + + + + + + + + + + + + + + + 建议宽度640 + + + + + + + + + + + + + + + + + + + + + + + + 300*300 + + + + + + + + + + + + + + + + + + + + + 200*200 + + + + + + + + + + + + + + + + + + + 300*300 + + + + + + + + + + + + 300*150 + + + + + + + + + + 300*150 + + + + + + + + + + + + + + + + + 200*200 + + + + + + + + + + 400*200 + + + + + + + + + + + + + 400*200 + + + + + + + + + + 200*200 + + + + + + + + + + + + + + + + + 300*150 + + + + + + + + + + + 300*300 + + + + + + + + + + + + + + 300*300 + + + + + + + + + + + 300*150 + + + + + + + + + + + + + + + + + + + + + + + + + + + 200*200 + + + + + + + + + + + 200*200 + + + + + + + + + + + + + + + 200*200 + + + + + + + + + + + 200*200 + + + + + + + + + + + + + + + + 200*420 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/components/diy_advertising/diy_advertising.wxss b/components/diy_advertising/diy_advertising.wxss new file mode 100644 index 0000000..f2e0625 --- /dev/null +++ b/components/diy_advertising/diy_advertising.wxss @@ -0,0 +1,350 @@ +/* pages/diy_gk/diy_gk.wxss */ + +.s1_gk { + /* background-color: rgb(129, 213, 249); */ + width: 100%; + color: #fff; + font-size: 32rpx; + min-height: 300rpx; + line-height: 300rpx; + text-align: center; +} + +.s1_gk image { + width: 100%; + height: 100%; + vertical-align: top; + padding: 0rpx; + margin: 0rpx; +} + +.s1 { + width: 100%; + display: flex; +} + +.s2_w { + width: 100%; + height: 100%; + display: flex; +} + +.s3_gk image { + width: 100%; + height: 100%; + vertical-align: top; + padding: 0rpx; + margin: 0rpx; +} + +.s5_gk image { + width: 100%; + height: 100%; + vertical-align: top; + padding: 0rpx; + margin: 0rpx; +} + +.s5_g5_1 image { + width: 100%; + height: 100%; + vertical-align: top; + padding: 0rpx; + margin: 0rpx; +} + +.s6 image { + width: 100%; + height: 100%; + vertical-align: top; + padding: 0rpx; + margin: 0rpx; +} + +.s8_gk8 image { + width: 100%; + height: 240rpx; + vertical-align: top; + padding: 0rpx; + margin: 0rpx; +} + +.s7_gk7 image { + width: 100%; + height: 100%; + vertical-align: top; + padding: 0rpx; + margin: 0rpx; +} + +.s5_g5_2 image { + width: 100%; + height: 100%; + vertical-align: top; + padding: 0rpx; + margin: 0rpx; +} + +.s4_gk image { + width: 100%; + height: 100%; + vertical-align: top; + padding: 0rpx; + margin: 0rpx; +} + +.s1_gk1 { + /* background-color: rgb(255, 129, 149); */ + width: 100%; + color: #fff; + font-size: 32rpx; + min-height: 300rpx; + line-height: 300rpx; + text-align: center; +} + +.s2_gk { + /* background-color: rgb(129, 213, 249); */ + width: 98%; + color: #fff; + font-size: 32rpx; + min-height: 300rpx; + line-height: 300rpx; + text-align: center; + margin: 8rpx; +} + +.s2_gk image { + width: 100%; + height: 100%; + vertical-align: top; + padding: 0rpx; + margin: 0rpx; +} + +.s2_gk1 { + /* background-color: rgb(255, 129, 149); */ + width: 97%; + color: #fff; + font-size: 32rpx; + min-height: 300rpx; + line-height: 300rpx; + text-align: center; + margin: 10rpx; +} + +.s3 { + width: 101%; + /* min-height: 20rpx; */ +} + +.s3_gk { + /* background-color: rgb(129, 213, 249); */ + width: 48%; + color: #fff; + font-size: 32rpx; + line-height: 300rpx; + text-align: center; + float: left; + margin-left: 8rpx; + margin-bottom: 8rpx; +} + +.s3_gk1 { + /* background-color: rgb(255, 129, 149); */ + width: 48%; + color: #fff; + font-size: 32rpx; + line-height: 300rpx; + text-align: center; + float: left; + margin-left: 10rpx; +} + +.s4_gk { + /* background-color: rgb(129, 213, 249); */ + width: 32%; + color: #fff; + font-size: 32rpx; + height: 240rpx; + text-align: center; + margin-left: 1%; + float: left; + margin-bottom: 8rpx; +} + +.s4_gk1 { + /* background-color: rgb(255, 129, 149); */ + width: 30%; + color: #fff; + font-size: 32rpx; + line-height: 200rpx; + text-align: center; + margin: 6rpx; + float: left; +} + +.s5 { + display: flex; + margin: 0px; + margin-bottom: 8rpx; +} + +.s5_gk { + /* background-color: rgb(129, 213, 249); */ + width: 366rpx; + height: 390rpx; + color: #fff; + font-size: 32rpx; + text-align: center; + flex: 1; + margin-left: 6rpx; +} + +.s5_g5 { + flex: 1; + /* background-color: white; */ + width: 366rpx; + height: 390rpx; + margin: 0 6rpx; +} + +.s5_g5_1 { + width: 100%; + height: 192rpx; + margin-bottom: 6rpx; + line-height: 150rpx; + text-align: center; + color: #fff; + font-size: 32rpx; +} + +.s5_g5_2 { + width: 100%; + height: 192rpx; + line-height: 150rpx; + text-align: center; + color: #fff; + font-size: 32rpx; +} + +.s6 { + width: 100%; + color: #fff; + font-size: 32rpx; + margin-bottom: 8rpx; +} + +.s6_gk6 { + width: 100%; + display: flex; + margin-top: 8rpx; +} + +.s6_gk6_1 { + width: 242rpx; + height: 242rpx; + margin-left: 8rpx; + text-align: center; +} + +.s6_gk6_2 { + width: 484rpx; + height: 242rpx; + text-align: center; + margin-left: 8rpx; +} + +.s7 { + width: 100%; + color: #fff; + font-size: 32rpx; + display: flex; +} + +.s7_gk7 { + width: 362rpx; + margin: 0 8rpx; + /* margin-top: 6rpx; */ +} + +.s7_gk7_1 { + width: 100%; + height: 181rpx; + /* background-color: #99cc66; */ + margin-right: 10rpx; + line-height: 150rpx; + text-align: center; + margin-bottom: 8rpx; +} + +.s7_gk7_2 { + width: 100%; + height: 362rpx; + /* background-color: #99cc66; */ + line-height: 300rpx; + text-align: center; + margin-right: 10rpx; + margin-bottom: 8rpx; +} + +.s8 { + width: 100%; + color: #fff; + font-size: 32rpx; + display: flex; +} + +.s8_gk8 { + flex: 1; + width: 30%; +} + +.s1_gk_a1 { + display: inline; + width: auto; + height: auto; +} + +.s8_gk1 { + /* background-color: rgb(255, 129, 149); */ + width: 96%; + color: #fff; + font-size: 32rpx; + line-height: 200rpx; + text-align: center; + margin: 6rpx; + margin-bottom: 10rpx; +} + +.s8_gk2 { + /* background-color: rgb(255, 129, 149); */ + width: 94%; + color: #fff; + font-size: 32rpx; + line-height: 496rpx; + text-align: center; + margin: 6rpx; +} + +/**index.wxss**/ + +.swiper { + height: 400rpx; + width: 98%; + padding:0 7rpx; + padding-bottom: 7rpx; + padding-top: 7rpx; + /* background-color: palevioletred; */ +} + +.swiper image { + height: 100%; + width: 100%; + margin: 0; +} + + +.zwp_s1{ + margin-bottom: 8rpx; +} \ No newline at end of file diff --git a/components/diy_assist/diy_assist.js b/components/diy_assist/diy_assist.js new file mode 100644 index 0000000..e0c1a1f --- /dev/null +++ b/components/diy_assist/diy_assist.js @@ -0,0 +1,18 @@ +Component({ + properties: { + object: { + type: Object, + value: null + }, + // 这里定义了innerText属性,属性值可以在组件使用时指定 + + }, + data: { + // 这里是一些组件内部数据 + someData: {} + }, + methods: { + // 这里是一个自定义方法 + customMethod() { } + } +}) \ No newline at end of file diff --git a/components/diy_assist/diy_assist.json b/components/diy_assist/diy_assist.json new file mode 100644 index 0000000..9e7089c --- /dev/null +++ b/components/diy_assist/diy_assist.json @@ -0,0 +1,3 @@ +{ + "component": true + } \ No newline at end of file diff --git a/components/diy_assist/diy_assist.wxml b/components/diy_assist/diy_assist.wxml new file mode 100644 index 0000000..ee12f72 --- /dev/null +++ b/components/diy_assist/diy_assist.wxml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/components/diy_assist/diy_assist.wxss b/components/diy_assist/diy_assist.wxss new file mode 100644 index 0000000..ebd5a1a --- /dev/null +++ b/components/diy_assist/diy_assist.wxss @@ -0,0 +1,5 @@ +.assist{ + width: 100%; + min-height:90rpx; + border:1px solid #00F; +} \ No newline at end of file diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js new file mode 100644 index 0000000..3c0a401 --- /dev/null +++ b/components/diy_goodsGroup/diy_goodsGroup.js @@ -0,0 +1,293 @@ +// var e = function(e) { +// return e && e.__esModule ? e : { +// default: e +// }; +// }(require("../../utils/LoadMore3.js")), +// n = new e.default(), +var t = getApp(), + a = t.request, + o = t.globalData.setting, + os = o, + i = require("../../utils/util.js"), + ut = i, + s = require("../../utils/common.js"); +var regeneratorRuntime = require('../../utils/runtime.js'); + +Component({ + properties: { + // 这里定义了innerText属性,属性值可以在组件使用时指定 + object: { + type: Object, + value: null, + }, + + }, + data: { + // 这里是一些组件内部数据 + group: false, + imghost: o.imghost, + is_recommend: 0, + is_hot: 0, + is_new: 0, + baseUrl: "/api/weshop/goods/page", + resourceUrl: t.globalData.setting.resourceUrl, + currentPage: 1, + requestData: null, + requestUrl: "", + goods_array: null, + total: null, + prom_id: 0, + classstyle_id: null, + g_id: null, + wgroup: null, + goods_btn: null, + loadText: '加载更多', + someData: {}, + goodscount: null, + firist_type_data: null, + firist_type_curr: 0, + }, + + ready: function () { + console.log("ready"); + this.data.classstyle_id = this.data.object.classstyle; + this.data.goodscount = this.data.object.goodscount; + console.log(this.data.classstyle_id); + this.data.wgroup = this.data.object.wgroup; + console.log(this.data.wgroup); + this.setData({ + classstyle_id: this.data.object.classstyle + }) + if (this.data.object.goodsclass == 1) { + this.data.is_recommend = 1 + } + if (this.data.object.goodsclass == 2) { + this.data.is_hot = 1 + } + if (this.data.object.goodsclass == 3) { + this.data.is_new = 1 + } + this.data.requestData = new Array(); + this.data.g_id = this.data.object.data; + var arr = []; + + for (var i = 0; i < this.data.g_id.length; i += this.data.goodscount) { + arr.push(this.data.g_id.slice(i, i + this.data.goodscount)); + } + this.data.firist_type_data = arr; + console.log("firist_type_data"); + console.log(this.data.firist_type_data); + this.init(this.data.classstyle_id, this.data.wgroup); + + }, + methods: { + // 这里是一个自定义方法 + + init: function (classstyle_id, wgroup) { + var th = this; + var g_id = this.data.g_id; + if (classstyle_id == 1) { + //手动选择的时候 + g_id = this.data.firist_type_data[th.data.firist_type_curr]; + th.data.firist_type_curr++; + } + + var th = this, + app = getApp(), + index = 0, + gdata = []; + switch (classstyle_id) { + case "1": + g_id.forEach(function (val, ind) { + var item = {}; + var prom_id = null; + console.log(val.goodsid); + app.request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + val.goodsid, {}).then(res => { + //商品地址 + var goods = res.data.data; + th.setData({ + goods_btn: res.data.data + }) + + item.goods_name = goods.goods_name; + item.goods_img = th.data.imghost + goods.original_img; + item.market_price = goods.market_price; + item.shop_price = goods.shop_price; + item.sales_sum = goods.sales_sum; + item.goods_id = goods.goods_id; + prom_id = res.data.data.prom_id; + + var prom_type = res.data.data.prom_type; //0普通商品 1秒杀 6拼单 + + var url = ""; + if (prom_type == 1) { + url = "/api/weshop/teamlist/get/" + os.stoid + "/" + prom_id; + } else if (prom_type == 6) { + url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; + } + return app.request.promiseGet(url, {}) + }).then(res => { + index++; + var prom = res.data.data; + if (prom != null) { + item.shop_price = res.data.data.price; + } + th.data.requestData.push(item); + th.setData({ + goods_array: th.data.requestData, + }); + + if (th.data.firist_type_curr == th.data.firist_type_data.length) { + th.setData({ + goods_btn: [] + }); + } + }) + }) + break; + case "2": + console.log(2222222222222222222); + var item = {}; + app.request.promiseGet("/api/weshop/goods/page", { + data: { + store_id: 1, + is_recommend: th.data.is_recommend, + is_hot: th.data.is_hot, + is_new: th.data.is_new, + pageSize: th.data.goodscount , + page: th.data.currentPage, + } + }).then(res => { + //商品地址 + var goods = res.data.data.pageData; + th.setData({ + goods_btn: res.data.data.pageData, + total: res.data.data.total + }) + console.log(66666666677777777777); + console.log(res.data.data.total); + console.log(res.data); + console.log(this.data.total); + th.data.currentPage++; + + goods.forEach(function (val, ind) { + var item = {}; + var prom_id = null; + console.log(val.goodsid); + app.request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + val.goods_id, {}).then(res => { + //商品地址 + var goods = res.data.data; + + item.goods_name = goods.goods_name; + item.goods_img = th.data.imghost + goods.original_img; + item.market_price = goods.market_price; + item.shop_price = goods.shop_price; + item.sales_sum = goods.sales_sum; + item.goods_id = goods.goods_id; + prom_id = res.data.data.prom_id; + + var prom_type = res.data.data.prom_type; //0普通商品 1秒杀 6拼单 + + var url = ""; + if (prom_type == 1) { + url = "/api/weshop/teamlist/get/" + os.stoid + "/" + prom_id; + } else if (prom_type == 6) { + url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; + } + return app.request.promiseGet(url, {}) + }).then(res => { + var prom = res.data.data; + if (prom != null) { + item.shop_price = res.data.data.price; + } + th.data.requestData.push(item); + th.setData({ + goods_array: th.data.requestData, + page: th.data.currentPage-1, + }); + }) + }) + + }) + + break; + case "3": + var item = {}; + app.request.promiseGet("/api/weshop/goodsGroup/pageGoodsList", { + data: { + store_id: 1, + gpid: wgroup, + pageSize: th.data.goodscount, + page: th.data.currentPage, + } + }).then(res => { + //商品地址 + var goods = res.data.data.pageData; + console.log("333333333zwp" ); + console.log(res.data.data); + th.setData({ + goods_btn: res.data.data.pageData, + total: res.data.data.total + }) + console.log("goods_btn"); + console.log(th.data.goods_btn); + th.data.currentPage++; + goods.forEach(function (val, ind) { + var item = {}; + var prom_id = null; + console.log(val.goodsid); + app.request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + val.goods_id, {}).then(res => { + //商品地址 + var goods = res.data.data; + console.log("goods"); + console.log(goods); + // th.setData({ + // goods_btn: res.data.data + // }) + item.goods_name = goods.goods_name; + item.goods_img = th.data.imghost + goods.original_img; + item.market_price = goods.market_price; + item.shop_price = goods.shop_price; + item.sales_sum = goods.sales_sum; + item.goods_id = goods.goods_id; + prom_id = res.data.data.prom_id; + + var prom_type = res.data.data.prom_type; //0普通商品 1秒杀 6拼单 + + var url = ""; + if (prom_type == 1) { + url = "/api/weshop/teamlist/get/" + os.stoid + "/" + prom_id; + } else if (prom_type == 6) { + url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; + } + return app.request.promiseGet(url, {}) + }).then(res => { + var prom = res.data.data; + if (prom != null) { + item.shop_price = res.data.data.price; + } + th.data.requestData.push(item); + th.setData({ + goods_array: th.data.requestData, + page: th.data.currentPage-1, + }); + }) + }) + }) + break; + } + }, + setLoading: function () { + var that = this; + that.init(that.data.classstyle_id, that.data.wgroup); + }, + + //图片失败,默认图片 + bind_bnerr3: function (e) { + var _errImg = e.target.dataset.errorimg; + var _errObj = {}; + _errObj[_errImg] = this.data.imghost+"/public/images/default_goods_image_240.gif"; + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; + }, + } +}) \ No newline at end of file diff --git a/components/diy_goodsGroup/diy_goodsGroup.json b/components/diy_goodsGroup/diy_goodsGroup.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/diy_goodsGroup/diy_goodsGroup.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxml b/components/diy_goodsGroup/diy_goodsGroup.wxml new file mode 100644 index 0000000..1b21d89 --- /dev/null +++ b/components/diy_goodsGroup/diy_goodsGroup.wxml @@ -0,0 +1,924 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + + 销量:{{item.sales_sum}}件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + 销量:{{item.sales_sum}}件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + 销量:{{item.sales_sum}}件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + 销量:{{item.sales_sum}}件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + 销量:{{item.sales_sum}}件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + 销量:{{item.sales_sum}}件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + 销量:{{item.sales_sum}}件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + 销量:{{item.sales_sum}}件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + 销量:{{item.sales_sum}}件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + 销量:{{item.sales_sum}}件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + 销量:{{item.sales_sum}}件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + 销量:{{item.sales_sum}}件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + 销量:{{item.sales_sum}}件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + 销量:{{item.sales_sum}}件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + 销量:{{item.sales_sum}}件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + ¥{{item.shop_price}} + ¥{{item.market_price}} + + 销量:{{item.sales_sum}}件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxss b/components/diy_goodsGroup/diy_goodsGroup.wxss new file mode 100644 index 0000000..7452676 --- /dev/null +++ b/components/diy_goodsGroup/diy_goodsGroup.wxss @@ -0,0 +1,557 @@ +/* pages/diy_zs/diy_zs.wxss */ + +.zs_goods{ + width: 100%; + min-height: 500rpx; +border: 2rpx #ddd solid; +margin: 0 auto; +} + +.zwp_3{ + /* width: 30%; */ +} + +.s1_gk_a1{ + display: inline; + width: auto; + height: auto; +} +.clear{ + clear: both; +} +.zs_top{ + width: 100%; + min-height: 700rpx; + margin: 0 auto; + padding-left:22rpx; +padding-bottom:30rpx; + +display: flex; +/* padding-left: 6rpx; */ +/* padding-right: 30rpx; */ +} + +.zs_t_img { + width: 700rpx; + height: 700rpx; + /* margin: 0 auto; */ + /* background-color: bisque; */ + +} + +.zs_center{ + width: 100%; + min-height: 200rpx; + font-size: 28rpx; + color: #333; + text-align: left; + margin-left: 25rpx; + padding: 0 10rpx; +} + +.zs_wz1{ + overflow: hidden; + text-overflow: ellipsis; + margin-bottom:10rpx; +font-size:28rpx; + white-space: nowrap; +} + + +.zs_wz2{ + overflow: hidden; + text-overflow: ellipsis; + margin-bottom:10rpx; +font-size:28rpx; + white-space: nowrap; +} + +.zs_wz3{ + overflow: hidden; + text-overflow: ellipsis; + margin-bottom:10rpx; +font-size:28rpx; + white-space: nowrap; +} + +.zs_wz4{ + overflow: hidden; + text-overflow: ellipsis; + margin-bottom:10rpx; +font-size:28rpx; + white-space: nowrap; +} + +.zs_wz5{ + overflow: hidden; + text-overflow: ellipsis; + font-size:30rpx; + white-space: nowrap; +} + +.wz_red{ + + color: #C4182E; + font-size: 32rpx; +} + +.del{ + font-size: 24rpx; + color: #999; + text-decoration: line-through; +} + +.zs_t1{ + width: 56rpx; + height: 56rpx; + position: relative; + right: 58rpx; + bottom: -640rpx; +} + + +.zs_t2{ + width: 56rpx; + height: 56rpx; + position: relative; + right: 58rpx; + bottom: -2rpx; +} + +.zs_t3{ + width: 56rpx; + height: 56rpx; + position: relative; + right: 692rpx; + bottom: -4rpx; +} + + +.zs_t4{ + width: 56rpx; + height: 56rpx; + position: relative; + right: 692rpx; + bottom: -642rpx; +} + + + + +/* xiao */ + + +.zs_goods_xiao_bottom{ + width: 100%; + min-height: 300rpx; + + display: flex; + border-bottom: 2rpx #eee solid; + padding: 10rpx; + background-color: white; + +} + +.zs_goods_xiao{ + width: 100%; + min-height: 300rpx; + + display: flex; + /* border-bottom: 2rpx #eee solid; */ + padding: 10rpx; + background-color: white; +} + +.zs_top_x{ + width: 400rpx; + height: 318rpx; + margin-top: 20rpx; + /* /* padding-top:30rpx; +padding-bottom:30rpx; */ + +display: flex; + +} + +/* .zs_goods_xiao{ + background-color: white; +} */ + +.zs_t_img_x { + width: 290rpx; + height: 290rpx; + margin-left: 20rpx; + /* background-color: bisque; */ + +} + +.zs_center_x{ + + width: 100%; + min-height: 200rpx; + font-size: 28rpx; + color: #333; + text-align: left; + margin-top: 30rpx; + padding: 0 10rpx; +} + +.zs_wz1_x{ + overflow: hidden; + text-overflow: ellipsis; + margin-bottom:10rpx; +font-size:28rpx; + white-space: nowrap; + width: 80%; +} + + +.zs_wz2_x{ + overflow: hidden; + text-overflow: ellipsis; + margin-bottom:10rpx; +font-size:28rpx; + white-space: nowrap; +} + +.zs_wz3_x{ + overflow: hidden; + text-overflow: ellipsis; + margin-bottom:10rpx; +font-size:28rpx; + white-space: nowrap; +} + +.zs_wz4_x{ + overflow: hidden; + text-overflow: ellipsis; + margin-bottom:10rpx; +font-size:28rpx; + white-space: nowrap; +} + +.zs_wz5_x{ + overflow: hidden; + text-overflow: ellipsis; + font-size:30rpx; + white-space: nowrap; +} + +.wz_red{ + color: #C4182E; + font-size: 32rpx; +} + +.del{ + font-size: 24rpx; + color: #999; + text-decoration: line-through; + margin-left: 10rpx; + margin-top: 8rpx; +} + +.zs_t1_x{ + width: 56rpx; + height: 56rpx; + position: relative; + right: 62rpx; +top: 6rpx; +} + +.zs_t1_x1{ + width: 56rpx; + height: 56rpx; + position: relative; + right: 285rpx; +top: 6rpx; +} + +.zs_t1_x2{ + width: 56rpx; + height: 56rpx; + position: relative; + right: 56rpx; +top: 234rpx; +} + + +.zs_t1_x3{ + width: 56rpx; + height: 56rpx; + position: relative; + right: 288rpx; +top: 234rpx; +} + +/*1列2个*/ + +.zs_goods_ban{ + width: 100%; + min-height: 300rpx; +} + +.zs_goods_wai_ban{ + display: flex; + /* padding-left: 2rpx; */ + margin-bottom: 12rpx; + width: 50%; + float: left; + background: #fff; +} + + +.zs_goods_2l{ + width: 94%; + min-height: 300rpx; + border: 2rpx #ddd solid; + margin: 0 auto; +padding: 2rpx; +} + +.zs_top_2l{ + width: 300rpx; + height: 300rpx; + + +} + +.button-wrapper button { + /*width: 94%;*/ + border: none; +} + + +.zs_t_img_2l { + width: 100%; + height: 300rpx; + margin: 0 auto; +} + +.zs_center_2l{ + width: 100%; + min-height: 200rpx; + font-size: 28rpx; + color: #333; + text-align: left; + padding: 0 10rpx; +} + +.zs_wz1_2l{ + overflow: hidden; + text-overflow: ellipsis; + margin-bottom:10rpx; + font-size:30rpx; + white-space: nowrap; + margin-top: 10rpx; +} + + +.zs_wz2_2l{ + overflow: hidden; + text-overflow: ellipsis; + margin-bottom:10rpx; + font-size:30rpx; + white-space: nowrap; + margin-top: 10rpx; +} + +.zs_wz3_2l{ + overflow: hidden; + text-overflow: ellipsis; + margin-bottom:10rpx; + font-size:30rpx; + white-space: nowrap; + margin-top: 10rpx; +} + +.zs_wz4_2l{ + overflow: hidden; + text-overflow: ellipsis; + margin-bottom:10rpx; + font-size:30rpx; + white-space: nowrap; + margin-top: 10rpx; +} + +.zs_wz5_2l{ + overflow: hidden; + text-overflow: ellipsis; + font-size:30rpx; + white-space: nowrap; + margin-top: 10rpx; +} + + +.zs_t1_2l{ + width: 56rpx; + height: 56rpx; + position: relative; + right: -2rpx; + top: -310rpx; +} + + +.zs_t2_2l{ + width: 56rpx; + height: 56rpx; + position: relative; + right: -294rpx; + bottom: 310rpx; +} + +.zs_t3_2l{ + width: 56rpx; + height: 56rpx; + position: relative; + right: -294rpx; + bottom: 68rpx; +} + + +.zs_t4_2l{ + width: 56rpx; + height: 56rpx; + position: relative; + right: -2rpx; + bottom: 68rpx; +} + +/*一个3列*/ +.zs_goods_wai_san{ + width: 240rpx; + display: flex; + margin-left: 8rpx; + float: left; + margin-bottom: 8rpx; + background-color:white; + +} + +.zs_goods_san{ + width: 240rpx; + +} + + + + + + +.zs_goods_3l{ + width: 240rpx; + min-height: 300rpx; + border: 2rpx #ddd solid; + margin: 0 auto; + padding: 2rpx; +} + +.zs_top_3l{ + width: 240rpx; + height: 240rpx; + + + + + + +} + +.zs_t_img_3l { + width:237rpx; + height: 240rpx; + margin: 0 auto; + background-color: bisque; + +} + +.zs_center_3l{ + width: 100%; + min-height: 200rpx; + font-size: 28rpx; + color: #333; + text-align: left; + padding: 0 10rpx; +} + +.zs_wz1_3l{ + overflow: hidden; + text-overflow: ellipsis; + margin-bottom:10rpx; + font-size:30rpx; + height: 80rpx; + width: 227rpx; + /* white-space: nowrap; */ +} + + +.zs_wz2_3l{ + /* overflow: hidden; + text-overflow: ellipsis; */ + margin-bottom:10rpx; + font-size:30rpx; + /* white-space: nowrap; */ + display: flex; +} + +.zs_wz3_3l{ + overflow: hidden; + text-overflow: ellipsis; + margin-bottom:10rpx; + font-size:30rpx; + white-space: nowrap; +} + +.zs_wz4_3l{ + overflow: hidden; + text-overflow: ellipsis; + margin-bottom:10rpx; + font-size:30rpx; + white-space: nowrap; +} + +.zs_wz5_3l{ + overflow: hidden; + text-overflow: ellipsis; + font-size:30rpx; + white-space: nowrap; +} + + +.zs_t1_3l{ + width: 56rpx; + height: 56rpx; + position: relative; + right: 0rpx; + top: -250rpx; +} + + +.zs_t2_3l{ + width: 56rpx; + height: 56rpx; + position: relative; + right: -177rpx; + bottom: 250rpx; +} + +.zs_t3_3l{ + width: 56rpx; + height: 56rpx; + position: relative; + right: -177rpx; + bottom: 67rpx; +} + + +.zs_t4_3l{ + width: 56rpx; + height: 56rpx; + position: relative; + right: 0rpx; + bottom: 67rpx; +} + +.zs_goods_wai{ + background-color: white; + margin-top: 10rpx; +} \ No newline at end of file diff --git a/components/diy_groupbuy/diy_groupbuy.js b/components/diy_groupbuy/diy_groupbuy.js new file mode 100644 index 0000000..36f7de1 --- /dev/null +++ b/components/diy_groupbuy/diy_groupbuy.js @@ -0,0 +1,25 @@ +Component({ + properties: { + // 这里定义了innerText属性,属性值可以在组件使用时指定 + + style_b: { + type: Number, + value: 3, + }, + + + + + + }, + data: { + // 这里是一些组件内部数据 + bulk:false, + someData: {} + }, + methods: { + // 这里是一个自定义方法 + + customMethod: function () { } + } +}) \ No newline at end of file diff --git a/components/diy_groupbuy/diy_groupbuy.json b/components/diy_groupbuy/diy_groupbuy.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/diy_groupbuy/diy_groupbuy.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/diy_groupbuy/diy_groupbuy.wxml b/components/diy_groupbuy/diy_groupbuy.wxml new file mode 100644 index 0000000..c95c04c --- /dev/null +++ b/components/diy_groupbuy/diy_groupbuy.wxml @@ -0,0 +1,185 @@ + + + + + + + +团购 + + + + + + + + + + + +11天22小时33分44秒 + + + +ddddd +¥1111111111111 +¥1111111111111111 + + + + 已抢50件 + 50% + + + + + + + +11天22小时33分44秒 + + + +ddddd +1111 +1111 + + + + 已抢50件 + 50% + + + + + + + +11天22小时33分44秒 + + + +ddddd +1111 +1111 + + + 已抢50件 + 50% + + + + + + + + + + + + 距结束时间 + 1122:22:22 + + + + + + + + + + + ddddd + + + 已抢50件 + 50% + + + 1111 + 1111 + + + + + + + + + + + 距结束时间 + 1122:22:22 + + + + + + + + ddddd + + + 已抢50件 + 50% + + + 1111 + 1111 + + + + + + + + + + + 距结束时间 + 1122:22:22 + + + + + + + + ddddd + + + 已抢50件 + 50% + + + 1111 + 1111 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/diy_groupbuy/diy_groupbuy.wxss b/components/diy_groupbuy/diy_groupbuy.wxss new file mode 100644 index 0000000..0665ff4 --- /dev/null +++ b/components/diy_groupbuy/diy_groupbuy.wxss @@ -0,0 +1,487 @@ +/* pages/team_guo/team_guo.wxss */ + +/* pages/wp/wp.wxss */ +.kbstyle{ + background-color: red; + width: 100%; + height: 60rpx; +} + +.right_b{ + width: 30rpx; + height: 100%; + background: url(https://mshopimg.yolipai.net/miniapp/images/user/leftTip.png) no-repeat center center; + background-size: 22rpx 40rpx; + margin-left: 600rpx; +} + +.top_b{ + width: 100%; + background-color: white; + height: 70rpx; + line-height: 70rpx; + color: #000; + text-align: left; + border-bottom: 2rpx solid #eee; + display: flex; +} + +.top_b .t_left_b{ + width: 6rpx; + height: 38rpx; + background: #C4182E; + margin-top:18rpx; +margin-right:12rpx; + +} + + +.sp_b{ + min-height: 300rpx; + width: 100%; + background-color: white; + padding:18rpx; +display: flex; +} + +.sp_b .sp_top_b{ + height: 220rpx; + min-width: 30%; + background-color: bisque; + +} + +.sp_b .sp_top_b .s_img_b{ + width: 210rpx; + height: 100%; +} + +.sp_b .sp_top_b .s_img_b image{ + width: 210rpx; + height: 100%; + background-color: blueviolet; + position:relative; +top:-24rpx; +left:-64rpx; + +} + +.sp_b .sp_top_b .s_top_b{ + position: absolute; +background-color:#C4182E; +font-size:24rpx; +height:38rpx; +line-height:38rpx; +left:40rpx; +top:160rpx; +padding:0 10rpx; +color:white; +border-radius:10rpx; + +} + +.sp_b .sp_top_b .s_foot_bulk{ + font-size: 20rpx; + position: relative; + top:-40rpx; + width: 210rpx; + height: 38rpx; + line-height: 38rpx; + color: #fff; + text-align: center; + background-color: rgba(0, 0, 0, 0.5); +} + + + +.sp_wz_b{ +width: 210rpx; + min-height:100rpx; + +} + +.sp_wz_b .sp_wzi_b{ + font-size: 28rpx; + border-bottom: 2rpx solid #dcdcdc; + width: 100%; + text-align: left; + padding: 4rpx 0; + overflow: hidden; + height: 48rpx; + text-overflow: ellipsis; + display: inline-block; + white-space: nowrap; +} + +.sp_wz_b .sp_jg_b{ + color: #C4182E; + font-size: 20rpx; + width: 50%; + overflow: hidden; + display: inline-block; + + text-overflow: ellipsis; + white-space: nowrap; +} + +.sp_wz_b .sp_jgx_b{ + color: #dcdcdc; + text-decoration: line-through; + font-size: 20rpx; + width: 50%; + overflow: hidden; + display: inline-block; + + text-overflow: ellipsis; + white-space: nowrap; +} + +.one_b{ + margin-left: 14rpx; + +} + + +.sp_b .sp_top_b .s_top1_b{ + position: absolute; +background-color:#C4182E; +font-size:24rpx; +height:38rpx; +line-height:38rpx; +left:265rpx; +top:160rpx; +padding:0 10rpx; +color:white; +border-radius:10rpx; + +} + +.sp_b .sp_top_b .s_top2_b{ + position: absolute; +background-color:#C4182E; +font-size:24rpx; +height:38rpx; +line-height:38rpx; +right:146rpx; +top:160rpx; +padding:0 10rpx; +color:white; +border-radius:10rpx; + +} + + + +.sp_b .sp_top_b .s_foot1_bulk{ + font-size: 20rpx; + position: relative; + top:-40rpx; + width: 210rpx; + height: 38rpx; + line-height: 38rpx; + color: #fff; + text-align: center; + background-color: rgba(0, 0, 0, 0.5); +} + + + +.sp_b .sp_top_b .s_foot2_bulk{ + font-size: 20rpx; + position: relative; + top:-40rpx; + width: 210rpx; + height: 38rpx; + line-height: 38rpx; + color: #fff; + text-align: center; + background-color: rgba(0, 0, 0, 0.5); +} + + + + + + + +.sp2_b{ + width: 100%; + min-height: 240rpx; + +} + +.sp2_b .one1_b{ + width: 100%; + background-color: white; + height: 252rpx; + display: flex; + padding: 20rpx; + border-bottom:2rpx#eee solid; + +} + +.sp2_b .one1_b .o1_img_b{ + width: 200rpx; + height: 240rpx; + background-color: bisque; + margin-right: 24rpx; +} + +.o1_right_b .sp_wzi_b{ + font-size: 36rpx; + margin-bottom:6rpx; + + width: 100%; + text-align: left; + padding: 4rpx 0; + overflow: hidden; + height: 48rpx; + text-overflow: ellipsis; +} + +.o1_right_b .o1_sj_b{ + height: 60rpx; + + margin-bottom: 10rpx; +} + +.o1_right_b .o1_sj_b text{ + background-color: #fdcb08; + text-align: center; + border-radius: 10rpx; + padding:4rpx; +margin-left:6rpx; + +} + + + +.o1_right_b .sp_jg_b{ + color: #C4182E; + font-size: 36rpx; + width: 28%; + overflow: hidden; + margin-top: 10rpx; +} + +.o1_right_b .sp_jgx_b{ + color: #dcdcdc; + text-decoration: line-through; + font-size: 26rpx; + width: 50%; + overflow: hidden; + display: inline-block; + margin-top: 10rpx; +} + + +.o1_img_b image{ + width: 100%; + height: 100%; + background-color: blueviolet; + position: relative; + top:-24rpx; +left:-64rpx; + +} + +.o1_right_b .wo_b{ + background-color: #C4182E; + width: 160rpx; + height: 60rpx; + line-height: 60rpx; + color: white; + text-align: center; + font-size: 38rpx; + margin-left:298rpx; +border-radius:14rpx; + +} + +.guo_b{ + width: 100%; + border: 1px solid #C4182E; + text-align: left; + background-color: #fff; + border-radius:24rpx; +height:44rpx; +font-size:26rpx; +display: flex; +} + +.g_one_b{ + width: 50%; + height: 44rpx; + line-height: 44rpx; + text-align: left; + background-color: #C4182E; +color: white; +border-radius:24rpx; +padding-right: 2rpx; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; +} + +.g_one_b text{ + margin-left: 10rpx; + text-overflow: ellipsis; +} + +.g_two_b{ + height: 44rpx; + line-height: 44rpx; + text-align: right; + width: 50%; + color: #C4182E; +} + +.g_two_b text{ + margin-right: 10rpx; +} + +.g_top_b{ + display: flex; + background-color: #fbfaff; + color: #333; + font-size: 28rpx; + height: 60rpx; + line-height: 60rpx; + width: 94%; +} + +.g_top_b text{ + margin-left: 20rpx; +} + +.o1_sj_b text{ + background-color: #fdcb08; + text-align: center; + border-radius: 10rpx; + padding:4rpx; + margin-left:6rpx; + +} + +.o1_sj_b{ + margin-left: 370rpx; +} + +.sp2_guo_b{ + width: 100%; + border: 1px solid #C4182E; + text-align: left; + background-color: #fff; + border-radius:24rpx; + height:44rpx; + font-size:26rpx; + display: flex; +} + +.g_one2_b{ + width: 50%; + height: 44rpx; + line-height: 44rpx; + text-align: left; + background-color: #C4182E; + color: white; + border-radius:24rpx; + padding-right: 2rpx; +} + +.g_one2_b text{ + margin-left: 10rpx; +} + +.g_two2_b{ + height: 44rpx; + line-height: 44rpx; + text-align: right; + width: 50%; + color: #C4182E; +} + +.g_two2_b text{ + margin-right: 10rpx; +} + +.o1_sj1_bulk text{ + background-color: #fdcb08; + text-align: center; + border-radius: 10rpx; + padding:4rpx; + margin-left:6rpx; +} + + + + +.o1_sj1_bulk { + margin-left:306rpx; +} + +.o1_right_b{ + width: 456rpx; +} + + +.down-arrow { + display :inline-block; + position: relative; + width: 40rpx; + height: 30rpx; + margin-right: 20rpx; +} + +.down-arrow::after { + display: inline-block; + content: " "; + height: 18rpx; + width: 18rpx; + border-width: 0 2rpx 2rpx 0; + border-color: #999999; + border-style: solid; + transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0); + transform-origin: center; + transition: transform .3s; + position: absolute; + top: 50%; + right: 10rpx; + margin-top: -10rpx; +} + + + +.pt_center{ + background: #fff; + position: fixed; + padding: 15px; +} + +.pt_center .pt_zi span{ + color: #333; +} + +.pt_c_img image{ + background-color: red; + width: 48rpx; + height: 48rpx; + position: relative; + top: 0rpx; + right: 0rpx; + display: inline-block; +} + +.pt_c_img{ + display: inline-block; +} + +.pt_zi{ + width: 100%; + font-size: 36rpx; +} + +.g_g{ + background-color: #fff; + width: 100%; +} \ No newline at end of file diff --git a/components/diy_nav/diy_nav.js b/components/diy_nav/diy_nav.js new file mode 100644 index 0000000..a0ec676 --- /dev/null +++ b/components/diy_nav/diy_nav.js @@ -0,0 +1,52 @@ +var t = getApp(), + o = t.globalData.setting; + +Component({ + properties: { + // 这里定义了innerText属性,属性值可以在组件使用时指定 + object: { + type: Object, + value: null, + }, + + nav_list: { + type: Array, + value: [], + }, + + }, + data: { + // 这里是一些组件内部数据 + strs:null, + imghost: o.imghost, + someData: {} + }, + + ready: function() { + console.log("ready"); + var g_id = this.data.object.data; + this.pd_navicon(g_id); + }, + methods: { + // 这里是一个自定义方法,判断图片路径,并加载 + pd_navicon:function(g_id){ + + var item={}; + var nav_strs=g_id; + for (var i=0;i + + + + + + + + {{item.title}} + + + + + + {{item.title}} + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.title}} + + + + + + diff --git a/components/diy_nav/diy_nav.wxss b/components/diy_nav/diy_nav.wxss new file mode 100644 index 0000000..bab1c1d --- /dev/null +++ b/components/diy_nav/diy_nav.wxss @@ -0,0 +1,222 @@ +/* 最大的view*/ + +.big { + width: 100%; + /* min-height: 280rpx; */ + /* 先设置最小容器单位,min-height:280rpx;然后再设置auto */ + height: auto; + margin: 0rpx auto; + text-align: center; +} + +.s1_gk_a1 { + display: inline; +} + +/* 设置第一张图片的外框 */ + +.big_view_one { + width: 25%; + min-height: 145rpx; + height: auto; + display: inline-block; + text-align: center; + vertical-align: middle; +} + +/* 第一张图片 */ + +.print_one { + display: inline-block; + vertical-align: middle; + flex-direction: row; + margin-top: 30rpx; +} + +/* 第一个文字 */ + +.font_one { + /*display: flex;*/ + height: 40rpx; + font-size: 30rpx; + margin-top: 20rpx; + /*margin-left: 40rpx;*/ + text-align: center; +} + +/* 图片2的大框 */ + +.big_one_two { + display: inline-block; + /* display: flex; */ + width: 100%; + min-height: 122rpx; + height: auto; + margin: 0 auto; + text-align: center; +} + +/* 图片2的外框 */ + +.big_view_two { + display: inline-block; + /* display: flex; */ + width: 20%; + min-height: 86rpx; + line-height: 86rpx; + height: auto; + margin-top: 20rpx; + text-align: center; +} + +/* 图片2 */ + +.print_two { + margin-left: 5rpx; + vertical-align: middle; +} + +/* 文字2 */ + +.font_bicder_two { + display: inline-block; + width: 80rpx; + font-size: 30rpx; + /* margin-left: 40rpx; */ + vertical-align: middle; + line-height: 30rpx; + overflow: hidden; +} + +/* 3功能的大边框 */ + +.big_border_three { + display: flex; + widows: 100%; + height: 108rpx; +} + +/* 图片的边框 */ + +.bicder_picture { + display: flex; + width: 25%; +} + +/* 设置文字3 */ + +.font_three { + display: inline-block; + margin-left: 70rpx; + margin-top: 40rpx; + font-size: 30rpx; + font-family: "宋体"; +} + +/* 隐藏图片 */ + +.image_none { + display: none; +} + +/* 判断后端图片 */ + +.image { + margin-left: 55rpx; + width: 80rpx; + height: 80rpx; + transform: rotate(270deg); +} + +/* + 第二块 */ + +.big_two { + display: inline-block; + width: 100%; + min-height: 280rpx; + /* 先设置最小容器单位,min-height:280rpx;然后再设置auto */ + height: auto; +} + +image { + /* transform:rotate(270deg); */ +} + +/* 图片大外层 */ + +.one_div { + display: inline-block; + min-height: 50%; + width: 50%; + height: auto; +} + +/* 图片的外层 */ + +.picture_one { + display: inline-block; + margin-left: 50rpx; + vertical-align: middle; +} + +/* 文字1 */ + +.test { + width: 60rpx; + height: 40rpx; + margin-left: 30rpx; + font-size: 30rpx; + /* 被display:inline-block;要移动位置的时候用 vertical-align: middle; */ + display: inline-block; + vertical-align: middle; +} + +/* 图片2的大外层 */ + +.two_div { + display: inline-block; + min-height: 50%; + width: 50%; + height: auto; +} + +/* 图片2的外层*/ + +.picture_two { + display: inline-block; + vertical-align: middle; +} + +/* 文字2 */ + +.text_two { + width: 60rpx; + height: 40rpx; + margin-left: 30rpx; + font-size: 30rpx; + /* 被display:inline-block;要移动位置的时候用 vertical-align: middle中部; */ + display: inline-block; + vertical-align: middle; +} + +/* 外层view3 */ + +.three_div { + display: inline-block; + min-height: 50%; + width: 50%; + height: auto; + margin-top: 80rpx; +} + +/* 外层div4 */ + +.four_div { + display: inline-block; + min-height: 50%; + width: 50%; + height: auto; + /* margin-top: 30rpx; */ + vertical-align: middle; +} diff --git a/components/diy_notice/diy_notice.js b/components/diy_notice/diy_notice.js new file mode 100644 index 0000000..16cb045 --- /dev/null +++ b/components/diy_notice/diy_notice.js @@ -0,0 +1,30 @@ +var t = getApp(), + o = t.globalData.setting; +Component({ + properties: { + // 这里定义了innerText属性,属性值可以在组件使用时指定 + object: { + type: Object, + value: null, + }, + }, + data: { + // 这里是一些组件内部数据 + imghost: o.imghost, + someData: {}, + mleft:600, + timer: null, + width:0, + }, + ready: function() { + var th=this; + }, + detached() { + }, + methods: { + go_url:function (e) { + var url=e.currentTarget.dataset.url; + getApp().goto(url); + }, + } +}) \ No newline at end of file diff --git a/components/diy_notice/diy_notice.json b/components/diy_notice/diy_notice.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/diy_notice/diy_notice.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/diy_notice/diy_notice.wxml b/components/diy_notice/diy_notice.wxml new file mode 100644 index 0000000..be135f1 --- /dev/null +++ b/components/diy_notice/diy_notice.wxml @@ -0,0 +1,18 @@ + + + + + + + {{object.noticetxt}} + {{object.noticetxt}} + {{object.noticetxt}} + + + + + + + + + diff --git a/components/diy_notice/diy_notice.wxss b/components/diy_notice/diy_notice.wxss new file mode 100644 index 0000000..2330b15 --- /dev/null +++ b/components/diy_notice/diy_notice.wxss @@ -0,0 +1,55 @@ +.big_border { + width: 100%; + height: 80rpx; + margin-left:40rpx; + +} +.image_c{ + width: 35rpx; + height: 35rpx; + margin-top: 24rpx; +} + +.view1 { + width: auto; + height: 60rpx; + line-height: 60rpx; + margin-left: 20rpx; + margin-top:15rpx; + font-size: 30rpx; +} +.border_min{ + /* margin-top:-45rpx; */ + width: 640rpx; + height: 60rpx; + display:inline-block; + overflow: hidden; +} + + +@keyframes kf-marque-animation{ 0% { transform: translateX(0); } 100% { transform: translateX(-33.3%); } } +.marquee{ + width: 100%; + height: 44rpx; + line-height: 44rpx; + background: none; + border: none; + display: block; + overflow: hidden; + white-space: nowrap; + text-overflow: clip; + position: relative; + font-size: 28rpx; + margin-left: 50rpx; + margin-top: -45rpx; +} +.marquee .content{ + display: inline-block; + position: relative; + padding-right: 0px; + animation: kf-marque-animation 4.5s linear infinite; + white-space: nowrap; +} + +.pd_top10{margin: 10rpx 0} + diff --git a/components/diy_picMax/diy_picMax.js b/components/diy_picMax/diy_picMax.js new file mode 100644 index 0000000..f7ad03a --- /dev/null +++ b/components/diy_picMax/diy_picMax.js @@ -0,0 +1,33 @@ +Component({ + properties: { + object: { + type: Object, + value: null + }, + // 这里定义了innerText属性,属性值可以在组件使用时指定 + }, + data: { + // 这里是一些组件内部数据 + someData: {}, + pic_height:0,//图片组合的高度 + }, + ready: function () { + //console.log(this.data.object.data) + //--计算图片组合占用的高度-- + var height=0; + this.properties.object.data.forEach(function (val,ind) { + if(val.fir.x==0){ + height+=val.y_span*187; + } + }) + this.setData({pic_height:height}) + + }, + methods: { + //智能跳转到页面 + gopage(e) { + var url = e.currentTarget.dataset.url; + getApp().goto(url); + } + } +}) \ No newline at end of file diff --git a/components/diy_picMax/diy_picMax.json b/components/diy_picMax/diy_picMax.json new file mode 100644 index 0000000..9e7089c --- /dev/null +++ b/components/diy_picMax/diy_picMax.json @@ -0,0 +1,3 @@ +{ + "component": true + } \ No newline at end of file diff --git a/components/diy_picMax/diy_picMax.wxml b/components/diy_picMax/diy_picMax.wxml new file mode 100644 index 0000000..b518cc8 --- /dev/null +++ b/components/diy_picMax/diy_picMax.wxml @@ -0,0 +1,6 @@ + + + + + + diff --git a/components/diy_picMax/diy_picMax.wxss b/components/diy_picMax/diy_picMax.wxss new file mode 100644 index 0000000..2e3f653 --- /dev/null +++ b/components/diy_picMax/diy_picMax.wxss @@ -0,0 +1,8 @@ +.picMax{width: 100%; padding: 0 10rpx;position: relative;} +.pic_item{position: absolute; top:0;left:0;} +.pic_item image{width: 100%; height: 100%} +.width_1{width: 187rpx}.width_2{width: 374rpx;}.width_3{width: 561rpx}.width_4{width:748rpx;} +.height_1{height: 187rpx;}.height_2{height: 374rpx;}.height_3{height: 561rpx}.height_4{height: 748rpx;} +.mar_x1{margin-left:187rpx;}.mar_x2{margin-left:374rpx;}.mar_x3{margin-left:561rpx}.mar_x4{margin-left: 748rpx;} +.mar_y1{margin-top: 187rpx;}.mar_y2{margin-top: 374rpx;}.mar_y3{margin-top: 561rpx}.mar_y4{margin-top: 748rpx;} +.picMax-clear{clear: both;} \ No newline at end of file diff --git a/components/diy_pingd_buy/diy_pingd_buy.js b/components/diy_pingd_buy/diy_pingd_buy.js new file mode 100644 index 0000000..31975e9 --- /dev/null +++ b/components/diy_pingd_buy/diy_pingd_buy.js @@ -0,0 +1,169 @@ +// var e = function(e) { +// return e && e.__esModule ? e : { +// default: e +// }; +// }(require("../../utils/LoadMore3.js")), +// n = new e.default(), +var t = getApp(), + a = t.request, + o = t.globalData.setting, + os = o, + i = require("../../utils/util.js"), + ut = i, + s = require("../../utils/common.js"); +var regeneratorRuntime = require('../../utils/runtime.js'); + +Component({ + properties: { + // 这里定义了innerText属性,属性值可以在组件使用时指定 + object: { + type: Object, + value: null, + }, + goods_array: { + type: Array, + value: [] + }, + newTime: { + type: Number, + value: 0 + }, + }, + data: { + // 这里是一些组件内部数据 + yc: false, + someData: null, + ylp_img: "https://mshopimg.yolipai.net/", + timer: null, + iurl:o.imghost, + }, + ready: function() { + console.log("ready"); + var g_id = this.data.object.data; + console.log(g_id); + this.init(g_id); + }, + detached() { + // 页面被被销毁的时候,清除定时器 + clearInterval(this.data.timer); + }, + methods: { + // 这里是一个自定义方法 + customMethod: function() {}, + init: function(g_id) { + var th = this, + app = getApp(), all_array = [], + index = 0, + goodsidlist=""; + + //--先把商品ID串起来-- + g_id.forEach(function(val, ind) { + var item = {}; + goodsidlist+=val.goodsid+","; + }) + goodsidlist= goodsidlist.substr(0,goodsidlist.length-1); + + //--调用接口,读取拼单-- + app.request.promiseGet("/api/weshop/teamlist/getGoodsList?store_id=" + +os.stoid+"&goodsidlist="+goodsidlist, {}).then(res => { + + //如果拼单的数组为空的时候 + var goodslist=res.data.data; + if(goodslist.length==0) return false; + + /*--商品队列按照添加的顺序排列--*/ + g_id.forEach(function(val, ind) { + goodslist.forEach(function (vy,indy) { + if(val.goodsid==vy.goods_id){ + all_array.push(vy); + } + }) + }) + if(all_array.length==0){ + all_array=goodslist; + } + + var arr = new Array(); + //--三个三个一组--- + for(var i=0;i< all_array.length;i+=3){ + arr.push(all_array.slice(i,i+3)); + } + /*--熏染到前台--*/ + th.setData({goods_array:arr}); + var newTime = ut.gettimestamp(); + th.setData({ newTime: newTime }); + + th.data.timer = setInterval(function() { + th.countDown2(th); + }, 1000); + }); + }, + //---小于10的格式化函数---- + timeFormat: function(param) { + return param < 10 ? '0' + param : param; + }, + //----拼单倒计时函数----- + countDown2: function(ob) { + if (ob == undefined) return false; + var ee = ob; + // 获取当前时间,同时得到活动结束时间数组 + var newTime = ut.gettimestamp(); + var List = ee.data.goods_array; + if (List.length == 0) return false; + for (var j = 0; j < List.length; j++) { + // 对结束时间进行处理渲染到页面 + var endTimeList = List[j]; + for (var i = 0; i < endTimeList.length; i++) { + var o = endTimeList[i]; + var endTime = o.end_time; + // if (o.status == 0) endTime = o.start_time; + let obj = null; + // 如果活动未结束,对时间进行处理 + if (endTime - newTime > 0) { + let time = (endTime - newTime); + // 获取天、时、分、秒 + let day = parseInt(time / (60 * 60 * 24)); + let hou = parseInt(time % (60 * 60 * 24) / 3600); + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60); + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); + obj = { + day: this.timeFormat(day), + hou: this.timeFormat(hou), + min: this.timeFormat(min), + sec: this.timeFormat(sec) + } + } else { + //活动已结束,全部设置为'00' + obj = { + day: '00', + hou: '00', + min: '00', + sec: '00' + } + } + var txt = "goods_array[" + j + "][" + i + "].djs"; + ee.setData({ + [txt]: obj + }); + } + } + }, + //图片失败,默认图片 + bind_bnerr3: function (e) { + var _errImg = e.target.dataset.errorimg; + var _Img = e.target.dataset.img; + if (_Img != undefined) { + var _errObj = {}; + _errObj[_errImg] = "/public/images/default_goods_image_240.gif"; + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; + } + }, + go_to_pindlist:function () { + wx.navigateTo({ + url:"/pages/activity/pind_list/pind_list" + }); + } + }, + + +}) \ No newline at end of file diff --git a/components/diy_pingd_buy/diy_pingd_buy.json b/components/diy_pingd_buy/diy_pingd_buy.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/diy_pingd_buy/diy_pingd_buy.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/diy_pingd_buy/diy_pingd_buy.wxml b/components/diy_pingd_buy/diy_pingd_buy.wxml new file mode 100644 index 0000000..8808090 --- /dev/null +++ b/components/diy_pingd_buy/diy_pingd_buy.wxml @@ -0,0 +1,110 @@ + + + + + + 拼单 + + + + + + + + + + + + + + + 即将开始 + + + 火热进行 + + + + + + + + + + + + + + + + 商家 + 会员 + 阶梯 + + + + {{aitem.goods_name}} + ¥{{aitem.price}} + + + + {{aitem.ct_num}}人团 + + 去参团 + 去开团 + 去开团 + 已抢光 + + + + + + + + + + + + + + + + + + 商家 + 会员 + 阶梯 + + + + + + {{aitem.title}} + + 已团{{aitem.buy_num}}件 + {{aitem.ct_num}}人团 + + ¥{{aitem.price}} + ¥{{aitem.market_price}} + + + {{aitem.djs.day}}天{{aitem.djs.hou}}时{{aitem.djs.min}}分{{aitem.djs.sec}}秒 + + + 去参团 + 去开团 + 去参团 + 已抢光 + + + + + + + + + \ No newline at end of file diff --git a/components/diy_pingd_buy/diy_pingd_buy.wxss b/components/diy_pingd_buy/diy_pingd_buy.wxss new file mode 100644 index 0000000..7ecabf5 --- /dev/null +++ b/components/diy_pingd_buy/diy_pingd_buy.wxss @@ -0,0 +1,334 @@ +/* pages/wp/wp.wxss */ + +.top_p { + width: 100%; + background-color: white; + height: 70rpx; + line-height: 70rpx; + color: #000; + text-align: left; + border-bottom: 2rpx solid #eee; + display: flex; +} + +.right_p { + width: 30rpx; + height: 100%; + margin-left: 580rpx; +} + +.right_p image { + width: 30rpx; + height: 30rpx; +} + +.top_p .t_left_p { + width: 10rpx; + height: 38rpx; + background: #c4182e; + margin-top: 18rpx; + margin-right: 12rpx; + margin-left: 20rpx; +} + +.sp_p { + min-height: 300rpx; + width: 100%; + background-color: white; + padding: 18rpx; + display: flex; +} + +.sp_p .sp_top_p { + height: 220rpx; + min-width: 30%; + position: relative; +} + +.sp_p .sp_top_p .s_img_p { + width: 210rpx; + height: 100%; +} + +.sp_p .sp_top_p .s_img_p image { + width: 100%; + height: 100%; + background-color: blueviolet; + left: 0rpx; + vertical-align: middle; +} + +.sp_p .sp_top_p .s_top_p { + background-color: #c4182e; + font-size: 24rpx; + height: 38rpx; + line-height: 38rpx; + left: 6rpx; + padding: 0 10rpx; + border-radius: 10rpx; + z-index: 9; + position: absolute; + width: 100rpx; + color: #fff; + text-align: center; +} + +.sp_p .sp_top_p .s_foot_p { + font-size: 20rpx; + position: relative; + top: -90rpx; + width: 210rpx; + height: 38rpx; + line-height: 38rpx; + color: #fff; + text-align: center; + background-color: rgba(0, 0, 0, 0.5); +} + +.s_it { + width: 100%; + display: flex; + background-color: white; +} + +.s1_gk_a1 { + display: inline; + width: auto; + height: auto; +} + +.s_prom { + width: 100%; + background-color: white; + min-height: 200rpx; +} + +swiper { + display: block; + height: 400rpx; +} + +.sp_wz_p { + width: 210rpx; + min-height: 100rpx; +} + +.sp_wz_p .sp_wzi_p { + font-size: 30rpx; + border-bottom: 1rpx solid #dcdcdc; + width: 100%; + text-align: left; + padding: 4rpx 0; + overflow: hidden; + height: 48rpx; + line-height: 48rpx; + text-overflow: ellipsis; + white-space: nowrap; +} + +.sp_wz_p .sp_jg_p { + color: #c4182e; + font-size: 30rpx; + overflow: hidden; + display: inline-block; + text-overflow: ellipsis; + white-space: nowrap; + margin-right: 10rpx; +} + +.sp_wz_p .sp_jgx_p { + color: #adadad; + text-decoration: line-through; + font-size: 24rpx; + overflow: hidden; + display: inline-block; + text-overflow: ellipsis; + white-space: nowrap; +} + +.one_p { + margin-left: 20rpx; +} + +.sp_p .sp_top_p .s_top1_p { + position: absolute; + background-color: #c4182e; + font-size: 24rpx; + height: 38rpx; + line-height: 38rpx; + left: 265rpx; + top: 160rpx; + padding: 0 10rpx; + color: white; + border-radius: 10rpx; +} + +.sp_p .sp_top_p .s_top2_p { + position: absolute; + background-color: #c4182e; + font-size: 24rpx; + height: 38rpx; + line-height: 38rpx; + right: 146rpx; + top: 160rpx; + padding: 0 10rpx; + color: white; + border-radius: 10rpx; +} + +.sp_p .sp_top_p .s_foot1_p { + font-size: 20rpx; + position: absolute; + top: 332rpx; + width: 210rpx; + height: 38rpx; + line-height: 38rpx; + color: #fff; + text-align: center; + background-color: rgba(0, 0, 0, 0.5); +} + +.sp_p .sp_top_p .s_foot2_p { + font-size: 20rpx; + position: absolute; + top: 332rpx; + width: 210rpx; + height: 38rpx; + line-height: 38rpx; + color: #fff; + text-align: center; + background-color: rgba(0, 0, 0, 0.5); +} + +.sp2_p { + width: 100%; + min-height: 240rpx; +} + +.sp2_p .one1_p { + width: 100%; + background-color: white; + height: 252rpx; + display: flex; + padding: 20rpx; + border-bottom: 6rpx#eee solid; +} + +.sp2_p .one1_p .o1_img_p { + width: 200rpx; + height: 240rpx; + margin-right: 24rpx; +} + +.o1_right_p{position: relative; width: 485rpx;} + +.o1_right_p .sp_wzi_p { + font-size: 36rpx; + margin-bottom: 6rpx; + width: 100%; + text-align: left; + padding: 4rpx 0; + overflow: hidden; + height: 48rpx; + text-overflow: ellipsis; +} + +.o1_right_p .o1_sj_p { + height: 60rpx; + margin-bottom: 10rpx; + font-size: 28rpx; + line-height: 40rpx; +} + +.o1_right_p .o1_sj_p text { + background-color: #fdcb08; + text-align: center; + border-radius: 10rpx; + padding: 4rpx; + margin-left: 6rpx; +} + +.o1_right_p .sp_jg_p { + color: #c4182e; + font-size: 36rpx; + overflow: hidden; + display: inline-block; + margin-right: 10rpx; +} + +.o1_right_p .sp_jgx_p { + color: #adadad; + text-decoration: line-through; + font-size: 26rpx; + overflow: hidden; + display: inline-block; +} + +.o1_img_p image { + width: 100%; + height: 100%; + background-color: blueviolet; + position: relative; + top: -8rpx; + left: 0rpx; +} + +.o1_right_p .wo_p { + background-color: #c4182e; + width: 160rpx; + height: 60rpx; + line-height: 60rpx; + color: white; + text-align: center; + font-size: 26rpx; + border-radius: 14rpx; + position: absolute; + right: 0; + bottom:46rpx; +} + +.sp_sj_p { + background-color: red; + color: white; + font-size: 24rpx; + border-radius: 50%; + position: absolute; + bottom: 300rpx; + right: 0rpx; + top: 0; + width: 60rpx; + height: 60rpx; + text-align: center; + line-height: 60rpx; + +} + +.sp_sj1_p { + background-color: red; + color: white; + font-size: 24rpx; + border-radius: 50%; + position: relative; + bottom: 257rpx; + width: 60rpx; + height: 60rpx; + text-align: center; + line-height: 60rpx; +} +.tuan_set_num{ + display: flex;justify-content: space-between; font-size: 28rpx; +} + +.tuan_set_num .co-red2{ + color: #B2AEA8;font-size: 26rpx; +} +.tuan_set_num .cantuan{ + background:#c4182e; color: #fff; padding: 4rpx 10rpx; border-radius:5rpx ; +} +.tuan_set_num .cantuan.huise{ + background:gainsboro; color: #666; +} + +.o1_sj_p .time_img{width: 40rpx; height: 40rpx; vertical-align: top; margin-right: 10rpx;} +.o1_right_p .co-red2{font-size:30rpx; color: #999;} +.o1_right_p .co-red2 .yituan_num{font-size:30rpx; margin-right: 10rpx; color: #333;} diff --git a/components/diy_richtext/diy_richtext.js b/components/diy_richtext/diy_richtext.js new file mode 100644 index 0000000..67c2ba9 --- /dev/null +++ b/components/diy_richtext/diy_richtext.js @@ -0,0 +1,39 @@ +Component({ + properties: { + // 这里定义了innerText属性,属性值可以在组件使用时指定 + + nodes: { + type: String, + value: '

javascript - js同步编程与异步编程的区别,异步有哪些优点,为什么...

2016年5月20日 - 从编程方式来讲当然是同步编程的方式更为简单,但是同步有其局限性一是假如是单线程那么一旦遇到阻塞调用,会造成整个线程阻塞,导致cpu无法得到有效利用...
 - 百度快照
为您推荐:js同步和异步ajax异步和同步的区别
', + }, + my:{ + type: String, + value:'' + } + + + + }, + data: { + // 这里是一些组件内部数据 + + someData: {} + }, + + pageLifetimes: { + // 组件所在页面的生命周期函数 + show: () => { }, + hide: () => { } + }, + + + methods: { + // 这里是一个自定义方法 + + customMethod: function () { + this.setData({ + my:'oooooo' + }) + }, + } +}) \ No newline at end of file diff --git a/components/diy_richtext/diy_richtext.json b/components/diy_richtext/diy_richtext.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/diy_richtext/diy_richtext.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/diy_richtext/diy_richtext.wxml b/components/diy_richtext/diy_richtext.wxml new file mode 100644 index 0000000..ec52b63 --- /dev/null +++ b/components/diy_richtext/diy_richtext.wxml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/components/diy_richtext/diy_richtext.wxss b/components/diy_richtext/diy_richtext.wxss new file mode 100644 index 0000000..6528be0 --- /dev/null +++ b/components/diy_richtext/diy_richtext.wxss @@ -0,0 +1 @@ +/* pages/diy_fwb/diy_fwb.wxss */ \ No newline at end of file diff --git a/components/diy_searchbox/diy_searchbox.js b/components/diy_searchbox/diy_searchbox.js new file mode 100644 index 0000000..283717d --- /dev/null +++ b/components/diy_searchbox/diy_searchbox.js @@ -0,0 +1,33 @@ +var t = getApp(), + o = t.globalData.setting; + + +Component({ + properties: { + // 这里定义了innerText属性,属性值可以在组件使用时指定 + + object: { + type: Object, + value: null, + }, + }, + data: { + // 这里是一些组件内部数据 + yc:false, + imghost: o.imghost, + someData: {} + }, + ready: function() { + console.log("ready"); + }, + methods: { + //智能跳转 + go_url:function (e) { + var url=e.currentTarget.dataset.url; + getApp().goto(url); + } + + + + } +}) \ No newline at end of file diff --git a/components/diy_searchbox/diy_searchbox.json b/components/diy_searchbox/diy_searchbox.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/diy_searchbox/diy_searchbox.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/diy_searchbox/diy_searchbox.wxml b/components/diy_searchbox/diy_searchbox.wxml new file mode 100644 index 0000000..03bb09b --- /dev/null +++ b/components/diy_searchbox/diy_searchbox.wxml @@ -0,0 +1,30 @@ + + + + + + 在店铺内搜索 + + + + + + + + + + + + + + + 在店铺内搜索 + + + + + + + + + \ No newline at end of file diff --git a/components/diy_searchbox/diy_searchbox.wxss b/components/diy_searchbox/diy_searchbox.wxss new file mode 100644 index 0000000..774118e --- /dev/null +++ b/components/diy_searchbox/diy_searchbox.wxss @@ -0,0 +1,78 @@ +/* pages/diy_ss/diy_ss.wxss */ + +.ss{ + font-size: 28rpx; + text-align: center; + padding: 20rpx; +} + +.s_ge{ + width: 700rpx; + height: 70rpx; + text-align: center; + border-radius: 8rpx; + color: #999; + background: #fff none repeat scroll 0 0; + border: 2px solid #eee; + line-height: 64rpx; +} + +.s_ge image{ + width: 30rpx; + height: 30rpx; + margin-right: 10rpx; + margin-bottom: -8rpx; +} + +.ss2{ + background-color: rgb(232, 31, 24); + + display: flex; + width: 100%; + padding: 10rpx; + height: 70rpx; + line-height: 70rpx; +} + +.s2_left image{ + width: 35rpx; + height: 30rpx; + margin-left: 10rpx; +} + +.s2_cen{ + width: 80%; + height: 70rpx; + color: #fff; + text-align: left; + font-size: 28rpx; + line-height: 60rpx; + background-color: rgb(207, 6, 0); + margin-left: 20rpx; +} + +.s_ge text{ + margin-bottom: 10rpx; +} + +.s2_cen image{ + width: 30rpx; + height: 30rpx; + margin-left: 10rpx; + margin-right: 4rpx; + margin-bottom:-6rpx; +margin-top:20rpx; + +} + +.s1_gk_a1{ + display: inline; + width: auto; + height: auto; +} + +.s2_right image{ + width: 35rpx; + height: 30rpx; + margin-left: 20rpx; +} \ No newline at end of file diff --git a/components/diy_seckill/diy_seckill.js b/components/diy_seckill/diy_seckill.js new file mode 100644 index 0000000..289e298 --- /dev/null +++ b/components/diy_seckill/diy_seckill.js @@ -0,0 +1,179 @@ +// var e = function(e) { +// return e && e.__esModule ? e : { +// default: e +// }; +// }(require("../../utils/LoadMore3.js")), +// n = new e.default(), +var t = getApp(), + a = t.request, + o = t.globalData.setting, + os = o, + i = require("../../utils/util.js"), + ut = i, + s = require("../../utils/common.js"); +var regeneratorRuntime = require('../../utils/runtime.js'); +Component({ + properties: { + // 这里定义了innerText属性,属性值可以在组件使用时指定 + object: { + type: Object, + value: null, + }, + goods_array: { + type: Array, + value: [] + }, + newTime: { + type: Number, + value: 0 + }, + }, + data: { + // 这里是一些组件内部数据 + yc: false, + someData: null, + ylp_img: "https://mshopimg.yolipai.net/", + imghost: os.imghost, + timer: null, + }, + ready: function() { + console.log("ready"); + var g_id = this.data.object.data; + console.log(g_id); + this.init(g_id); + }, + detached() { + // 页面被被销毁的时候,清除定时器 + clearInterval(this.data.timer); + }, + methods: { + // 这里是一个自定义方法 + customMethod: function() {}, + init: function(g_id) { + var th = this, app = getApp(),all_array = [], goodsidlist=""; + + //--先把商品ID串起来-- + g_id.forEach(function(val, ind) { + var item = {}; + goodsidlist+=val.goodsid+","; + }) + + //--调用接口,读取秒杀-- + app.request.promiseGet("/api/ms/flash_sale/getGoodsList?store_id=" + +os.stoid+"&goodsidlist="+goodsidlist, {}).then(res => { + //如果秒杀的数组为空的时候 + console.log(111111111111) + console.log(res.data.data) + var goodslist=res.data.data; + if(goodslist.length==0) return false; + + // 判断火热,预热 + var newTime = ut.gettimestamp(); + th.setData({newTime:newTime}); + // for(var a=0;a< goodslist.length;a++){ + // var starTime=goodslist[a].start_time; + // var msStr=[]; + // console.log(2222222222) + // console.log(starTime+":"+newTime) + // if (starTime>newTime){ + // msStr.push() + // //th.setData({msText:'即将开始'}); + // } + // if (starTime 0) { + let time = (endTime - newTime); + // 获取天、时、分、秒 + let day = parseInt(time / (60 * 60 * 24)); + let hou = parseInt(time % (60 * 60 * 24) / 3600); + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60); + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); + obj = { + day: this.timeFormat(day), + hou: this.timeFormat(hou), + min: this.timeFormat(min), + sec: this.timeFormat(sec) + } + } else { + //活动已结束,全部设置为'00' + obj = { + day: '00', + hou: '00', + min: '00', + sec: '00' + } + } + var txt = "goods_array[" + j + "][" + i + "].djs"; + ee.setData({ + [txt]: obj + }); + } + } + }, + //图片失败,默认图片 + bind_bnerr3: function (e) { + var _errImg = e.target.dataset.errorimg; + var _errObj = {}; + _errObj[_errImg] = "/public/images/default_goods_image_240.gif"; + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; + }, + + go_to_skill:function () { + wx.navigateTo({ + url:"/pages/activity/seckill_list/seckill_list" + }); + } + }, + + +}) \ No newline at end of file diff --git a/components/diy_seckill/diy_seckill.json b/components/diy_seckill/diy_seckill.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/diy_seckill/diy_seckill.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/diy_seckill/diy_seckill.wxml b/components/diy_seckill/diy_seckill.wxml new file mode 100644 index 0000000..653412b --- /dev/null +++ b/components/diy_seckill/diy_seckill.wxml @@ -0,0 +1,100 @@ + + + + + 秒杀 + + + + + + + + + + + + + + + + 即将开始 + + + 火热进行 + + + + + + + + + {{aitem.djs.day}}天 + {{aitem.djs.hou}}时 + {{aitem.djs.min}}分 + {{aitem.djs.sec}}秒 + + + + + + + {{aitem.goods_name}} + ¥{{aitem.price}} + ¥{{aitem.market_price}} + + + + + + + + + + + + + + + + + + + + + {{aitem.goods_name}} + + {{aitem.djs.day}} + 天 + {{aitem.djs.hou}} + : + {{aitem.djs.min}} + : + {{aitem.djs.sec}} + + + ¥{{aitem.price}} + ¥{{aitem.market_price}} + + 正在预热 + + + 我要抢 + + + + + + + + + + + + + \ No newline at end of file diff --git a/components/diy_seckill/diy_seckill.wxss b/components/diy_seckill/diy_seckill.wxss new file mode 100644 index 0000000..8d24783 --- /dev/null +++ b/components/diy_seckill/diy_seckill.wxss @@ -0,0 +1,334 @@ + +.top{ + width: 100%; + background-color: white; + height: 70rpx; + line-height: 70rpx; + color: #000; + text-align: left; + border-bottom: 2rpx solid #eee; + display: flex; +} + + +.s_it{ + width: 100%; + display: flex; + background-color: white; +} + +.s_prom{ + width: 100%; + background-color: white; + min-height: 200rpx; +} + +swiper { + display:block; + height:400rpx; + +} + +.right_k{ + width: 30rpx; + height: 100%; + margin-left: 580rpx; +} +.right_k image{ width: 30rpx; height: 30rpx} + + +.top .t_left{ + width: 10rpx; + height: 38rpx; + background: #C4182E; + margin-top:18rpx; +margin-right:12rpx; +margin-left:20rpx; +} + + +.sp{ + min-height: 300rpx; + width: 100%; + background-color: white; + padding:18rpx; +display: flex; +} + +.sp .sp_top{ + height: 220rpx; + min-width: 30%; + + +} + +.sp .sp_top .s_img{ + width: 210rpx; + height: 100%; +} + +.sp .sp_top .s_img image{ + width: 210rpx; + height: 100%; + + position: relative; + top: -74rpx; + left:0rpx; + +} + +.sp .sp_top .s_top_kill + +{ + +background-color:#C4182E; +font-size:24rpx; +height:38rpx; +line-height:38rpx; +left:6rpx; + +padding:4rpx 10rpx; + +border-radius:10rpx; + + +z-index: 999; + position: relative; + top:-6rpx; + width: 210rpx; + + + color: #fff; + text-align: center; + + +} + +.po{ + position: absolute; +} + +.sp .sp_top .s_foot_kill{ + font-size: 20rpx; + position: relative; + top:-90rpx; + width: 210rpx; + height: 38rpx; + line-height: 38rpx; + color: #fff; + text-align: center; + background-color: rgba(0, 0, 0, 0.5); +} + + + +.sp_wz{ +width: 210rpx; + min-height:100rpx; + +} + +.sp_wz .sp_wzi{ + font-size: 30rpx; + border-bottom: 2rpx solid #dcdcdc; + width: 100%; + text-align: left; + padding: 4rpx 0; + overflow: hidden; + height: 48rpx; + text-overflow: ellipsis; + white-space: nowrap; + line-height: 48rpx; +} + +.sp_wz .sp_jg{ + color: #C4182E; + font-size: 30rpx; + overflow: hidden; + display: inline-block; + text-overflow: ellipsis; + white-space: nowrap; + margin-right: 10rpx; +} + +.sp_wz .sp_jgx{ + color: #adadad; + text-decoration: line-through; + font-size: 24rpx; + + overflow: hidden; + display: inline-block; + text-overflow: ellipsis; + white-space: nowrap; + +} + +.one{ + margin-left: 14rpx; + +} + + +.sp .sp_top .s_top1_kill{ + position: absolute; +background-color:#C4182E; +font-size:24rpx; +height:38rpx; +line-height:38rpx; +left:265rpx; +top:100rpx; +padding:0 10rpx; +color:white; +border-radius:10rpx; + +} + +.sp .sp_top .s_top2_kill{ + position: absolute; +background-color:#C4182E; +font-size:24rpx; +height:38rpx; +line-height:38rpx; +right:146rpx; +top:100rpx; +padding:0 10rpx; +color:white; +border-radius:10rpx; + +} + + + +.sp .sp_top .s_foot1_kill{ + font-size: 20rpx; + position: absolute; + top:270rpx; + width: 210rpx; + height: 38rpx; + line-height: 38rpx; + color: #fff; + text-align: center; + background-color: rgba(0, 0, 0, 0.5); +} + +.po1{ + position: absolute; +} + + +.sp .sp_top .s_foot2_kill{ + font-size: 20rpx; + position: absolute; + top:270rpx; + width: 210rpx; + height: 38rpx; + line-height: 38rpx; + color: #fff; + text-align: center; + background-color: rgba(0, 0, 0, 0.5); +} + + + + + + + +.sp2{ + width: 100%; + min-height: 240rpx; + +} + +.sp2 .one1{ + width: 100%; + background-color: white; + height: 252rpx; + display: flex; + padding: 20rpx; + border-bottom:6rpx#eee solid; + +} + +.sp2 .one1 .o1_img{ + width: 200rpx; + height: 240rpx; + + margin-right: 24rpx; +} + +.o1_right .sp_wzi{ + font-size: 36rpx; + margin-bottom:6rpx; + + width: 100%; + text-align: left; + padding: 4rpx 0; + overflow: hidden; + height: 48rpx; + text-overflow: ellipsis; + white-space: nowrap +} + +.o1_right .o1_sj_kill{ + height: 60rpx; + + margin-bottom: 10rpx; +} + +.o1_right .o1_sj_kill text{ + background-color: #fdcb08; + text-align: center; + border-radius: 10rpx; + padding:4rpx; +margin-left:6rpx; + +} + + + +.o1_right .sp_jg{ + color: #C4182E; + font-size: 36rpx; + + overflow: hidden; + display: inline-block; + margin-right: 10rpx; +} + +.o1_right .sp_jgx{ + color: #dcdcdc; + text-decoration: line-through; + font-size: 26rpx; + + overflow: hidden; + display: inline-block; +} + + +.o1_img image{ + width: 100%; + height: 100%; + + position:relative; +top:-23rpx; +left:0rpx; + +} + +.o1_right .wo{ + background-color: #C4182E; + width: 160rpx; + height: 60rpx; + line-height: 60rpx; + color: white; + text-align: center; + font-size: 38rpx; + margin-left:298rpx; +border-radius:14rpx; +padding-left: 10rpx; +padding-right: 10rpx; +} + + + diff --git a/components/diy_shopname/diy_shopname.js b/components/diy_shopname/diy_shopname.js new file mode 100644 index 0000000..5cae66a --- /dev/null +++ b/components/diy_shopname/diy_shopname.js @@ -0,0 +1,71 @@ +var t = getApp(), + o = t.globalData.setting; + +Component({ + properties: { + // 这里定义了innerText属性,属性值可以在组件使用时指定 + object: { + type: Object, + value: null, + }, + }, + data: { + // 这里是一些组件内部数据 + yc:false, + imghost: o.imghost, + stoid:o.stoid, + sto:null, + store_name:'', + someData: {}, + total:0, + new_total:0, + }, + + ready: function() { + var th=this; + this.init(); + //--所有商品-- + getApp().request.promiseGet("/api/weshop/goods/page/", + {data:{ isonsale: 1, store_id: o.stoid,page:1,pageSize:1}}).then(res => { + var total=res.data.data.total; + th.setData({total:total}) + }) + + //--所有新品-- + getApp().request.promiseGet("/api/weshop/goods/page/", + {data:{is_new:1,isonsale: 1, store_id: o.stoid,page:1,pageSize:1}}).then(res => { + var total=res.data.data.total; + th.setData({new_total:total}) + }) + + }, + methods: { + // 这里是一个自定义方法 + init:function(){ + var app=getApp(); + app.request.promiseGet("/api/weshop/store/get/"+o.stoid,{ + data:{} + }).then(res=>{ + var logo=o.imghost+res.data.data.store_logo; + var name=res.data.data.store_name; + this.setData({ + sto:logo,store_name:name + }) + }) + }, + customMethod: function () {}, + go_user:function () { + var url="/pages/user/index/index"; + getApp().goto(url); + }, + go_all_wares:function () { + var url="/pages/goods/goodsList/goodsList"; + getApp().goto(url); + }, + go_new_wares:function () { + var url="/pages/goods/goodsList/goodsList?is_new=1"; + getApp().goto(url); + } + + } +}) \ No newline at end of file diff --git a/components/diy_shopname/diy_shopname.json b/components/diy_shopname/diy_shopname.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/diy_shopname/diy_shopname.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/diy_shopname/diy_shopname.wxml b/components/diy_shopname/diy_shopname.wxml new file mode 100644 index 0000000..d128a56 --- /dev/null +++ b/components/diy_shopname/diy_shopname.wxml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + {{store_name}} + + + + + {{total}} + 全部商品 + + + + {{new_total}} + 上新商品 + + + + + + + 个人中心 + + + + + + + + + + + + + + 派派通001 + + + + + + + {{total}} + 全部商品 + + + + + | + + {{new_total}} + 上新商品 + + + + + | + + + + + 个人中心 + + + + + + + + diff --git a/components/diy_shopname/diy_shopname.wxss b/components/diy_shopname/diy_shopname.wxss new file mode 100644 index 0000000..56e858c --- /dev/null +++ b/components/diy_shopname/diy_shopname.wxss @@ -0,0 +1,234 @@ +/* 最外层的view */ +.big{ + font-family: Arial,"宋体"; + text-align:center; + margin:0 auto; + position: relative; + height: 500rpx; +} + +.s1_gk_a1{ + display: inline; + width: auto; + height: auto; +} + +/* 圆形小图片 */ +.wxd_ww { + width: 126rpx; + height: 126rpx; + /* justify-content: center; */ + margin-top: 20rpx; + margin-left: 6rpx; +} + +/* 小图片圆边框 */ + +.circle { + /* 设置背景色 */ + background: #f8f8f8; + /* 设置圆 */ + border-radius: 50%; + width: 163rpx; + height: 163rpx; + /* 给边框加颜色要设置边框 */ + border: 2rpx solid #f7e9e2; + /* display: flex加justify-content: center是居中对齐 */ + display: flex; + justify-content: center; + /* 超出边框则隐藏 */ + overflow: hidden; +} + +/* 设置小图片外面的view的宽高 */ + +.circle_tow .border { + width: 140rpx; + height: 140rpx; +} + +/* 小图片最大外边框 */ + +.big_border { + width: 192rpx; + height: 214rpx; + position: relative; + top: -82rpx; + left: 10px; +} + +.font { + margin-top: 10rpx; + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap; + font-size: 36rpx; +} + +/* 最大图片的外层view */ + +.big_picture_border { + width: 100%; + height: 320rpx; +} + + +.jj{ + position: relative; + top: 26rpx; + left: -128rpx; +} + +.jj_2{ + position: relative; + top:26rpx; +left:-116rpx; + +} + +.big_picture { + width: 100%; + height: 100%; +} + +/* 全部商品样式 */ + +.all_goods_sum { + width: 174rpx; + height: 94rpx; + margin-left: 230rpx; + text-align: center; + margin-top: 15rpx; + position: relative; + top: -196rpx; +} + +/* 新上商品 */ +.new_goods { + width: 174rpx; + height: 94rpx; + margin-left: 400rpx; + /* 居中 */ + text-align: center; + margin-top: -90rpx; + position: relative; + top: -198rpx; +} + +/* 个人中心 */ + +.personal_center { + width: 174rpx; + height: 94rpx; + margin-left: 570rpx; + /* 居中 */ + text-align: center; + margin-top: -90rpx; + position: relative; + top: -200rpx; +} + +/* 个人中心图像 */ + +.user_pictrue { + width: 36rpx; + height: 32rpx; + margin-right: 0rpx; +} + +/* 图像的第二个 */ +.big_border_two { + width: 100%; + height: 260rpx; + position: relative; + top: -274rpx; + text-align: center; +} + +/* 小图片2圆边框 */ + +.circle_tow { + /* 设置背景色 */ + background: #fff; + /* 设置圆 */ + border-radius: 50%; + width: 172rpx; + height: 172rpx; + /* 给边框加颜色要设置边框 */ + border: 1rpx solid #f7e9e2; + /* display: flex加justify-content: center是居中对齐 */ + display: flex; + justify-content: center; + /* 超出边框则隐藏 */ + overflow: hidden; + position: relative; + margin-left: 50%; + left:-86rpx; +} + +.fonts { + width: 186rpx; + height: 70rpx; + /* 倒角 */ + border-radius: 25rpx; + background-color: rgba(255, 255, 255, 0.7); + border: 1rpx solid rgba(255, 255, 255, 0.7); + font-size: 36rpx; + /* 水平居中 */ + text-align: center; + /* 垂直居中 */ + line-height: 70rpx; + position: relative; + top: 20rpx; + left: 0rpx; + /* background-color: rgba(255, 255, 255, 0.7); */ +} + +/* 底层文字 */ +.base_font { + width: 100%; + height: 120rpx; + position: relative; + top: -250rpx; +} +/* 使里面的view纵向排列 */ +.arrange{ + /* 弹性布局 */ + display: flex; + margin-top: 20rpx; +} +/* 底层文字 */ +.base_font_one { + width: 33%; + height: 120rpx; + /* 水平居中 */ + text-align: center; + display: flex; +} + +.base_font_one .navi{ + width: 100%; +} + +.base_font_one .shuxian{ + margin-top: 15rpx; +} + + +.base_font_one .navi view{ + width: 100%; +} +.base_font_one .navi view .user_pictrue_two{ + width: 32rpx;height: 35rpx; +} +.wai_zwp{ + background-color: white; + height: 500rpx; +} + +.shopname_title_size{ font-size: 34rpx} +.big .all_view{display: flex; width: 500rpx; position:absolute; bottom:90rpx;right: 0 } +.big .all_view .v_item{width:33%; } + +.big_border_two .title_center{ display: flex; justify-content: center;} + diff --git a/components/diy_title/diy_title.js b/components/diy_title/diy_title.js new file mode 100644 index 0000000..c932759 --- /dev/null +++ b/components/diy_title/diy_title.js @@ -0,0 +1,21 @@ +Component({ + properties: { + // 这里定义了innerText属性,属性值可以在组件使用时指定 + object:{ + type: Object, + value:null + }, + + }, + data: { + // 这里是一些组件内部数据 + someData: {} + }, + methods: { + //--智能跳转-- + go_url:function (e) { + var url=e.currentTarget.dataset.url; + getApp().goto(url); + } + } +}) \ No newline at end of file diff --git a/components/diy_title/diy_title.json b/components/diy_title/diy_title.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/diy_title/diy_title.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/diy_title/diy_title.wxml b/components/diy_title/diy_title.wxml new file mode 100644 index 0000000..f746fa6 --- /dev/null +++ b/components/diy_title/diy_title.wxml @@ -0,0 +1,19 @@ + + + + + + + {{object.title_name}} + + + + + + {{object.title_right}} + + > + + + + \ No newline at end of file diff --git a/components/diy_title/diy_title.wxss b/components/diy_title/diy_title.wxss new file mode 100644 index 0000000..bfec612 --- /dev/null +++ b/components/diy_title/diy_title.wxss @@ -0,0 +1,77 @@ +/* 大边框 */ + +.big_rim { + width: 100%; + height: auto; + display: flex; + padding: 10rpx 0; +} + +/* 图片边框 */ + +.rim { + margin-left: 20rpx; + margin-top: 15rpx; +} + +/* 图片 */ +.image_one { + width: 48rpx; + height: 48rpx; +} + +/* 标题的边框 */ +.txet_rim { + margin-left: 10rpx; + margin-top: 20rpx; + min-width: 300rpx; + width: auto; + height: auto; + word-break: break-all; + word-wrap: break-word; + +} + +/* 标题名 */ +.text { + font-weight: bold; + font-family: "SimSun"; +} + +/* 右侧边框 */ + +.right_rim { + min-width: 200rpx; + width: auto; + display: inline-block; +} + +/* 右侧文字边框 */ +.font_right_rim { + display: inline-block; + min-width: 300rpx; + text-align:right; + margin-left: 20rpx; + vertical-align: top; +} + +/* 标题 */ + +.caption { + display: inline-block; + color: #777; + min-width: 300rpx; + width: auto; + height: auto; + margin-top: 20rpx +} + +.aa { + display: inline-block; + color: #777; + width: 50rpx; + font-size: 50rpx; + font-weight: bold; + vertical-align: top; + margin-top: 12rpx +} diff --git a/components/diy_video/diy_video.js b/components/diy_video/diy_video.js new file mode 100644 index 0000000..75e7c98 --- /dev/null +++ b/components/diy_video/diy_video.js @@ -0,0 +1,56 @@ +Component({ + properties: { + object: { + type: Object, + value: null + }, + // 这里定义了innerText属性,属性值可以在组件使用时指定 + + }, + data: { + // 这里是一些组件内部数据 + someData: {}, + videoUrl: "", + }, + + ready: function () { + this.create_url(); + }, + methods: { + // 这里是一个自定义方法 + create_url: function () { + console.log('create_url'); + var that = this; + /*获取文本框中的值*/ + var text = this.properties.object.wxapp_code; + /*console.log("整个的地址"+text);*/ + var arr = new Array(), arrs = new Array(); + arr = text.split('vid='); + /*console.log("截取vid后面的"+arr[1]);*/ + arrs = arr[1].split('"'); + /* console.log("截取&前面的的"+arrs[0]);*/ + var vipid = arrs[0]; + + var url = "https://vv.video.qq.com/getinfo?vid=" + vipid + "&platform=101001&charge=0&otype=json"; + wx.request({ + url: url, + success: function (res) { + var dataJson = res.data.replace(/QZOutputJson=/, '') + "qwe"; + var dataJson1 = dataJson.replace(/;qwe/, ''); + var data = JSON.parse(dataJson1); + if (data.vl != undefined) { + var host = data['vl']['vi'][0]['ul']['ui'][2]['url'] + var fn = data.vl.vi[0].fn; + var fvkey = data.vl.vi[0].fvkey; + /* console.log("有参数吗"+fn+"有参数吗"+fvkey);*/ + var wxapp_url = host + fn + '?vkey=' + fvkey; + that.setData({ + videoUrl: wxapp_url + }); + } + } + }) + + } + } +}) \ No newline at end of file diff --git a/components/diy_video/diy_video.json b/components/diy_video/diy_video.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/diy_video/diy_video.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/diy_video/diy_video.wxml b/components/diy_video/diy_video.wxml new file mode 100644 index 0000000..f021759 --- /dev/null +++ b/components/diy_video/diy_video.wxml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/components/diy_video/diy_video.wxss b/components/diy_video/diy_video.wxss new file mode 100644 index 0000000..1be996c --- /dev/null +++ b/components/diy_video/diy_video.wxss @@ -0,0 +1,10 @@ +.vd_view{ + width: 100%; + max-height: 750rpx; + overflow: hidden; +} +.vd_web{ + width: 100%; + max-height:750rpx; + overflow: hidden; +} \ No newline at end of file diff --git a/components/diy_video/video.json b/components/diy_video/video.json new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/components/diy_video/video.json diff --git a/components/diy_voice/diy_voice.js b/components/diy_voice/diy_voice.js new file mode 100644 index 0000000..da8f733 --- /dev/null +++ b/components/diy_voice/diy_voice.js @@ -0,0 +1,205 @@ +const app = getApp() +const innerAudioContext = wx.createInnerAudioContext(); +var t = getApp(), + o = t.globalData.setting; +Component({ + properties: { + + object: { + type: Object, + value: null, + }, + audiosrc:{ + type: String, + value: null, + }, + + + + }, + data: { + yc:false, + isPlayAudio: false, + audioSeek: 0, + audioDuration: 0, + showTime1: '00:00', + showTime2: '00:00', + audioTime: 0, + voice_logo:null, + imghost: o.imghost, + }, + + ready: function() { + console.log("ready"); + var music = this.data.object.music; + var vo = this.data.object; + this.setData({ + audiosrc:music, + // logo:"http://jmh.xinda100.cn"+logo + }) + this.Initialization(); + this.loadaudio(); + console.log("logo"); + console.log(vo); + this.logo(vo); + + }, + + methods: { + + logo(vo){ + console.log(111111); + console.log(vo.logo); + var v_logo=vo.logo; + if (!(vo.logo.indexOf("/public/static/images/model/logo.png"))){ + this.setData({ + voice_logo:"https://mshopimg.yolipai.net/miniapp/images/logo.png" + }) + }else{ + this.setData({ + voice_logo:v_logo + }) + } + }, + + // 这里是一个自定义方法 + //初始化播放器,获取duration + Initialization() { + var t = this; + if (this.properties.audiosrc.length != 0) { + //设置src + innerAudioContext.src = this.properties.audiosrc; + //运行一次 + innerAudioContext.play(); + innerAudioContext.pause(); + innerAudioContext.onCanplay(() => { + //初始化duration + innerAudioContext.duration + setTimeout(function () { + //延时获取音频真正的duration + var duration = innerAudioContext.duration; + var min = parseInt(duration / 60); + var sec = parseInt(duration % 60); + if (min.toString().length == 1) { + min = `0${min}`; + } + if (sec.toString().length == 1) { + sec = `0${sec}`; + } + t.setData({ + audioDuration: innerAudioContext.duration, + showTime2: `${min}:${sec}` + }); + }, 1000) + }) + } + }, + //拖动进度条事件 + sliderChange(e) { + var that = this; + innerAudioContext.src = this.properties.audiosrc; + //获取进度条百分比 + var value = e.detail.value; + this.setData({ + audioTime: value + }); + var duration = this.properties.audioDuration; + //根据进度条百分比及歌曲总时间,计算拖动位置的时间 + value = parseInt(value * duration / 100); + //更改状态 + this.setData({ + audioSeek: value, + isPlayAudio: true + }); + //调用seek方法跳转歌曲时间 + innerAudioContext.seek(value); + //播放歌曲 + innerAudioContext.play(); + }, + //播放、暂停按钮 + playAudio() { + //获取播放状态和当前播放时间 + var isPlayAudio = this.data.isPlayAudio; + var seek = this.properties.audioSeek; + innerAudioContext.pause(); + //更改播放状态 + this.setData({ + isPlayAudio: !isPlayAudio + }) + if (isPlayAudio) { + //如果在播放则记录播放的时间seek,暂停 + this.setData({ + audioSeek: innerAudioContext.currentTime + }); + } else { + //如果在暂停,获取播放时间并继续播放 + innerAudioContext.src = this.properties.audiosrc; + if (innerAudioContext.duration != 0) { + this.setData({ + audioDuration: innerAudioContext.duration + }); + } + //跳转到指定时间播放 + innerAudioContext.seek(seek); + innerAudioContext.play(); + } + }, + loadaudio() { + var that = this; + //设置一个计步器 + this.properties.durationIntval = setInterval(function () { + //当歌曲在播放时执行 + if (that.data.isPlayAudio == true) { + //获取歌曲的播放时间,进度百分比 + var seek = that.properties.audioSeek; + var duration = innerAudioContext.duration; + var time = that.properties.audioTime; + time = parseInt(100 * seek / duration); + //当歌曲在播放时,每隔一秒歌曲播放时间+1,并计算分钟数与秒数 + var min = parseInt((seek + 1) / 60); + var sec = parseInt((seek + 1) % 60); + //填充字符串,使3:1这种呈现出 03:01 的样式 + if (min.toString().length == 1) { + min = `0${min}`; + } + if (sec.toString().length == 1) { + sec = `0${sec}`; + } + var min1 = parseInt(duration / 60); + var sec1 = parseInt(duration % 60); + if (min1.toString().length == 1) { + min1 = `0${min1}`; + } + if (sec1.toString().length == 1) { + sec1 = `0${sec1}`; + } + //当进度条完成,停止播放,并重设播放时间和进度条 + if (time >= 100) { + innerAudioContext.stop(); + that.setData({ + audioSeek: 0, + audioTime: 0, + audioDuration: duration, + isPlayAudio: false, + showTime1: `00:00` + }); + return false; + } + //正常播放,更改进度信息,更改播放时间信息 + that.setData({ + audioSeek: seek + 1, + audioTime: time, + audioDuration: duration, + showTime1: `${min}:${sec}`, + showTime2: `${min1}:${sec1}` + }); + } + }, 1000); + }, + onUnload: function () { + //卸载页面,清除计步器 + clearInterval(this.properties.durationIntval); + }, + customMethod: function () { } + } +}) \ No newline at end of file diff --git a/components/diy_voice/diy_voice.json b/components/diy_voice/diy_voice.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/diy_voice/diy_voice.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/diy_voice/diy_voice.wxml b/components/diy_voice/diy_voice.wxml new file mode 100644 index 0000000..6d89dec --- /dev/null +++ b/components/diy_voice/diy_voice.wxml @@ -0,0 +1,62 @@ + + + + + + + + + + 111 + + + + 111 + + + + + + + + + {{showTime1}}/{{showTime2}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/components/diy_voice/diy_voice.wxss b/components/diy_voice/diy_voice.wxss new file mode 100644 index 0000000..9d744fd --- /dev/null +++ b/components/diy_voice/diy_voice.wxss @@ -0,0 +1,246 @@ +.flex { + display: flex; +} + +.audioPlayer { + width: 100%; + height: 400rpx; + margin-bottom: 30rpx; + box-sizing: border-box; + padding: 20rpx 30rpx; +} + +.player { + width: 100%; + height: 100%; + position: relative; +} + +.audioBack { + width: 100%; + height: 100%; +} + +.audioControls { + width: 100%; + height: 80rpx; + background: black; + opacity: 0.8; + position: absolute; + bottom: 0; + color: white; + font-size: 6pt; + line-height: 80rpx; + text-align: center; +} + +.audioControls .bottom { + width: 60rpx; + height: 100%; +} + +.audioControls .bottom image { + margin-top: 30%; + margin-left: 30%; + width: 40rpx; + height: 40rpx; +} + +.audioControls .slider { + width: 520rpx; + height: 100%; +} + +.slider slider { + width: 95%; + margin-left: 4%; + margin-right: 0; +} + +.audioControls .time { + width: 120rpx; + height: 100%; +} + +/* 音频end */ + +.mod_voice { + /* width: 100%; */ + /* min-height: 100rpx; */ + background-color: white; + margin:10px 10rpx; +} + +.mod_p { + width: 100%; + height: 70rpx; + display: flex; + line-height: 50rpx; +} + +.mod_p image { + width: 30rpx; + height: 30rpx; + margin-left: 10rpx; + margin-right: 10rpx; +} + +.mod_g image { + width: 92rpx; + height: 40rpx; +} + +.mod_g { + border: 2rpx #ddd solid; + height: 96rpx; + border-bottom: 0rpx; + border-right: 0rpx; + border-left: 0rpx; + display: flex; + flex-flow: row; +} + +.mod_border { + border: 2rpx #ddd solid; +} + +.ad_audio1 { + background-size: cover; + width: 100%; + height: 80rpx; +} + +.time { + width: 20%; + height: 96rpx; + + line-height:80rpx; +color:#999; +font-size:36rpx; +margin-left:16rpx; + +} + +.slider { + width: 68%; +} + +/* --------------------语音 */ + +.btn { + margin-top: 15rpx; +} + +.audio { + margin-left: 65rpx; +} + +.o1 { + background-color: red; + width: 100%; + padding: 20rpx; +} + +.ad { + display: flex; + width: 100%; + /* background-color: white; */ + text-align: left; + margin-top: 10rpx; + padding: 0 10rpx; +margin-bottom:20rpx; + +} + +.ad_tp { + width: 80rpx; + height: 80rpx; + /* box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3); */ +} + +.ad_tp image { + width: 100%; + height: 100%; + position:relative; + left:0rpx; +} + +.ad_audio { + background-size: cover; + width: 100%; + height: 80rpx; +} + +.tt { + width: 356rpx; + height: 81rpx; + background: url(https://mshopimg.yolipai.net/miniapp/images/voice_left.png) no-repeat; + background-size: cover; + margin-left: 10rpx; +} + +.tt image { + width: 36rpx; + height: 45rpx; + margin-left: 28rpx; + margin-top: 19rpx; +} + +.ad_tp { + /* background-color: white; */ +} + +.ad2 { + + width: 100%; + /* background-color: white; */ + text-align: right; + margin-top: -10rpx; + margin-bottom: 30rpx; +} + +.ad_tp2 { + width: 80rpx; + height: 80rpx; + /* box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3); */ + float: right; + margin-right: 20rpx; +} + +.ad_tp2 image { + width: 100%; + height: 100%; + display: inline-block; + position:relative; +top:2rpx; +left:0rpx; + +} + +.ad_audio2 { + display: inline-block; + background-size: cover; + height: 80rpx; +} + +.tt2 { + width: 356rpx; + height: 80rpx; + background: url(https://mshopimg.yolipai.net/miniapp/images/voice_right.png) no-repeat; + background-size: cover; + margin-right: 10rpx; + display: inline-block; +} + +.tt2 image { + width: 36rpx; + height: 45rpx; + margin-left: 28rpx; + margin-top: 19rpx; + /* display: inline-block; */ +} + +.ad_tp2 { + /* background-color: white; */ + display: inline-block; +} diff --git a/components/long_warn/long_warn.js b/components/long_warn/long_warn.js new file mode 100644 index 0000000..00bb68f --- /dev/null +++ b/components/long_warn/long_warn.js @@ -0,0 +1,23 @@ +var t = getApp(); +Component({ + /** + * 页面的初始数据 + */ + data: { + val:"212121", + is_show:0, + type:0, //0 提示,失败 1成功 + iurl:t.globalData.setting.imghost, + }, + + methods: { + open:function (e,type) { + var that=this; + this.setData({is_show:1,val:e,type:type}); + setTimeout(function () { + that.setData({is_show:0}); + },2000); + } + } + +}) \ No newline at end of file diff --git a/components/long_warn/long_warn.json b/components/long_warn/long_warn.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/long_warn/long_warn.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/long_warn/long_warn.wxml b/components/long_warn/long_warn.wxml new file mode 100644 index 0000000..ebd4096 --- /dev/null +++ b/components/long_warn/long_warn.wxml @@ -0,0 +1,11 @@ + + + + + + + + {{val}} + + + diff --git a/components/long_warn/long_warn.wxss b/components/long_warn/long_warn.wxss new file mode 100644 index 0000000..d1546f4 --- /dev/null +++ b/components/long_warn/long_warn.wxss @@ -0,0 +1,28 @@ +.cover-layer { + position: fixed; + left: 0; + top: 0; + right: 0; + bottom: 0; + z-index: 11; + background: rgba(0,0,0,0.4); + width: 100%; + height: 100%; +} +/* 水平垂直 */ +.flex-center{ + display:flex; + justify-content:center; + align-items:center; +} +.content{ + position: fixed; width: 100%; height: 100%;top: 0; left: 0;z-index: 99999999999999999; +} +.con_view{ + min-width:180rpx; max-width: 720rpx; width: auto; padding: 40rpx 30rpx; background-color: #000; border-radius:22rpx; text-align: center; +} +.con_view .con_view_img{ height: 120rpx;} +.con_view image{ width: 84rpx; height: 84rpx;} +.msg{ + color:#fff; font-size: 32rpx +} diff --git a/components/nav_box/nav_box.js b/components/nav_box/nav_box.js new file mode 100644 index 0000000..5fcacf6 --- /dev/null +++ b/components/nav_box/nav_box.js @@ -0,0 +1,29 @@ +var t = getApp(),os =t.globalData.setting; +Component({ + properties: { + }, + data: { + isopen:0, + iurl:os.imghost, + }, + + ready: function() { + }, + methods: { + //--点击打开事件-- + open_box:function () { + this.setData({isopen:1}); + }, + //--关闭事件-- + close_box:function(){ + this.setData({isopen:0}); + }, + //--跳转-- + goto:function (e) { + var url=e.currentTarget.dataset.url; + getApp().goto(url); + } + + } + +}) \ No newline at end of file diff --git a/components/nav_box/nav_box.json b/components/nav_box/nav_box.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/nav_box/nav_box.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/nav_box/nav_box.wxml b/components/nav_box/nav_box.wxml new file mode 100644 index 0000000..52b10ca --- /dev/null +++ b/components/nav_box/nav_box.wxml @@ -0,0 +1,13 @@ + + + + + + + 首页 + 分类 + 我的 + × + + + diff --git a/components/nav_box/nav_box.wxss b/components/nav_box/nav_box.wxss new file mode 100644 index 0000000..3885ad2 --- /dev/null +++ b/components/nav_box/nav_box.wxss @@ -0,0 +1,59 @@ +.box_main{ + width:100rpx; + height:100rpx; + background:#272636; + transition:width 0.8s; + -moz-transition:width 0.8s; /* Firefox 4 */ + -webkit-transition:width 0.8s; /* Safari and Chrome */ + -o-transition:width 0.8s; /* Opera */ + border-radius:50rpx ; + position: fixed; + right: 10rpx; + bottom:300rpx; + overflow: hidden; +} + +.box_isopen{ + width: 420rpx; +} + +.box_main .dian{ + text-align: center; + width:100rpx; + height:100rpx; + color: #ffff; + font-size: 70rpx; + background: none; +} + +.box_main .dian image{ + width:75rpx; height:30rpx;margin-top:36rpx; +} + +.box_main.box_isopen .dian{ + display: none; +} + +.box_main .cl_list{ + display: none; +} + +.box_main.box_isopen .cl_list{ + display: block; + margin-left: 20rpx; +} + +.box_main .cl_list .item{ + display: inline-block; + width:100rpx; + height:100rpx; + text-align: center; + line-height: 100rpx; + color: #fff; + vertical-align: top; +} + +.box_main .cl_list .item.big{ + font-size: 70rpx;line-height: 90rpx; +} + diff --git a/components/qr_code/qr_code.js b/components/qr_code/qr_code.js new file mode 100644 index 0000000..fbdf7c9 --- /dev/null +++ b/components/qr_code/qr_code.js @@ -0,0 +1,43 @@ +// pages/user/yhq/qr_code/qr_code.js +const { + barcode, + qrcode +} = require('../../utils/index.js') + +Component({ + data: { + q_show:0, + object:null, + index:0, + is_fw:0, + + barcode_canvas:null, + qrcode_canvas:null, + }, + properties: { + // 这里定义了innerText属性,属性值可以在组件使用时指定 + }, + ready: function () { + }, + + methods: { + //关闭 + close: function (e) { + this.setData({q_show: 0,barcode_canvas:null,qrcode_canvas:null }); + }, + + //打开 + open:function (e) { + this.data.index++; + var list=[{index:this.data.index }]; + + this.setData({q_show: 1,object:e,barcode_canvas:list,qrcode_canvas:list,is_fw:e.is_fw }); + var val=e.val; + + barcode('barcode'+this.data.index,val, 620, 160,this); + qrcode('qrcode'+this.data.index, val, 520, 520,this); + } + } + + +}) \ No newline at end of file diff --git a/components/qr_code/qr_code.json b/components/qr_code/qr_code.json new file mode 100644 index 0000000..a74b8d1 --- /dev/null +++ b/components/qr_code/qr_code.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/qr_code/qr_code.wxml b/components/qr_code/qr_code.wxml new file mode 100644 index 0000000..7db5902 --- /dev/null +++ b/components/qr_code/qr_code.wxml @@ -0,0 +1,24 @@ + + + + + + + + {{object.val}} + + + + {{object.content}} + 有效时间:{{object.now}} 至 {{object.validay}} + + 使用说明: 仅{{object.name}}使用 + 使用说明: 全场通用 + + + + + + + + \ No newline at end of file diff --git a/components/qr_code/qr_code.wxss b/components/qr_code/qr_code.wxss new file mode 100644 index 0000000..8ff3862 --- /dev/null +++ b/components/qr_code/qr_code.wxss @@ -0,0 +1,113 @@ +.xc-pop-up{ + width: 100%; + height: 100%; + position:fixed; + z-index:5; + display:flex; +justify-content:center; +align-items:center; +} + +.xc-obscuration{ + position: fixed; + left: 0; + top: 0; + right: 0; + bottom: 0; + z-index: 11; + background: rgba(0,0,0,0.4); + width: 100%; + height: 100%; + + + +} + +.xc-qr-frame{ + width:90%; + min-height: 696rpx; + background: #fff; + z-index: 55; + position: fixed; + top:180rpx; + height: auto; + padding-bottom:20rpx; + left:35rpx; + +} + +/* 二维码和条形码的边框 */ +.barqrcode{ + width: 100%; + height: auto; + margin-top:30rpx; + +} +/* 点击条形 */ +.barcode { + height:150rpx; + width: 620rpx; + padding-left:30rpx; + text-align:center; +} +canvas{ + width:100%; +height:55px; +display:block; +position:relative; +} +.q_code{ + font-size:28rpx; +letter-spacing:6rpx; + +} + + +/* 二维码边框*/ +.qrcode_rim { + width: 550rpx; + height:580rpx; +display:flex; +flex-direction:column; +margin-left:74rpx; + + +} +.qrcode{ + width:520rpx; + height:520rpx; + margin-top:-20rpx + + +} +.r-code{ + font-size:28rpx; + text-align: center +} + +.shut{ + display: block; + width: 54rpx; + height: 54rpx; + border: 2rpx solid #fff; + font-size: 50rpx; + z-index:55; + line-height:47rpx; + margin-top: 45rpx; + border-radius: 50%; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + color: #fff; + text-align: center; + position: fixed; + top:940rpx; + left:345rpx; + + +} + +.mt{ margin-top: 70rpx} +.flex{ + display: flex; + justify-content:center; +} \ No newline at end of file diff --git a/components/timePicker/timePicker.js b/components/timePicker/timePicker.js new file mode 100644 index 0000000..0096d7d --- /dev/null +++ b/components/timePicker/timePicker.js @@ -0,0 +1,564 @@ + +Component({ + /** + * 组件的属性列表 + */ + properties: { + pickerShow: { + type: Boolean, + observer:function(val){ //弹出动画 + // console.log(this.data); + if(val){ + let animation = wx.createAnimation({ + duration: 500, + timingFunction: "ease" + }); + let animationOpacity = wx.createAnimation({ + duration: 500, + timingFunction: "ease" + }); + setTimeout(() => { + animation.bottom(0).step(); + animationOpacity.opacity(0.7).step(); + this.setData({ + animationOpacity: animationOpacity.export(), + animationData: animation.export() + }) + }, 0); + }else{ + let animation = wx.createAnimation({ + duration: 100, + timingFunction: "ease" + }); + let animationOpacity = wx.createAnimation({ + duration: 500, + timingFunction: "ease" + }); + animation.bottom(-320).step(); + animationOpacity.opacity(0).step(); + this.setData({ + animationOpacity: animationOpacity.export(), + animationData: animation.export() + }); + } + + // 在picker滚动未停止前点确定,会使startValue数组各项归零,发生错误,这里判断并重新初始化 + // 微信新增了picker滚动的回调函数,已进行兼容 + if(this.data.startValue&&this.data.endValue){ + let s = 0, e = 0; + let conf = this.data.config; + + this.data.startValue.map(val => { + if (val == 0) { + s++ + } + }) + this.data.endValue.map(val => { + if (val == 0) { + e++; + } + }); + let tmp={ + hour:4, + minute:5, + second:6 + } + let n = tmp[conf.column]; + if (s>=n || e>=n) { + this.initPick(this.data.config); + this.setData({ + startValue: this.data.startValue, + endValue: this.data.endValue, + }); + } + } + + + } + }, + config: Object + }, + + /** + * 组件的初始数据 + */ + data: { + // pickerShow:true + // limitStartTime: new Date().getTime()-1000*60*60*24*30, + // limitEndTime: new Date().getTime(), + // yearStart:2000, + // yearEnd:2100 + }, + detached: function() { + console.log("dele"); + }, + attached: function() {}, + ready: function() { + this.readConfig(); + this.initPick(this.data.config || null); + this.setData({ + startValue: this.data.startValue, + endValue: this.data.endValue, + }); + + + + + }, + /** + * 组件的方法列表 + */ + methods: { + //读取配置项 + readConfig() { + let limitEndTime = new Date().getTime(); + let limitStartTime = new Date().getTime() - 1000 * 60 * 60 * 24 * 30; + if (this.data.config) { + let conf = this.data.config; + + if (typeof conf.dateLimit == "number") { + limitStartTime = + new Date().getTime() - 1000 * 60 * 60 * 24 * conf.dateLimit; + } + if(conf.limitStartTime){ + + limitStartTime = new Date(conf.limitStartTime.replace(/-/g,'/')).getTime(); + } + + if (conf.limitEndTime) { + limitEndTime = new Date(conf.limitEndTime.replace(/-/g, '/')).getTime(); + } + + this.setData({ + yearStart: conf.yearStart || 2000, + yearEnd: conf.yearEnd || 2100, + endDate: conf.endDate || false, + dateLimit: conf.dateLimit || false, + hourColumn: + conf.column == "hour" || + conf.column == "minute" || + conf.column == "second", + minColumn: conf.column == "minute" || conf.column == "second", + secColumn: conf.column == "second" + }); + } + + let limitStartTimeArr = formatTime(limitStartTime); + let limitEndTimeArr = formatTime(limitEndTime); + + this.setData({ + limitStartTime, + limitStartTimeArr, + limitEndTime, + limitEndTimeArr + }); + }, + //滚动开始 + handlePickStart:function(e){ + this.setData({ + isPicking:true + }) + }, + //滚动结束 + handlePickEnd:function(e){ + this.setData({ + isPicking:false + }) + }, + onConfirm: function() { + + //滚动未结束时不能确认 + if(this.data.isPicking){return} + let startTime = new Date(this.data.startPickTime.replace(/-/g, "/")); + let endTime = new Date(this.data.endPickTime.replace(/-/g, "/")); + if (startTime <= endTime || !this.data.endDate) { + this.setData({ + startTime, + endTime + }); + let startArr = formatTime(startTime).arr; + let endArr = formatTime(endTime).arr; + let format0 = function(num){ + return num<10?'0'+num:num + } + + let startTimeBack = + startArr[0] + + "-" + + format0(startArr[1]) + + "-" + + format0(startArr[2]) + + " " + + (this.data.hourColumn ? format0(startArr[3]) : "00") + + ":" + + (this.data.minColumn ? format0(startArr[4]) : "00") + + ":" + + (this.data.secColumn ? format0(startArr[5]) : "00"); + + let endTimeBack = + endArr[0] + + "-" + + format0(endArr[1]) + + "-" + + format0(endArr[2]) + + " " + + (this.data.hourColumn ? format0(endArr[3]) : "00") + + ":" + + (this.data.minColumn ? format0(endArr[4]) : "00") + + ":" + + (this.data.secColumn ? format0(endArr[5]) : "00"); + + let time = { + startTime: startTimeBack, + endTime: endTimeBack + }; + + //触发自定义事件 + this.triggerEvent("setPickerTime", time); + this.triggerEvent("hidePicker", {}); + } else { + wx.showToast({ + icon: "none", + title: "时间不合理" + }); + } + }, + hideModal: function() { + + + this.triggerEvent("hidePicker", {}); + }, + changeStartDateTime: function(e) { + let val = e.detail.value; + + this.compareTime(val, "start"); + }, + + changeEndDateTime: function(e) { + let val = e.detail.value; + this.compareTime(val, "end"); + }, + //比较时间是否在范围内 + compareTime(val, type) { + let h = val[3] ? this.data.HourList[val[3]] : "00"; + let m = val[4] ? this.data.MinuteList[val[4]] : "00"; + let s = val[5] ? this.data.SecondList[val[5]] : "00"; + let time = + this.data.YearList[val[0]] + + "-" + + this.data.MonthList[val[1]] + + "-" + + this.data.DayList[val[2]] + + " " + + h + + ":" + + m + + ":" + + s; + + let start = this.data.limitStartTime; + let end = this.data.limitEndTime; + let timeNum = new Date(time.replace(/-/g, '/')).getTime(); + let year, month, day, hour, min, sec, limitDate; + let tempArr = [] + + if (!this.data.dateLimit){ + limitDate = [ + this.data.YearList[val[0]], + this.data.MonthList[val[1]], + this.data.DayList[val[2]], + this.data.HourList[val[3]], + this.data.MinuteList[val[4]], + this.data.SecondList[val[5]]] + } else if (type == "start" && timeNum > new Date(this.data.endPickTime.replace(/-/g, '/')) && this.data.config.endDate) { + limitDate = formatTime(this.data.endPickTime).arr; + + } else if (type == "end" && timeNum < new Date(this.data.startPickTime.replace(/-/g, '/'))) { + limitDate = formatTime(this.data.startPickTime).arr; + + } else if (timeNum < start) { + limitDate = this.data.limitStartTimeArr.arr; + + } else if (timeNum > end) { + limitDate = this.data.limitEndTimeArr.arr; + + } else { + limitDate = [ + this.data.YearList[val[0]], + this.data.MonthList[val[1]], + this.data.DayList[val[2]], + this.data.HourList[val[3]], + this.data.MinuteList[val[4]], + this.data.SecondList[val[5]] + ] + + } + + year = limitDate[0]; + month = limitDate[1]; + day = limitDate[2]; + hour = limitDate[3]; + min = limitDate[4]; + sec = limitDate[5]; + + if (type == "start") { + this.setStartDate(year, month, day, hour, min, sec); + } else if (type == "end") { + this.setEndDate(year, month, day, hour, min, sec); + } + }, + getDays: function(year, month) { + let daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + if (month === 2) { + return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0 + ? 29 + : 28; + } else { + return daysInMonth[month - 1]; + } + }, + initPick: function(initData) { + const date = initData.initStartTime ? new Date(initData.initStartTime.replace(/-/g, '/')): new Date(); + const endDate = initData.initEndTime ? new Date(initData.initEndTime.replace(/-/g, '/')) : new Date(); + // const startDate = new Date(date.getTime() - 1000 * 60 * 60 * 24); + const startDate = date; + const startYear = date.getFullYear(); + const startMonth = date.getMonth() + 1; + const startDay = date.getDate(); + const startHour = date.getHours(); + const startMinute = date.getMinutes(); + const startSecond = date.getSeconds(); + + const endYear = endDate.getFullYear(); + const endMonth = endDate.getMonth() + 1; + const endDay = endDate.getDate(); + const endHour = endDate.getHours(); + const endMinute = endDate.getMinutes(); + const endSecond = endDate.getSeconds(); + + let YearList = []; + let MonthList = []; + let DayList = []; + let HourList = []; + let MinuteList = []; + let SecondList = []; + + //设置年份列表 + for (let i = this.data.yearStart; i <= this.data.yearEnd; i++) { + YearList.push(i); + } + + // 设置月份列表 + for (let i = 1; i <= 12; i++) { + MonthList.push(i); + } + // 设置日期列表 + for (let i = 1; i <= 31; i++) { + DayList.push(i); + } + // 设置时列表 + for (let i = 0; i <= 23; i++) { + if (0 <= i && i < 10) { + i = "0" + i; + } + HourList.push(i); + } + // 分|秒 + for (let i = 0; i <= 59; i++) { + if (0 <= i && i < 10) { + i = "0" + i; + } + MinuteList.push(i); + SecondList.push(i); + } + + this.setData({ + YearList, + MonthList, + DayList, + HourList, + MinuteList, + SecondList + }); + + this.setStartDate(startYear, startMonth, startDay, startHour, startMinute, startSecond); + this.setEndDate(endYear, endMonth, endDay, endHour, endMinute, endSecond); + + //!!! + // setTimeout(() => { + // this.setStartDate(nowYear, nowMonth, nowDay, nowHour, nowMinute) + // this.setEndDate(nowYear, nowMonth, nowDay, nowHour, nowMinute) + // }, 0); + }, + setPickerDateArr(type, year, month, day, hour, minute, second) { + let yearIdx = 0; + let monthIdx = 0; + let dayIdx = 0; + let hourIdx = 0; + let minuteIdx = 0; + let secondIdx = 0; + + this.data.YearList.map((v, idx) => { + if (parseInt(v) === year) { + yearIdx = idx; + } + }); + + this.data.MonthList.map((v, idx) => { + if (parseInt(v) === month) { + monthIdx = idx; + } + }); + + // 重新设置日期列表 + let DayList = []; + for (let i = 1; i <= this.getDays(year, month); i++) { + DayList.push(i); + } + + DayList.map((v, idx) => { + if (parseInt(v) === day) { + dayIdx = idx; + } + }); + if (type == "start") { + this.setData({ startDayList: DayList }); + } else if (type == "end") { + this.setData({ endDayList: DayList }); + } + + this.data.HourList.map((v, idx) => { + if (parseInt(v) === parseInt(hour)) { + hourIdx = idx; + } + }); + + this.data.MinuteList.map((v, idx) => { + if (parseInt(v) === parseInt(minute)) { + minuteIdx = idx; + } + }); + this.data.SecondList.map((v, idx) => { + if (parseInt(v) === parseInt(second)) { + secondIdx = idx; + } + }); + + return { + yearIdx, + monthIdx, + dayIdx, + hourIdx, + minuteIdx, + secondIdx + }; + }, + setStartDate: function(year, month, day, hour, minute, second) { + let pickerDateArr = this.setPickerDateArr( + "start", + year, + month, + day, + hour, + minute, + second + ); + this.setData({ + startYearList: this.data.YearList, + startMonthList: this.data.MonthList, + // startDayList: this.data.DayList, + startHourList: this.data.HourList, + startMinuteList: this.data.MinuteList, + startSecondList: this.data.SecondList, + startValue: [ + pickerDateArr.yearIdx, + pickerDateArr.monthIdx, + pickerDateArr.dayIdx, + pickerDateArr.hourIdx, + pickerDateArr.minuteIdx, + pickerDateArr.secondIdx + ], + startPickTime: + this.data.YearList[pickerDateArr.yearIdx] + + "-" + + this.data.MonthList[pickerDateArr.monthIdx] + + "-" + + this.data.DayList[pickerDateArr.dayIdx] + + " " + + this.data.HourList[pickerDateArr.hourIdx] + + ":" + + this.data.MinuteList[pickerDateArr.minuteIdx] + + ":" + + this.data.SecondList[pickerDateArr.secondIdx] + }); + }, + setEndDate: function(year, month, day, hour, minute, second) { + let pickerDateArr = this.setPickerDateArr( + "end", + year, + month, + day, + hour, + minute, + second + ); + + this.setData({ + endYearList: this.data.YearList, + endMonthList: this.data.MonthList, + // endDayList: this.data.DayList, + endHourList: this.data.HourList, + endMinuteList: this.data.MinuteList, + endSecondList: this.data.SecondList, + endValue: [ + pickerDateArr.yearIdx, + pickerDateArr.monthIdx, + pickerDateArr.dayIdx, + pickerDateArr.hourIdx, + pickerDateArr.minuteIdx, + pickerDateArr.secondIdx + ], + endPickTime: + this.data.YearList[pickerDateArr.yearIdx] + + "-" + + this.data.MonthList[pickerDateArr.monthIdx] + + "-" + + this.data.DayList[pickerDateArr.dayIdx] + + " " + + this.data.HourList[pickerDateArr.hourIdx] + + ":" + + this.data.MinuteList[pickerDateArr.minuteIdx] + + ":" + + this.data.SecondList[pickerDateArr.secondIdx] + }); + }, + } +}); + + +function formatTime(date) { + + if (typeof date == 'string' || 'number') { + try { + date = date.replace(/-/g, '/')//兼容ios + } catch (error) { + } + date = new Date(date) + } + + const year = date.getFullYear() + const month = date.getMonth() + 1 + const day = date.getDate() + const hour = date.getHours() + const minute = date.getMinutes() + const second = date.getSeconds() + + return { + str: [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':'), + arr: [year, month, day, hour, minute, second] + } +} +function formatNumber(n) { + n = n.toString() + return n[1] ? n : '0' + n +} diff --git a/components/timePicker/timePicker.json b/components/timePicker/timePicker.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/timePicker/timePicker.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/timePicker/timePicker.wxml b/components/timePicker/timePicker.wxml new file mode 100644 index 0000000..9f9c944 --- /dev/null +++ b/components/timePicker/timePicker.wxml @@ -0,0 +1,73 @@ + + + + + + + + + + {{dates}} + + + + + + + 注: 读取时段内近10笔记录 + + + + 没有数据 + + + + + + + + 提现 + + 状态:{{detail.status=="0"?"申请中":(detail.status=="1"?"申请成功":"申请失败")}} + + + + {{dateUtil.dateFormat(detail.create_time)}} + + {{detail.status=="1"?'-':'-'}}{{filter.getNum(detail.money)}} + + + + + + + + + + + + + + 流水号{{ordersn}} + 类型提现 + 支出{{money}} + 时间{{time}} + 银行{{bankname}} + 银行卡号{{accountbank}} + 账户名称{{accountname}} + 状态 + {{status=="0"?"申请中":(status=="1"?"申请成功":"申请失败")}} + + + + \ No newline at end of file diff --git a/pages/user/member/cash_record/cash_record.wxss b/pages/user/member/cash_record/cash_record.wxss new file mode 100644 index 0000000..51fcf34 --- /dev/null +++ b/pages/user/member/cash_record/cash_record.wxss @@ -0,0 +1,285 @@ +/* 大边框 */ +.big-rim{ + margin-top: 15rpx; + width: 100%; + height: 270rpx; + border-bottom: 10px solid #EEEEEE; +} +.min-rim{ +display: flex; +width: 100%; +height: auto; +} +/* 开始时间 */ +.kssj{ +border-radius: 5px; +background-color: #EEEEEE; +border: 1px solid #DADADA; +width:220rpx; +height: 50rpx; +margin-top:5rpx; +margin-left:10rpx; +line-height:40rpx; + +} +.kstext{ +padding-bottom: 10rpx; +padding-left: 10rpx; +font-size: 25rpx; +color: #333; +font-family: 'SimHei',Arial; +} +/* 日期 */ +.rq{ + margin-top:15rpx; + font-size:30rpx; + font-family: 'SimHei',Arial; + margin-left:30rpx; +} +/* 开始时间 边框 */ +.kspicker{ + position: relative; + top:0rpx; + left: 0rpx; +} +/* 开始 */ +.ksqc{ + width: 25rpx; + height: 25rpx; + border-radius:50%; + background: #767676; + color: #fff; + font-size: 25rpx; + text-align: center; + line-height:19rpx; + +} +/* 至 */ +.zi{ + margin-top:15rpx; + font-size:30rpx; + font-family: 'SimHei',Arial; + margin-left:20rpx; +} +/* 结束时间边框 */ +.jspicker{ +position: relative; + top:0rpx; + left: 0rpx; + margin-left:20rpx; + +} +/* 结束时间 */ +.jssj{ +border-radius:5px; +background-color:#EEEEEE; +border:1px solid #DADADA; +width:220rpx; +height:50rpx; +margin-top:5rpx; +line-height:40rpx; + +} +.jstext{ + padding-bottom: 10rpx; +padding-left: 10rpx; +font-size: 25rpx; +color: #333; +font-family: 'SimHei',Arial; +} +.jspc{ + position:absolute; + top:7rpx; + left:192rpx; +} +/* 明细查询 */ +.botton{ + margin-left: 30rpx; + margin-top: 50rpx; + background-color: #C4182E; + width: 92%; + border-radius:10rpx; + text-align: center; + height: 77rpx; + line-height: 77rpx; + color: #FFF; + font-size: 28rpx; + border: none; + font-family: '微软雅黑'; + } + /* 注释 */ + .zs{ + margin-left: 30rpx; + font-size: 25rpx; + color: #999999; + margin-top:30rpx; + font-family: 'SimHei',Arial; + } +.db{ + display: flex; + width: 100%; + height: 100rpx; + border-bottom: 2rpx solid #e8e8e8; + line-height: 100rpx; +} +/* 项目 */ +.xm{ +margin-left: 30rpx; + height: 100rpx; + font-size: 35rpx; +color: #999999; +width: 50%; +vertical-align: middle; + +} +/* 金额 */ +.je{ + text-align: right; +padding-right:30rpx; + height: 100rpx; + font-size: 35rpx; +color: #999999; +width: 50%; +vertical-align: middle; +} +/* 没有数据 */ +.mysj{ + margin-top: 30rpx; + width: 100%; + height: 70rpx; + font-size: 34rpx; + text-align: center; + color: #888; +} +/*数据*/ +.data{ + display: flex; + width: 100%; + border-bottom: 1px solid #E8E8E8; + height: 120rpx; +} +/*左边的数据 */ +.left{ + width:50%; + height: 120rpx; +} +/* 单据单号 */ +.left-test{ + margin-left: 30rpx; + padding-top: 10rpx; + font-size: 30rpx; + color: #000000; + width: 100%; +} +/* 单据状态 */ +.type{ + margin-top: 10rpx; + font-size: 25rpx; + color: #999999; + width: 100%; +} +/* 单据时间 */ +.time{ + margin: 15rpx -17rpx; + width:280rpx; + font-size: 25rpx; + color: #999999; + + height: 30rpx; +} +/* 流动资金的加减 */ +.money{ +margin:20rpx; + height: 50rpx; + width: 120rpx; + margin-left:100rpx; + font-size: 30rpx; + font-family: 'SimHei',Arial; + text-align:right; +} +.right-rim{ + margin-left: 110rpx; + width: 35%; + height: auto; + +} +/*开始时间清空输入框的按钮*/ +.empty{ + position: absolute; + top: 25rpx; + left:318rpx; +} +/*结束时间清空输入框的按钮*/ +.end{ + width: 25rpx; + height: 25rpx; + border-radius:50%; + background: #767676; + color: #fff; + font-size: 25rpx; + text-align: center; + line-height:19rpx; + +} +/* 弹出框的大边框 */ +.big-rims{ + width:90%; + height: 500rpx; + position: fixed; + z-index: 9999; + background-color: #fff; + border-radius: 10rpx; + flex-direction: column; + align-items: center; + left:40rpx; + top:280rpx; + +} +/* 蒙层 */ + .mask{ + width: 100%; + height: 100%; + position: fixed; + top: 0; + left: 0; + background: #000; + z-index: 9000; + opacity: 0.1; +} +.eject-frame{ +width: 100%; + height: 100%; +margin: 0rpx auto; + line-height: 100%; + +} +/* 弹框参数名字 */ +.parameter-name{ + width: 121%; + height: 35rpx; + padding-left: 30rpx; + line-height:35rpx; +font-size:30rpx; +display: flex; +margin-top:25rpx; +font-family: 'SimHei',Arial; +} +/* 弹框参数 */ +.parameter{ + width: 40%; + height: 35rpx; + text-align:right; + line-height:35rpx; +font-size:30rpx; +font-family: 'SimHei',Arial; +margin-left:115rpx; +} +/* 参数名 */ +.name{ + width: 20%; + height: 35rpx; + +} +.green{ + color: #006600; +} \ No newline at end of file diff --git a/pages/user/member/cash_record/index.wxs b/pages/user/member/cash_record/index.wxs new file mode 100644 index 0000000..e247f84 --- /dev/null +++ b/pages/user/member/cash_record/index.wxs @@ -0,0 +1,63 @@ +var formatNumber = function (n) { + n = n.toString() + return n[1] ? n : '0' + n +} + +var regYear = getRegExp("(y+)", "i"); + +var dateFormat = function (timestamp, format) { + if (!format) { + format = "yyyy-MM-dd hh:mm:ss"; + } + timestamp = parseInt(timestamp)*1000;; + var realDate = getDate(timestamp); + function timeFormat(num) { + return num < 10 ? '0' + num : num; + } + var date = [ + ["M+", timeFormat(realDate.getMonth() + 1)], + ["d+", timeFormat(realDate.getDate())], + ["h+", timeFormat(realDate.getHours())], + ["m+", timeFormat(realDate.getMinutes())], + ["s+", timeFormat(realDate.getSeconds())], + ["q+", Math.floor((realDate.getMonth() + 3) / 3)], + ["S+", realDate.getMilliseconds()], + ]; + var reg1 = regYear.exec(format); + // console.log(reg1[0]); + if (reg1) { + + format = format.replace(reg1[1], (realDate.getFullYear() + '').substring(4 - reg1[1].length)); + } + for (var i = 0; i < date.length; i++) { + var k = date[i][0]; + var v = date[i][1]; + + var reg2 = getRegExp("(" + k + ")").exec(format); + if (reg2) { + format = format.replace(reg2[1], reg2[1].length == 1 + ? v : ("00" + v).substring(("" + v).length)); + } + } + return format; +} + + +module.exports = { + dateFormat: dateFormat +}; + + +function parse(fmt) { + + var a = fmt.slice(0, 4); + console.log("a",a); + var b=+"-"; + console.log("b", b); + var c = fmt.slice(5, 7); + var d=+"-"; + console.log("d", d); + var e = fmt.slice(8, 9); + console.log("e", e); + +} \ No newline at end of file diff --git a/pages/user/member/filter.wxs b/pages/user/member/filter.wxs new file mode 100644 index 0000000..c352e51 --- /dev/null +++ b/pages/user/member/filter.wxs @@ -0,0 +1,22 @@ +var numFr = { + getNum: function(x) { + var f = parseFloat(x); + if (isNaN(f)) { + return false; + } + var f = Math.round(x * 100) / 100; + var s = f.toString(); + var rs = s.indexOf('.'); + if (rs < 0) { + rs = s.length; + s += '.'; + } + while (s.length <= rs + 2) { + s += '0'; + } + return s; + } +} +module.exports = { + getNum: numFr.getNum +} \ No newline at end of file diff --git a/pages/user/member/menber.js b/pages/user/member/menber.js new file mode 100644 index 0000000..e272cee --- /dev/null +++ b/pages/user/member/menber.js @@ -0,0 +1,140 @@ +var e = function (e) { + return e && e.__esModule ? e : { + default: e + }; +}(require("../../../utils/LoadMore.js")), t = getApp(), a = t.request, o = t.globalData.setting, os = o, + i = require("../../../utils/util.js"), ut = i, s = require("../../../utils/common.js"), n = new e.default(); +var regeneratorRuntime = require('../../../utils/runtime.js'); +Page({ + /** + * 页面的初始数据 + */ + data: { + url: o.imghost, + user_money:0.00, + frozen_money:0.00, + iurl: o.imghost, + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + //--先判断会员状态-- + var user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + wx.navigateTo({ url: '/pages/getphone/getphone', }) + return false; + } + this.init_fir(); + wx.setNavigationBarTitle({ + title: "余额", + }) + }, + init_fir: function () { + this.myMoney(); //我的资产 + }, + //获取我的资产 + async myMoney() { + var e = this, frozen_money, user_money; + var user_id = getApp().globalData.user_id; + var store_id = os.stoid; + + console.log(user_id, "是什么用户", store_id); + await getApp().request.promiseGet("/api/weshop/users/getMymoney/" +store_id+ "/" + user_id + , { + data: {} + }).then(res => { + console.log("1" + res); + var a = res.data.data; + var a = res.data.data; + frozen_money = a.unavailable; + console.log(a,"s1w" + a.frozen_money); + user_money = a.liudong_money; + console.log("menber" + a.user_money ); + getApp().globalData.user_money = user_money; + console.log("menberssss" + user_money); + // 赋值getApp().globalData.can_use_money = 10; + // 取值var can = getApp().globalData.can_use_money; + }) + this.setData({ + frozen_money: frozen_money, user_money: user_money}); + }, + + + + +//提现记录 + urls: function () { + wx.navigateTo({ + url: 'cash_record/cash_record', + }) + }, + //不可用资金明细 + url: function () { + wx.navigateTo({ + url: 'account_unable/account_unable', + }) + }, + // 流动资金提现 + jumPage:function(){ + wx.navigateTo({ + url: 'bring/bring', + }) + }, + //流动资金明细 + jumPages: function () { + wx.navigateTo({ + url: 'account/account', + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/user/member/menber.json b/pages/user/member/menber.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/pages/user/member/menber.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/pages/user/member/menber.wxml b/pages/user/member/menber.wxml new file mode 100644 index 0000000..67fa3c5 --- /dev/null +++ b/pages/user/member/menber.wxml @@ -0,0 +1,45 @@ + + + + +总资产 (元) +{{filter.getNum(user_money)}} + + + +可提现 (元) +{{filter.getNum(user_money)}} + + +不可用 (元) +{{filter.getNum(frozen_money)}} + + + + + + +流动资金提现 + + + + + +流动资金明细 + + + + + +不可用资金明细 + + + + + + +提现记录 + + + + \ No newline at end of file diff --git a/pages/user/member/menber.wxss b/pages/user/member/menber.wxss new file mode 100644 index 0000000..5e086a0 --- /dev/null +++ b/pages/user/member/menber.wxss @@ -0,0 +1,119 @@ +/* 图片 */ +.pictuer{ + width: 100%; + height: 325rpx; +} +/* 资产的大边框 */ +.big{ + color: #FFFFFF; + position: absolute; + top: 20rpx; + left: 45rpx; + width: 665rpx; + height: 280rpx; +} +/* 总资产 */ +.font-one{ +font-size:28rpx; +text-align: left; +height: 55rpx; +line-height:55rpx; +margin:6rpx; +} +/* 资产金额 */ +.font-two{ + font-size: 45rpx; + font-family: 'SimHei',Arial; + margin:-10rpx 5rpx; + +} +/*可提现和不可提现的边框 */ +.rim-neo{ + width: 100%; + display: flex; + margin-top:67rpx; + height:120rpx; +} +/*不可提现的边框 */ +.rim-two{ +width: 50%; + height:120rpx; + display:inline-block; + +} + +/* 可提现 */ +.font-three{ + color: #ff9998; + font-size:25rpx; + text-align: left; + height: 50rpx; + line-height:50rpx; + display:inline-block; + width:150rpx; + +} +/* 可提现和金额的小边框 */ +.rim-three{ + width: 50%; + height: 120rpx; + display:inline-block; +} + +/*不可用 */ +.font-four{ + width: 100%; + display:inline-block; + color: #ff9998; + font-size:25rpx; + height:50rpx; +line-height:50rpx; + text-align: left; + font-family: 'SimHei',Arial; + +} +/* 可提现和不可提现的金额 */ +.font-five{ + font-size:45rpx; + font-family:'SimHei',Arial; +} +/* 流动资金的边框 */ +.min-rim-one{ + display: flex; + width: 100%; + height:90rpx; + line-height: 90rpx; + border-bottom: 1px solid #EEEEEE; +} +/* 流动资金的小图片 */ +.picture-two{ + margin-top:33rpx; + width: 40rpx; + height: 30rpx; + margin-left: 20rpx; +} +/* 流动资金 */ +.ldzj-font{ + margin-left: 20rpx; + font-size:25rpx; + width:200rpx; + +} +.picture-three{ + margin-top:32rpx; + margin-left: 420rpx; + height: 30rpx; + width: 20rpx; +} +.picture-four{ + margin-top:32rpx; + margin-left: 420rpx; + height: 30rpx; + width: 20rpx; +} +.picture-five{ + margin-top:32rpx; + margin-left: 420rpx; + height: 30rpx; + width: 20rpx; +} diff --git a/pages/user/message_notice/message_notice.js b/pages/user/message_notice/message_notice.js new file mode 100644 index 0000000..07a989c --- /dev/null +++ b/pages/user/message_notice/message_notice.js @@ -0,0 +1,42 @@ +var t = getApp(), s = t.request, e = require("../../../utils/util.js"); + +Page({ + data: { + url: t.globalData.setting.url, + resourceUrl: t.globalData.setting.resourceUrl, + iurl: t.globalData.setting.imghost, + categories: [ { + name: "全部消息", + status: 0 + }, { + name: "系统消息", + status: 1 + } ], + activeStatus: 0, + messages: null + }, + onLoad: function(t) { + var s = void 0 === t.status ? this.data.activeStatus : t.status; + this.requestMessages(s); + }, + changeTab: function(t) { + this.requestMessages(t.currentTarget.dataset.status); + }, + requestMessages: function(t) { + var a = this; + this.setData({ + activeStatus: t + }), s.get("/api/user/message_list?type=" + t, { + success: function(t) { + t.data.result.forEach(function(t, s, a) { + t.sendTimeFommat = e.format(t.send_time, "yyyy-MM-dd"); + }), a.setData({ + messages: t.data.result + }), wx.stopPullDownRefresh(); + } + }); + }, + onPullDownRefresh: function(t) { + this.requestMessages(this.data.activeStatus); + } +}); \ No newline at end of file diff --git a/pages/user/message_notice/message_notice.json b/pages/user/message_notice/message_notice.json new file mode 100644 index 0000000..e4f4a9e --- /dev/null +++ b/pages/user/message_notice/message_notice.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "消息中心" +} \ No newline at end of file diff --git a/pages/user/message_notice/message_notice.wxml b/pages/user/message_notice/message_notice.wxml new file mode 100644 index 0000000..53499fd --- /dev/null +++ b/pages/user/message_notice/message_notice.wxml @@ -0,0 +1,20 @@ + + + + + {{item.name}} + + + + + + {{item.sendTimeFommat}} + {{item.message}} + + + + + 没有找到相关的记录 + 去逛逛 + + diff --git a/pages/user/message_notice/message_notice.wxss b/pages/user/message_notice/message_notice.wxss new file mode 100644 index 0000000..5421f4f --- /dev/null +++ b/pages/user/message_notice/message_notice.wxss @@ -0,0 +1,37 @@ +.type-navbar { + white-space: nowrap; + display: flex; + width: 100%; + height: 80rpx; + background-color: #fff; +} + +.type-box { + width: 50%; + box-sizing: border-box; + font-size: 28rpx; + line-height: 76rpx; + padding: 0 20rpx; + text-align: center; + display: inline-block; + overflow: hidden; +} + +.type-navbar-item { + border-bottom: 4rpx solid #fff; +} + +.type-item-on { + border-bottom: 4rpx solid #e64340; +} + +.msg-box { + background-color: white; + padding: 20rpx 30rpx; + border-bottom: 2px solid #f8f8f8; + font-size: 30rpx; +} + +.msg-time { + padding: 10rpx 0; +} \ No newline at end of file diff --git a/pages/user/order_detail/order_detail.js b/pages/user/order_detail/order_detail.js new file mode 100644 index 0000000..6c99e8f --- /dev/null +++ b/pages/user/order_detail/order_detail.js @@ -0,0 +1,181 @@ +var e = getApp(), r = e.request,rq=r,t = require("../../../utils/util.js"), o = require("../../../utils/common.js"),oo=e.globalData,os=oo.setting; + +Page({ + data: { + url: os.url, + resourceUrl: os.imghost, + iurl: os.imghost, + order: null, + optionIsGoup: !1, + user_note: "" + }, + onLoad: function(e) { + var r = void 0 !== e.isGoup && e.isGoup; + this.setData({ + optionIsGoup: r + }), this.requestOrderDetail(e.order_id), wx.removeStorageSync("order:order_detail:update"); + }, + onShow: function() { + wx.getStorageSync("order:order_detail:update") && (wx.removeStorageSync("order:order_detail:update"), + this.requestOrderDetail(this.data.order.order_id)); + }, + requestOrderDetail: function(e) { + var o = this,oid=e; + r.get(o.data.url + "/api/weshop/order/get/"+os.stoid+"/"+e, { + success: function(e) { + var r = e.data.data; + r.addTimeFormat = t.format(r.add_time); + if (r.order_status == 0 && r.pay_status==0 ){ + r.order_status_detail="待支付"; r.pay_btn=1; + } + if (r.order_status == 1 && r.pay_status == 1 && r.shipping_status== 0) + r.order_status_detail = "待发货"; + + if (r.order_status == 1 && r.pay_status == 1 && r.shipping_status == 1){ + r.order_status_detail = "待收货";r.receive_btn=1; + if (r.exp_type == 0) r.shipping_btn=1; + } + if (r.order_status == 1 && r.pay_status == 1 && r.shipping_status == 2){ + r.order_status_detail = "待收货"; r.receive_btn = 1; + if (r.exp_type == 0) r.shipping_btn = 1; + } + if (r.order_status == 2){ + r.order_status_detail = "待评价"; if (r.exp_type == 0) r.shipping_btn = 1; + } + if (r.order_status == 3) + r.order_status_detail = "已取消"; + if (r.order_status == 4){ + r.order_status_detail = "已完成"; if (r.exp_type == 0) r.shipping_btn = 1; + } + if (r.order_status == 5) + r.order_status_detail = "已作废"; + if (r.order_status == 6) + r.order_status_detail = "退款完成"; + + //------获取订单商品------- + rq.get("/api/weshop/ordergoods/list",{ + data: { store_id: os.stoid, order_id: oid}, + success: function (eb) { + r.order_goods=eb.data.data.pageData; + //--------获取门店----------- + rq.get("/api/weshop/pickup/get/" + os.stoid + "/" + r.pickup_id, { + success: function (ebb) { + r.pickname = ebb.data.data.pickup_name; + o.setData({ + order: r, + }); + } + }) + } + }) + } + }); + }, + /*-----联系客户------*/ + contactService: function() { + e.getConfig(function(t) { + if (t.store_tel == undefined) { + getApp().request.get("/api/weshop/store/get/" + os.stoid, { + isShowLoading: 1, + data: {}, + success: function (rs) { + getApp().globalData.config = rs.data.data; + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { + getApp().showWarning("商家未设置电话"); + return false; + } + e.confirmBox("请联系客服:" + rs.data.data.store_tel); + } + }) + } else { + e.confirmBox("请联系客服:" + t.store_tel); + } + }); + }, + + //--------取消订单--------- + cancelOrder: function(e) { + var t = this,th=t, o = e.currentTarget.dataset.id,order=this.data.order; + var is_skill=0; + var order_goods=order.order_goods; + var is_zsorder=order.is_zsorder; + + //--判断是不是秒杀-- + order_goods.forEach(function (val,ind) { + if(val.prom_type==1){ + is_skill=1; return false; + } + }) + + wx.showModal({ + title: "是否取消订单?", + success: function(e) { + if(!e.confirm) return false; + //如果是秒杀和拼单的商品,取消订单要返回redis,并取消订单 + if(is_skill==1 || is_zsorder>=2){ + getApp().request.delete("/api/weshop/order/cancelTeamOrder/"+os.stoid+"/"+o,{ + data:{}, + success: function(t) { + if(t.data.code==0) + th.requestOrderDetail(o), wx.setStorageSync("order:order_list:update", !0); + }, + }) + }else{ + getApp().request.put("/api/weshop/order/updatebyId", { + data: {order_id: o, order_status: 3}, + success: function(e) { + th.requestOrderDetail(o), wx.setStorageSync("order:order_list:update", !0); + } + }); + } + } + }); + }, + + //--------确认收货--------- + confirmOrder: function(e) { + var t = this, o = this.data.order.order_id,order=this.data.order; + var is_zsorder=order.is_zsorder; + wx.showModal({ + title: "是否确定收货", + success: function(e) { + e.confirm && r.put("/api/weshop/order/updatebyId", { + data: { + order_id: o, order_status: 2 + }, + success: function(e) { + t.requestOrderDetail(o), wx.setStorageSync("order:order_list:update", !0); + //如果是会员团订单 + if(is_zsorder==3){ + getApp().request.post("/api/weshop/order/vipTuanTebate/"+os.stoid+"/"+o,{ + data:{}, success:function () { }}) + } + } + }); + } + }); + }, + + //--------立即支付---------- + jumpToCart4: function(e) { + this.data.optionIsGoup ? wx.navigateTo({ + url: "/pages/team/team_confirm/team_confirm?orderSn=" + this.data.order.order_sn + "&orderPay=true" + }) : o.jumpToCart4({ + order_sn: this.data.order.order_sn, + order_amount: this.data.order.order_amount + }, 1); + }, + checkTeam: function() { + wx.navigateTo({ + url: "/pages/team/team_detail/team_detail?foundId=" + this.data.order.orderTeamFound.found_id + }); + }, + + //------图片失败,默认图片--------- + bind_bnerr: function (e) { + var _errImg = e.target.dataset.errorimg; + var _errObj = {}; + _errObj[_errImg] = "public/images/default_goods_image_240.gif"; + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; + }, +}); \ No newline at end of file diff --git a/pages/user/order_detail/order_detail.json b/pages/user/order_detail/order_detail.json new file mode 100644 index 0000000..9a4a86c --- /dev/null +++ b/pages/user/order_detail/order_detail.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "订单详情", + "enablePullDownRefresh": false +} \ No newline at end of file diff --git a/pages/user/order_detail/order_detail.wxml b/pages/user/order_detail/order_detail.wxml new file mode 100644 index 0000000..6402d8b --- /dev/null +++ b/pages/user/order_detail/order_detail.wxml @@ -0,0 +1,106 @@ + + + + {{order.consignee}}{{'  '}}{{order.mobile}} + + + {{order.more_address}} {{order.address}} + + + + + + + + + + 门店:{{order.pickname}} + {{order.order_status_detail}} + + + + + + + {{item.goods_name}} + {{item.goods_spec}} {{item.goods_color}} + + + ¥{{item.member_goods_price}} + ¥{{item.goods_num}} + + + + 查看拼团详情 + 联系客服 + + + + + + 基本信息 + + 订单编号 + {{order.order_sn}} + + + 下单时间 + {{order.addTimeFormat}} + + + + 配送方式 + {{(order.shipping_name!=''&& order.shipping_name!=null) ?order.shipping_name:'无'}} + + + 买家留言 + {{order.user_note!=''?order.user_note:'无'}} + + + + 价格信息 + + 商品总价 + ¥ {{order.goods_price}}元 + + + 运费 + ¥ {{order.shipping_price}}元 + + + 优惠券 + - ¥ {{order.coupon_price}}元 + + + 积分 + - ¥ {{order.integral_money}}元 + + + 余额 + - ¥ {{order.user_money}}元 + + + 订单优惠 + - ¥ {{order.order_prom_amount}}元 + + + 尾款金额 + - ¥ {{order.pt_tail_money}}元 + + + + + 实付金额 + ¥ {{order.order_amount}}元 + + + + + 支付尾款 + + + + + diff --git a/pages/user/order_detail/order_detail.wxss b/pages/user/order_detail/order_detail.wxss new file mode 100644 index 0000000..c18cc63 --- /dev/null +++ b/pages/user/order_detail/order_detail.wxss @@ -0,0 +1,164 @@ +.user-mes { + background-color: #fff; + font-size: 32rpx; + color: #333; +} + +.user-contact { + padding: 24rpx 80rpx; +} + +.location { + position: relative; + padding: 0 80rpx 24rpx; +} + +.pos-icon { + position: absolute; + left: 30rpx; + top: 0; + width: 32rpx; + height: 32.5rpx; +} + +.border-img { + width: 100%; + height: 16rpx; +} + +.order-meg { + margin-bottom: 20rpx; + font-size: 30rpx; +} + +.order-state { + height: 100rpx; + line-height: 100rpx; + padding-right: 40rpx; + padding-left: 40rpx; + background-color: #fff; + color: #f23030; + justify-content: space-between; + display: flex; +} +.shop_name{color: #333} +.order-detail { + padding: 30rpx 0; + border-bottom: 1px solid #ddd; + color: #666; + min-height: 100rpx; +} +.goods-img { + float: left; + width: 100rpx; + height: 100rpx; + margin: 0 30rpx; +} + +.order-cont { + float: left; + width: 400rpx; +} + +.goods-name { + height: 60rpx; + line-height: 30rpx; + overflow: hidden; + margin-bottom: 16rpx; +} + +.goods-color { + font-size: 24rpx; +} + +.order-num { + float: right; + font-size: 24rpx; + margin-top: 10rpx; + margin-right: 20rpx; + text-align: right; + line-height: 42rpx; +} + +.order-operate { + height: 100rpx; + padding-right: 20rpx; + background-color: #fff; + display: flex; + align-items: center; + justify-content: flex-end; +} + +.check-btn { + width: 180rpx; + height: 60rpx; + line-height: 60rpx; + text-align: center; + margin-right: 10rpx; + border: 1px solid #eee; +} + +.goods-btn { + width: 150rpx; + height: 60rpx; + line-height: 60rpx; + text-align: center; + border: 1px solid #eee; +} + +.cancel-order { + margin-left: 20rpx; +} + +.information { + padding: 0 20rpx; + background-color: #fff; + margin-bottom: 20rpx; +} + +.information .title { + height: 70rpx; + line-height: 70rpx; + border-bottom: 1px solid #ddd; + font-size: 34rpx; + color: #333; +} + +.information .item { + display: flex; + justify-content: space-between; + height: 60rpx; + line-height: 60rpx; + font-size: 30rpx; + color: #666; +} + +.delivery-address,.leave-word { + width: 500rpx; + text-align: right; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.pay-amount { + color: #f23030; +} + +.btn-wrap { + height: 100rpx; + background-color: #fff; + text-align: right; +} + +.tips-btn { + display: inline-block; + width: 200rpx; + height: 100rpx; + line-height: 100rpx; + text-align: center; + font-size: 30rpx; + color: #fff; + background-color: #f23030; + margin-left: 2rpx; +} \ No newline at end of file diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js new file mode 100644 index 0000000..e2763f6 --- /dev/null +++ b/pages/user/order_list/order_list.js @@ -0,0 +1,330 @@ +var t = function(t) { + return t && t.__esModule ? t : { + default: t + }; +}(require("../../../utils/LoadMore.js")), e = getApp(),os=e.globalData.setting,oo=e.globalData, + r = e.request,rq=r, a = require("../../../utils/common.js"), s = new t.default(); + +Page({ + data: { + url: e.globalData.setting.url, + resourceUrl: e.globalData.setting.imghost, + iurl: e.globalData.setting.imghost, + categories: [ { + name: "全部订单",id: 0 + }, { + name: "待付款",id: 1 + }, { + name: "待发货",id: 2 + }, { + name: "待收货",id: 3 + }, { + name: "待评价",id: 4 + } ], + activeCategoryId: 0, + orderList: null, + currentPage: 1, + + //已经读取过接口 + is_get:0, + }, + onLoad: function(t) { + var e = void 0 === t.type ? this.data.activeCategoryId : t.type; + s.init(this, "", "orderList"), this.requestOrderList(e), wx.removeStorageSync("order:order_list:update"); + }, + onShow: function() { + wx.getStorageSync("order:order_list:update") && (wx.setStorageSync("order:order_list:update", !1), + this.resetData(), this.requestOrderList(this.data.activeCategoryId)); + }, + changeTab: function(t) { + this.resetData(), this.requestOrderList(t.currentTarget.id); + }, + resetData: function() { + s.resetConfig(), this.data.orderList = null, this.data.currentPage = 1; + }, + + /*---------获取订单列表--------*/ + requestOrderList: function(t) { + var e = this,th=e, r = e.data.url + "/api/weshop/order/page?1=1", a = ""; + switch(t){ + case "1": + r += "&wait_status=0"; break; + case "2": + r += "&wait_status=1"; break; + case "3": + r += "&wait_status=2";break; + case "4": + r +="&order_status=2"; break; + } + this.setData({ activeCategoryId: t }); r = r + "&page=" + e.data.currentPage; + s.request(r, function(t) { + + th.setData({is_get:1}); + + var data=e.data.orderList; + data.forEach(function (item,ind){ + console.log(item) + if (item.order_goods==undefined){ + rq.get('/api/weshop/ordergoods/list',{ + isShowLoading:0, + data: {order_id: item.order_id, store_id:os.stoid,pageSize:600}, + success: function (tt) { + //------------对比一下有没有退款记录------------ + rq.get("/api/weshop/order/returngoods/page",{ + isShowLoading: 0, + data: { order_id: item.order_id, store_id: os.stoid, + user_id:oo.user_id, pageSize: 20 }, + success: function (ttd) { + console.log('returngoods'); + var gtype_num = tt.data.data.total; + if(ttd.data.data.pageData == undefined) return false; + var goodslist = tt.data.data.pageData; + //----没有相关的退款记录---- + if (ttd.data.data.total==0){ + data[ind]['is_all_return'] = 0; + goodslist.forEach(function (ee, ii) { + if (data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1 && gtype_num>1) + goodslist[ii]['return_btn']=1; + }); + }else{ + //--------整单退-------- + if (ttd.data.data.pageData[0]['goods_id_list'] != null + && ttd.data.data.pageData[0]['goods_id_list'] != ''){ + var eea = ttd.data.data.pageData[0]; + //1.退款正在进行中, + //2.退款被拒绝就要显示可以退款 + //3.退款已经完成 + data[ind]['is_all_return']=1; + data[ind]['is_all_return_status'] = ttd.data.data.pageData[0].status; + + if (data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) { + + switch (eea.status) { + case 0: + case 1: + data[ind]['return_btn'] = 2; break; + case 2: + data[ind]['return_btn'] = 2; break; + case 3: + data[ind]['return_btn'] = 3; break; + default: + data[ind]['return_btn'] = 0; + } + + } + }else{ + //1.退款正在进行中, + //2.退款被拒绝就要显示可以退款 + //3.退款已经完成 + data[ind]['is_all_return'] = 0; + if(data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) { + ttd.data.data.pageData.forEach(function (eea, ii) { + goodslist.forEach(function (eeb, iii) { + var st = eea.status; + + if (eea.goods_id == eeb.goods_id){ + data[ind]['has_rt'] = 1; //有部分退 + switch (eea.status){ + case 0: + case 1://退款处理中 + goodslist[iii]['return_btn'] = 2;break; + + case 2://已完成 + goodslist[iii]['return_btn'] = 2; break; + case 3://已拒绝 + goodslist[iii]['return_btn'] = 3; break; + default: + goodslist[iii]['return_btn'] = 1; + } + }else{ + goodslist[iii]['return_btn'] =0; + } + }); + }); + } + } + } + data[ind]['order_goods'] = goodslist; + var g_num = 0; + goodslist.forEach(function (ee, ii) { + g_num += ee.goods_num; + }); + data[ind]['g_num'] = g_num; + th.setData({ orderList: data, }); + } + }) + } + }) + } + }); + e.data.currentPage++, + /*--- + t.data.result.forEach(function(t, e, r) { + t.goods_sum = t.order_goods.reduce(function(t, e) { + return t + e.goods_num; + }, 0); + }),---*/ + wx.stopPullDownRefresh(); + },null,{store_id:os.stoid,user_id:oo.user_id}); + }, + onReachBottom: function() { + s.canloadMore() && this.requestOrderList(this.data.activeCategoryId); + }, + onPullDownRefresh: function(t) { + this.resetData(), this.requestOrderList(this.data.activeCategoryId); + }, + + /*-----------取消订单-----------*/ + cancelOrder: function(t) { + var e = this, a = t.currentTarget.dataset.id,th=this; + var is_zsorder= parseFloat(t.currentTarget.dataset.zsorder); + var index=t.currentTarget.dataset.orderindex; + var order=th.data.orderList[index]; + var is_skill=0; + var order_goods=order.order_goods; + //--判断是不是秒杀-- + order_goods.forEach(function (val,ind) { + if(val.prom_type==1){ + is_skill=1; return false; + } + }) + + wx.showModal({ + title: "是否取消订单?", + success: function(t) { + //如果是秒杀和拼单的商品,取消订单要返回redis,并取消订单 + if(t.confirm){ + if(is_skill==1 || is_zsorder>=2){ + getApp().request.delete("/api/weshop/order/cancelTeamOrder/"+os.stoid+"/"+a,{ + data:{}, + success: function(t) { + if(t.data.code==0) + { + 0 == e.data.activeCategoryId ? + (e.resetData(), e.requestOrderList(e.data.activeCategoryId)) : e.deleteOrderData(a); + } + else + { + getApp().confirmBox(e.data.msg); + } + }, + }) + }else{ + rq.put("/api/weshop/order/updatebyId", { + data: { + order_id: a, order_status: 3 + }, + success: function (t) { + 0 == e.data.activeCategoryId ? + (e.resetData(), e.requestOrderList(e.data.activeCategoryId)) : e.deleteOrderData(a); + } + }); + } + } + } + }); + }, + + /*-----------确认收货-----------*/ + confirmOrder: function(t) { + var e = this, a = t.currentTarget.dataset.id; + var is_zsorder=t.currentTarget.dataset.zsorder; + + console.log("confirmOrder"); + console.log(is_zsorder); + + wx.showModal({ + title: "是否确定收货", + success: function(t) { + t.confirm && rq.put("/api/weshop/order/updatebyId", { + data: { + order_id: a,order_status:2 + }, + success: function(t) { + e.deleteOrderData(a); + //如果是会员团订单 + if(is_zsorder==3){ + getApp().request.post("/api/weshop/order/vipTuanTebate/"+os.stoid+"/"+a,{ + data:{}, success:function () { }}) + } + } + }); + } + }); + }, + + //-----删除订单----- + deleteOrderData: function(t) { + for (var e = 0; e < this.data.orderList.length; e++) if (this.data.orderList[e].order_id == t) { + this.data.orderList.splice(e, 1), this.setData({ + orderList: this.data.orderList + }); + break; + } + }, + + //---判断是不是有退款----- + checkReturnGoodsStatus: function(t) { + var e = t.currentTarget.dataset.recid; + var oid = t.currentTarget.dataset.oid; + r.get("/api/weshop/order/returngoods/page", { + data: { + goods_id: e, + order_id:oid, + store_id:os.stoid + }, + success: function(t) { + if(t.data.code==0){ + var r = t.data.data.total; + if (0 == r) return wx.navigateTo({ + url: "/pages/user/return_goods/return_goods?rec_id=" + e + "&order_id=" + oid, + }); + wx.navigateTo({ + url: "/pages/user/return_goods_info/return_goods_info?id=" + r + }); + } + } + }); + }, + + /*----------跳转支付-----------*/ + jumpToCart4: function(t) { + var e = this.data.orderList[t.currentTarget.dataset.idx]; + a.jumpToCart4({ + order_sn: e.order_sn, + order_amount: e.order_amount, + type:1//正常单 + }); + }, + + //------图片失败,默认图片--------- + bind_bnerr: function (e) { + var _errImg = e.target.dataset.errorimg; + var _errObj = {}; + _errObj[_errImg] = "public/images/default_goods_image_240.gif"; + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; + }, + + //--------跳转到退款详情----------- + gotoreturn:function(t){ + var e = t.currentTarget.dataset.recid; + var oid = t.currentTarget.dataset.oid; + var wh=""; + if(e!=undefined && e!=null && e!=""){ + wh="&goods_id="+e; + } + wx.navigateTo({ + url: "/pages/user/return_goods_info/return_goods_info?order_id=" + oid+wh, + }); + }, + + //-----支付尾款------ + pay_wk:function (ee) { + console.log("pay_wk"); + var order_id=ee.currentTarget.dataset.order_id; + wx.navigateTo({ + url: "/pages/cart/cart_wk/cart_wk?order_id=" + order_id, + }); + + } +}); \ No newline at end of file diff --git a/pages/user/order_list/order_list.json b/pages/user/order_list/order_list.json new file mode 100644 index 0000000..ee9be96 --- /dev/null +++ b/pages/user/order_list/order_list.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "我的订单" +} \ No newline at end of file diff --git a/pages/user/order_list/order_list.wxml b/pages/user/order_list/order_list.wxml new file mode 100644 index 0000000..c0cd004 --- /dev/null +++ b/pages/user/order_list/order_list.wxml @@ -0,0 +1,90 @@ + + + + + {{item.name}} + + + + + + + + 订单编号:{{item.order_sn}} + {{item.order_status_detail}} + + + + + + + + + {{goods.goods_name}} + {{goods.goods_color}} {{goods.goods_spec}} + ¥ {{goods.member_goods_price}} + 数量 {{goods.goods_num}} + + + + + + + + + 组团中 + + + 待支付尾款 + + + + + + 共{{item.g_num}}件, + 金额:¥{{item.order_amount+item.user_money}} + 尾款:¥{{item.pt_tail_money}} + + + + 支付尾款 + + 已取消 + + 拼团失败 + + + + + + + + 重新退款 + 退款详情 + + + + + + + + + + + + + + + 暂无订单列表 + 去逛逛 + + + diff --git a/pages/user/order_list/order_list.wxss b/pages/user/order_list/order_list.wxss new file mode 100644 index 0000000..8d6baa8 --- /dev/null +++ b/pages/user/order_list/order_list.wxss @@ -0,0 +1,145 @@ +.type-navbar { + white-space: nowrap; + display: flex; + width: 100%; + height: 80rpx; + background-color: #fff; +} + +.type-box { + width: 25%; + box-sizing: border-box; + font-size: 32rpx; + line-height: 76rpx; + padding: 0 20rpx; + text-align: center; + display: inline-block; + overflow: hidden; +} + +.type-navbar-item { + border-bottom: 4rpx solid #fff; +} + +.type-item-on { + border-bottom: 4rpx solid #e64340; +} + +.goods-container { + display: flex; + justify-content: space-between; + flex-wrap: wrap; + box-sizing: content-box; + padding: 20rpx 0; +} + +.goods-box { + width: 100%; + background-color: #fff; + padding: 0 30rpx; + margin-bottom: 20rpx; + font-size: 28rpx; + border-bottom: 1rpx solid #eee; +} + +.goods-title { + display: flex; + justify-content: space-between; + align-items: center; + height: 100rpx; +} + +.order-number { + font-size: 32rpx; + color: #666; +} + +.pay-status { + color: #f23030; +} + +.goods-cont { + padding: 20rpx 0; + display: flex; + justify-content: space-between; + position: relative; +} + +.img-box { + width: 180rpx; + height: 180rpx; +} + +.goods-mes { + width: 490rpx; +} + +.goods-name { + height: 30rpx; + margin-bottom: 16rpx; + overflow: hidden; + line-height: 30rpx; + color: #333; + word-break: keep-all; + white-space: nowrap; + text-overflow: ellipsis; + font-size: 30rpx; +} + +.goods-price { + color: #f23030; + padding-bottom: 20rpx; + font-size: 30rpx; +} + +.goods-num { + color: #999999; + font-size: 30rpx; +} + +.return-btn { + color: #999999; + position: absolute; + right: 0; + bottom: 0rpx; + height: 80rpx; + line-height: 80rpx; +} + +.goods-tips { + height: 60rpx; + padding: 50rpx 0; + display: flex; + justify-content: space-between; + align-items: center; +} + +.order-total { + display: flex; + justify-content: flex-start; + font-size: 32rpx; + color: #333; +} + +.goods-total { + margin-right: 20rpx; + color: #f23030; +} + +.order-btn { + width: 150rpx; + height: 60rpx; + line-height: 60rpx; + text-align: center; + border: 1px solid #eee; + margin-left: 20rpx; + float: right; + border-radius: 5rpx; +} + +.order-btn-pay { + color: #fff; + background-color: #f23030; + border-color: #f23030; +} +.return-btn.co-red{color: #e02e24} diff --git a/pages/user/points_list/points_list.js b/pages/user/points_list/points_list.js new file mode 100644 index 0000000..fbc9355 --- /dev/null +++ b/pages/user/points_list/points_list.js @@ -0,0 +1,48 @@ +var t = function(t) { + return t && t.__esModule ? t : { + default: t + }; +}(require("../../../utils/LoadMore.js")), e = getApp(), a = new t.default(), i = require("../../../utils/util.js"); + +Page({ + data: { + url: e.globalData.setting.url, + resourceUrl: e.globalData.setting.resourceUrl, + categories: [ { + name: "全部", + type: "all" + }, { + name: "赚取", + type: "plus" + }, { + name: "消费", + type: "minus" + } ], + activeType: "all", + points: null, + currentPage: 1 + }, + onLoad: function(t) { + var e = void 0 === t.type ? this.data.activeType : t.type; + a.init(this, "", "points"), this.requestPointList(e); + }, + changeTab: function(t) { + a.resetConfig(), this.data.points = null, this.data.currentPage = 1, this.requestPointList(t.currentTarget.id); + }, + requestPointList: function(t) { + var e = this, n = "/api/user/points_list/type/" + t + "?p=" + e.data.currentPage; + this.setData({ + activeType: t + }), a.request(n, function(t) { + e.data.currentPage++, t.data.result.forEach(function(t, e, a) { + t.changeTimeFommat = i.format(t.change_time, "yyyy-MM-dd hh:mm"); + }), wx.stopPullDownRefresh(); + }); + }, + onReachBottom: function() { + a.canloadMore() && this.requestPointList(this.data.activeType); + }, + onPullDownRefresh: function(t) { + this.data.points = null, this.data.currentPage = 1, a.resetConfig(), this.requestPointList(this.data.activeType); + } +}); \ No newline at end of file diff --git a/pages/user/points_list/points_list.json b/pages/user/points_list/points_list.json new file mode 100644 index 0000000..93a8919 --- /dev/null +++ b/pages/user/points_list/points_list.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "积分明细" +} \ No newline at end of file diff --git a/pages/user/points_list/points_list.wxml b/pages/user/points_list/points_list.wxml new file mode 100644 index 0000000..c4b03cd --- /dev/null +++ b/pages/user/points_list/points_list.wxml @@ -0,0 +1,19 @@ + + + + + {{item.name}} + + + + + 描述 + 积分 + 时间 + + + {{item.desc}} + {{item.pay_points}} + {{item.changeTimeFommat}} + + diff --git a/pages/user/points_list/points_list.wxss b/pages/user/points_list/points_list.wxss new file mode 100644 index 0000000..4de89bd --- /dev/null +++ b/pages/user/points_list/points_list.wxss @@ -0,0 +1,56 @@ +page { + background-color: white; +} + +.container { + padding: 20rpx 30rpx; +} + +.navbar { + width: 100%; +} + +.navbar-box { + font-size: 35rpx; + display: inline-block; + width: 33.333333%; + border: 1rpx solid #f8f8f8; + box-sizing: border-box; + text-align: center; + line-height: 85rpx; +} + +.navbar-item-on { + background-color: #e01222; + border-radius: 6rpx; +} + +.point-box { + width: 100%; + font-size: 28rpx; + padding: 20rpx 0; + border-bottom: 1rpx solid #f8f8f8; + padding-left: 5rpx; +} + +.point-item { + display: inline-block; + width: 33.333333%; + word-break: keep-all; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.point-box .price { + color: #e01222; + text-align: center; +} + +.point-box .time { + color: #999999; +} + +.point-box .title { + text-align: center; +} \ No newline at end of file diff --git a/pages/user/recharge/recharge.js b/pages/user/recharge/recharge.js new file mode 100644 index 0000000..85ce571 --- /dev/null +++ b/pages/user/recharge/recharge.js @@ -0,0 +1,20 @@ +var e = getApp(), a = require("../../../utils/pay.js"); + +Page({ + data: { + userMoney: 0, + iurl:e.globalData.setting.imghost, + }, + onLoad: function(e) { + this.setData({ + userMoney: e.money + }); + }, + submitRechange: function(n) { + var t = parseFloat(n.detail.value.money); + if (console.log(t), isNaN(t) || t < .01) return e.showWarning("请输入有效的金额"); + a.rechange(t, function() { + wx.navigateBack(); + }); + } +}); \ No newline at end of file diff --git a/pages/user/recharge/recharge.json b/pages/user/recharge/recharge.json new file mode 100644 index 0000000..ca0536f --- /dev/null +++ b/pages/user/recharge/recharge.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "充值" +} \ No newline at end of file diff --git a/pages/user/recharge/recharge.wxml b/pages/user/recharge/recharge.wxml new file mode 100644 index 0000000..79361d5 --- /dev/null +++ b/pages/user/recharge/recharge.wxml @@ -0,0 +1,18 @@ +
+ + + 您的当前余额 : {{userMoney}} 元 + + + 充值金额 : + + + + 充值方式 : + + + + + + +
diff --git a/pages/user/recharge/recharge.wxss b/pages/user/recharge/recharge.wxss new file mode 100644 index 0000000..31002df --- /dev/null +++ b/pages/user/recharge/recharge.wxss @@ -0,0 +1,43 @@ +.balance { + font-size: 28rpx; + line-height: 64rpx; + color: #444; + border-bottom: 1px solid #ddd; +} + +.recharge { + display: flex; + align-items: center; + height: 120rpx; + font-size: 28rpx; + color: #444; + border-bottom: 1px solid #ddd; +} + +.recharge .title { + word-break: keep-all; + white-space: nowrap; +} + +.recharge input { + height: 120rpx; + margin-left: 30rpx; +} + +.pic-wrap { + margin-left: 30rpx; + width: 240rpx; + height: 72rpx; +} + +.recharge-btns { + margin: 60rpx auto 0; + width: 580rpx; + height: 88rpx; + font-size: 28rpx; + line-height: 88rpx; + text-align: center; + color: #fff; + background-color: #e30000; + border-radius: 8rpx; +} \ No newline at end of file diff --git a/pages/user/recharge_list/recharge_list.js b/pages/user/recharge_list/recharge_list.js new file mode 100644 index 0000000..5b85415 --- /dev/null +++ b/pages/user/recharge_list/recharge_list.js @@ -0,0 +1,32 @@ +var e = function(e) { + return e && e.__esModule ? e : { + default: e + }; +}(require("../../../utils/LoadMore.js")), t = getApp(), r = new e.default(), a = require("../../../utils/util.js"); + +Page({ + data: { + url: t.globalData.setting.url, + resourceUrl: t.globalData.setting.resourceUrl, + iurl: t.globalData.setting.imghost, + recharges: null, + currentPage: 1 + }, + onLoad: function() { + r.init(this, "", "recharges"), this.requestChangeList(); + }, + requestChangeList: function() { + var e = this, t = "/api/user/recharge_list/?p=" + e.data.currentPage; + r.request(t, function(t) { + e.data.currentPage++, t.data.result.forEach(function(e, t, r) { + e.cTimeFommat = a.format(e.ctime, "yyyy-MM-dd"); + }), wx.stopPullDownRefresh(); + }); + }, + onReachBottom: function() { + r.canloadMore() && this.requestChangeList(); + }, + onPullDownRefresh: function() { + this.data.recharges = null, this.data.currentPage = 1, r.resetConfig(), this.requestChangeList(); + } +}); \ No newline at end of file diff --git a/pages/user/recharge_list/recharge_list.json b/pages/user/recharge_list/recharge_list.json new file mode 100644 index 0000000..d87067c --- /dev/null +++ b/pages/user/recharge_list/recharge_list.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "充值记录" +} \ No newline at end of file diff --git a/pages/user/recharge_list/recharge_list.wxml b/pages/user/recharge_list/recharge_list.wxml new file mode 100644 index 0000000..a335ac2 --- /dev/null +++ b/pages/user/recharge_list/recharge_list.wxml @@ -0,0 +1,14 @@ + + + 支付方式 + 日期 + 金额 + 状态 + + + {{item.pay_name?item.pay_name:''}} + {{item.cTimeFommat}} + {{item.account}} + {{item.pay_status==0?'待支付':''}}{{item.pay_status==1?'已支付':''}}{{item.pay_status==2?'支付失败':''}} + + diff --git a/pages/user/recharge_list/recharge_list.wxss b/pages/user/recharge_list/recharge_list.wxss new file mode 100644 index 0000000..81addc1 --- /dev/null +++ b/pages/user/recharge_list/recharge_list.wxss @@ -0,0 +1,42 @@ +page { + background-color: white; +} + +.recharge-box { + font-size: 28rpx; + padding: 25rpx 30rpx; + border-bottom: 1rpx solid #f8f8f8; +} + +.recharge-item { + display: inline-block; + word-break: keep-all; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + color: #666666; + box-sizing: border-box; + text-align: center; +} + +.recharge-box .pay { + width: 35%; +} + +.recharge-box .time { + width: 23%; +} + +.recharge-box .price { + width: 20%; +} + +.recharge-box .status { + width: 22%; + color: #e01222; +} + +.recharge-box .title { + color: #666666; + font-size: 32rpx; +} \ No newline at end of file diff --git a/pages/user/return_goods/return_goods.js b/pages/user/return_goods/return_goods.js new file mode 100644 index 0000000..dd02ad0 --- /dev/null +++ b/pages/user/return_goods/return_goods.js @@ -0,0 +1,193 @@ +var t = getApp(), e = t.globalData.setting,os=e,oo=t.globalData, a = t.request, s = require("../../../utils/common.js"), i = require("../../../utils/selectFiles.js"); +var ut = require("../../../utils/util.js"); + +Page({ + data: { + url: e.url, + resourceUrl: e.imghost, + defaultPhoto: e.resourceUrl + "/static/images/camera.png", + filePaths: [], + uploadPath: [], + order: null, + recId: 0, + config: null, + maxWord: 0, + isLongPress: !1, + checkBtns: ["退货退款"], + typeBtnIndex: 0, + applyNum: 1, + isReceive: !1, + causeCont: "注意保持商品的完好,建议您先与卖家沟通", + causeList: [ "订单不能按预计时间送达", "操作有误(商品、地址等选错)", "重复下单/误下单", "其他渠道价格更低", "该商品降价了", "不想买了" ], + checkCauseIndex: -1, + popState: !0, + description: "" + }, + onLoad: function(e) { + var a = this; + this.setData({ + recId: e.rec_id + }), this.requestReturnGoods(e), t.getConfig(function(t) { + a.setData({ + "config.address": t.store_address, + "config.phone": t.store_tel, + }); + }); + }, + requestReturnGoods: function(t) { + var e = this; + a.get("/api/weshop/ordergoods/list", { + failRollback: !0, + data: { + goods_id: t.rec_id, + order_id: t.order_id, + }, + success: function(t) { + console.log('requestReturnGoods'); + console.log(t); + e.setData({ + order: t.data.data.pageData[0], + applyNum: t.data.data.pageData[0].goods_num + }); + } + }); + }, + InputDescription: function(t) { + this.setData({ + maxWord: t.detail.value.length + }), this.data.description = t.detail.value; + }, + selectGoodsStatus: function(t) { + this.setData({ + isReceive: t.currentTarget.dataset.status + }); + }, + selectServiceType: function(t) { + this.setData({ + typeBtnIndex: t.currentTarget.dataset.i + }); + }, + setNum: function(t) { + this.checkApplyNum(Number(t.detail.value)); + }, + subNum: function() { + this.checkApplyNum(this.data.applyNum - 1); + }, + addNum: function() { + this.checkApplyNum(this.data.applyNum + 1); + }, + checkApplyNum: function(t) { + isNaN(t) ? t = this.data.order.goods_num : t < 1 ? t = 1 : t > this.data.order.goods_num && (t = this.data.order.goods_num), + this.setData({ + applyNum: t + }); + }, + openPop: function() { + this.setData({ + popState: !1 + }); + }, + closePop: function() { + this.setData({ + popState: !0 + }); + }, + selectCause: function(t) { + this.setData({ + checkCauseIndex: t.currentTarget.dataset.i, + causeCont: this.data.causeList[t.currentTarget.dataset.i] + }), this.closePop(); + }, + selectPhotos: function(t) { + if (this.isLongPress) this.isLongPress = !1; else { + var e = this; + i.selectPhotos(this.data.filePaths, t.currentTarget.dataset.idx, function(t) { + e.setData({ + filePaths: t + }); + }); + } + }, + removePhoto: function(t) { + var e = this; + this.isLongPress = !0, i.removePhoto(this.data.filePaths, t.currentTarget.dataset.idx, function(t) { + e.setData({ + filePaths: t + }); + }); + }, + + /*-------------提交退款申请--------------*/ + submiApply: function() { + var t = this,th=t; + this.checkSubmit(function() { + t.uploadPhotos(function() { + a.post("/api/weshop/order/returngoods/save", { + /*--- + data: { + rec_id: t.data.recId, + type: t.data.typeBtnIndex, + goods_num: t.data.applyNum, + reason: t.data.causeCont, + describe: t.data.description, + goods_id: t.data.order.goods_id, + order_id: t.data.order.order_id, + order_sn: t.data.order.order_sn, + spec_key: t.data.order.spec_key, + is_receive: Number(t.data.isReceive), + imgs: t.data.uploadPath.join(",") + },---*/ + data: { + order_id: th.data.order.order_id, + order_sn: th.data.order.order_sn, + store_id: os.stoid, + user_id: oo.user_id, + back_money: th.data.order.goods_price * th.data.order.goods_num, + reason: th.data.causeList[th.data.checkCauseIndex], + goods_id: th.data.order.goods_id, + addtime: ut.gettimestamp(), + type:2, + }, + success: function(t) { + wx.showToast({ + title: "提交成功", + mask: !0, + duration: 1e3, + complete: function() { + setTimeout(function() { + wx.navigateBack(); + }, 1e3); + } + }); + } + }); + }); + }); + }, + + /*----上传图片-----*/ + uploadPhotos: function(t, e) { + if (0 == this.data.filePaths.length) return t(); + if ("number" != typeof e) e = 0; else if (e >= this.data.filePaths.length) return t(); + var s = this; + a.uploadFile("/api/order/upload_return_goods_img", { + filePath: s.data.filePaths[e], + name: "return_imgs", + success: function(a) { + s.data.uploadPath[e] = a.data.result, s.uploadPhotos(t, e + 1); + } + }); + }, + + //----检查提交----- + checkSubmit: function(e) { + return this.data.checkCauseIndex < 0 ? t.showWarning("请先选择提交原因") : 0 == this.data.description.length ? t.showWarning("请先填写问题描述") : void e(); + }, + //------图片失败,默认图片--------- + bind_bnerr: function (e) { + var _errImg = e.target.dataset.errorimg; + var _errObj = {}; + _errObj[_errImg] = "public/images/default_goods_image_240.gif"; + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; + }, +}); \ No newline at end of file diff --git a/pages/user/return_goods/return_goods.json b/pages/user/return_goods/return_goods.json new file mode 100644 index 0000000..a639c9a --- /dev/null +++ b/pages/user/return_goods/return_goods.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "申请售后", + "enablePullDownRefresh": false +} \ No newline at end of file diff --git a/pages/user/return_goods/return_goods.wxml b/pages/user/return_goods/return_goods.wxml new file mode 100644 index 0000000..394a0f4 --- /dev/null +++ b/pages/user/return_goods/return_goods.wxml @@ -0,0 +1,81 @@ + + + + + + + {{order.goods_name}} + + 价格:¥{{order.goods_price}} + 数量:×{{order.goods_num}} + + + + + 服务类型 + + {{item}} + + + + 退款金额 + + ¥{{order.goods_price*order.goods_num}} + + + + 提交原因 + {{causeCont}} + + + + + 问题描述 + + {{500-maxWord}}/500 + + + + + + 寄回地址:{{config.address}} + 上班时间:(周一至周五)08:00-19:00 + 客服电话:{{config.phone}} + + + 提 交 + + diff --git a/pages/user/return_goods/return_goods.wxss b/pages/user/return_goods/return_goods.wxss new file mode 100644 index 0000000..cc251e2 --- /dev/null +++ b/pages/user/return_goods/return_goods.wxss @@ -0,0 +1,276 @@ +.goods-mes { + height: 100rpx; + display: flex; + padding: 20rpx 30rpx; + justify-content: space-between; +} + +.goods-img { + width: 100rpx; + height: 100rpx; + overflow: hidden; +} + +.goods-des { + width: 560rpx; +} + +.goods-des>view { + width: 100%; + line-height: 1; + font-size: 30rpx; + color: #444; +} + +.goods-package { + display: flex; + margin-top: 36rpx; +} + +.goods-package>view { + font-size: 24rpx; + color: #777; +} + +.goods-price { + margin-right: 30rpx; +} + +.service { + margin-top: 20rpx; + color: #444; +} + +.service-title { + font-size: 32rpx; + height: 80rpx; + line-height: 80rpx; +} + +.chcek-btns { + display: flex; + padding-bottom: 20rpx; +} + +.chcek-btns>view { + height: 54rpx; + padding: 0 40rpx; + margin-right: 20rpx; + line-height: 54rpx; + border: 1px solid #ccc; + font-size: 30rpx; + border-radius: 8rpx; +} + +.chcek-btns .checkedBtn { + border-color: #e23435; + color: #e23435; +} + +.apply-num { + margin-top: 20rpx; + color: #444; + font-size: 32rpx; + padding: 0 30rpx 20rpx; + background-color: #fff; +} + +.apply-title { + height: 80rpx; + line-height: 80rpx; +} + +.count { + display: flex; + width: 152rpx; + border: 1px solid #ccc; + border-radius: 8rpx; +} + +.count>view,.count>input { + width: 50rpx; + height: 50rpx; + line-height: 50rpx; + text-align: center; +} + +.count>input { + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; +} + +.cause { + display: flex; + padding: 20rpx 30rpx; + margin-top: 20rpx; + background-color: #fff; + line-height: 42rpx; + overflow: hidden; +} + +.cause-title { + font-size: 32rpx; + color: #444; + margin-right: 20rpx; +} + +.cause-cont { + font-size: 28rpx; + color: #777; + width: 540rpx; + height: 42rpx; +} + +.cause-pop { + position: fixed; + z-index: 12; + left: 0; + bottom: 0; + width: 690rpx; + padding: 20rpx 30rpx 50rpx; + color: #777; + font-size: 28rpx; + background-color: #fff; +} + +.close-btn { + position: absolute; + right: 30rpx; + top: 35rpx; + font-size: 40rpx; + width: 50rpx; + height: 50rpx; + line-height: 50rpx; + text-align: center; + color: #444; +} + +.pop-title { + height: 72rpx; + line-height: 72rpx; + text-align: center; + color: #444; +} + +.cause-item { + display: flex; + align-items: center; + height: 60rpx; + margin: 10rpx 0; +} + +.cause-item>icon { + margin-right: 20rpx; +} + +.receiving-wrap { + padding: 20rpx 30rpx; + margin-top: 20rpx; + background-color: #fff; +} + +.receiving-title { + line-height: 60rpx; + font-size: 32rpx; + color: #444; +} + +.receiving-status { + display: flex; +} + +.receiving { + height: 60rpx; + display: flex; + align-items: center; + font-size: 30rpx; + color: #777; + margin-right: 30rpx; +} + +.receiving>icon { + margin-right: 20rpx; +} + +.evaluation { + padding: 30rpx 30rpx; + margin-top: 20rpx; + position: relative; + font-size: 28rpx; + background-color: #fff; +} + +.evaluation-title { + margin-bottom: 20rpx; + line-height: 50rpx; + font-size: 32rpx; + color: #444; + border-bottom: 1px solid #ddd; +} + +.word-box { + color: #444; + line-height: 40rpx; + width: 100%; + height: 200rpx; +} + +.words-num { + position: absolute; + right: 30rpx; + bottom: 30rpx; + color: #777; +} + +.upload-img { + padding: 20rpx 30rpx; + margin-top: 20rpx; + background-color: #fff; +} + +.upload-title { + line-height: 60rpx; + font-size: 32rpx; + color: #444; +} + +.pic-list { + display: flex; + padding: 20rpx 0; + justify-content: space-around; +} + +.share-pic { + width: 126rpx; + height: 126rpx; + border: 1px solid #ddd; + overflow: hidden; +} + +.upload-tips { + font-size: 28rpx; + color: #777; + line-height: 40rpx; +} + +.contact { + margin-top: 20rpx; + line-height: 72rpx; + font-size: 32rpx; + color: #444; +} + +.btn-wrap { + padding: 20rpx 0; +} + +.submit-btn { + width: 320rpx; + height: 80rpx; + line-height: 80rpx; + text-align: center; + background-color: #f15353; + color: #fff; + margin: auto; +} +.cred{color: #f15353} \ No newline at end of file diff --git a/pages/user/return_goods_info/return_goods_info.js b/pages/user/return_goods_info/return_goods_info.js new file mode 100644 index 0000000..8c1ff7f --- /dev/null +++ b/pages/user/return_goods_info/return_goods_info.js @@ -0,0 +1,157 @@ +var e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { + return typeof e; +} : function(e) { + return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; +}, t = getApp(), r = t.globalData.setting,oo=t.globalData,os=oo.setting, + o = t.request,rq=o, s = require("../../../utils/util.js"); + +Page({ + data: { + url: r.url, + resourceUrl: r.imghost, + return_goods: null, + goods: null + }, + onLoad: function(e) { + if (e.order_id!=undefined){ + this.getreturn(e.order_id, e.goods_id); + }else{ + this.requestReturnGoods(e.id); + } + }, + //获取--return_goods--- + getreturn(a,b){ + var th=this,data=null; + if (b == undefined) { data = { order_id: a, store_id: os.stoid};} + else data = { order_id: a, goods_id: b, store_id: os.stoid}; + rq.get('/api/weshop/order/returngoods/page',{ + data:data, + success:function(dda){ + var item=dda.data.data.pageData[0]; + th.requestReturnGoods(null, item); + } + }) + }, + + //获取--详细内容--- + requestReturnGoods: function(t,b) { + var r = this, th = r; + if(b!=undefined){ + console.log("requestReturnGoods"); + console.log(b); + var o = b, odata = o; + o.addTimeFormat = s.format(o.addtime), "object" == e(o.seller_delivery) && "number" == typeof o.seller_delivery.express_time && (o.seller_delivery.expressTimeFormat = s.format(o.seller_delivery.express_time)), + r.setData({ + return_goods: o, + }); + var arr = new Array(); + if (odata.goods_id == 0) { + var gidlist = odata.goods_id_list.split(","); + for (var i = 0; i < gidlist.length; i++) { + //------读取商品--------- + rq.get("/api/weshop/goods/get/" + os.stoid + "/" + gidlist[i], { + success: function (ed) { + if (odata.goodslist != undefined) { + odata.goodslist.push(ed.data.data); + } else { + arr.push(ed.data.data); + odata.goodslist = arr; + } + th.setData({ return_goods: odata }); + } + }) + } + } else { + //------读取商品--------- + rq.get("/api/weshop/goods/get/" + os.stoid + "/" + odata.goods_id, { + success: function (ed) { + arr.push(ed.data.data); + odata.goodslist = arr; + th.setData({ return_goods: odata }); + } + }) + } + }else{ + rq.get("/api/weshop/order/returngoods/get/"+os.stoid+"/"+t, { + success: function(t) { + console.log("requestReturnGoods"); + console.log(t); + var o = t.data.data,odata=o; + o.addTimeFormat = s.format(o.addtime), "object" == e(o.seller_delivery) && "number" == typeof o.seller_delivery.express_time && (o.seller_delivery.expressTimeFormat = s.format(o.seller_delivery.express_time)), + r.setData({ + return_goods: o, + }); + + var arr = new Array(); + if (odata.goods_id == 0) { + var gidlist = odata.goods_id_list.split(","); + for (var i = 0; i < gidlist.length; i++) { + //------读取商品--------- + rq.get("/api/weshop/ordergoods/list?store_id=" + os.stoid + "&goods_id=" + gidlist[i], { + success: function (ed) { + if (odata.goodslist != undefined) { + odata.goodslist.push(ed.data.data.pageData[0]); + } else { + arr.push(ed.data.data.pageData[0]); + odata.goodslist = arr; + } + th.setData({ return_goods: odata }); + } + }) + } + } else { + //------读取商品--------- + rq.get("/api/weshop/ordergoods/list?store_id=" + os.stoid + "&goods_id=" + odata.goods_id, { + success: function (ed) { + arr.push(ed.data.data.pageData[0]); + odata.goodslist = arr; + th.setData({ return_goods: odata }); + } + }) + } + } + }); + } + }, + receiveOrder: function() { + var e = this, t = this.data.return_goods.id; + wx.showModal({ + title: "确定已收货?", + success: function(r) { + r.confirm && o.post("/api/order/receiveConfirm", { + data: { + return_id: t + }, + success: function(r) { + wx.setStorageSync("user:return_goods_list:update", !0), e.requestReturnGoods(t); + } + }); + } + }); + }, + cancelReturn: function() { + var e = this, t = this.data.return_goods.id; + wx.showModal({ + title: "确定取消售后服务?", + success: function(r) { + r.confirm && o.post("/api/order/return_goods_cancel", { + data: { + id: t + }, + success: function(r) { + wx.setStorageSync("user:return_goods_list:update", !0), e.requestReturnGoods(t); + } + }); + } + }); + }, + previewImgs: function(e) { + var t = this, r = this.data.return_goods.imgs; + r = r.map(function(e) { + return t.data.url + e; + }), wx.previewImage({ + current: r[e.currentTarget.dataset.idx], + urls: r + }); + } +}); \ No newline at end of file diff --git a/pages/user/return_goods_info/return_goods_info.json b/pages/user/return_goods_info/return_goods_info.json new file mode 100644 index 0000000..dbd6ba3 --- /dev/null +++ b/pages/user/return_goods_info/return_goods_info.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "申请服务详情", + "enablePullDownRefresh": false +} \ No newline at end of file diff --git a/pages/user/return_goods_info/return_goods_info.wxml b/pages/user/return_goods_info/return_goods_info.wxml new file mode 100644 index 0000000..4a76fb9 --- /dev/null +++ b/pages/user/return_goods_info/return_goods_info.wxml @@ -0,0 +1,65 @@ + + + 订单编号:{{return_goods.order_sn}} + 申请时间:{{return_goods.addTimeFormat}} + + + + + + + + {{item.goods_name}} + 退款金额 : ¥{{return_goods.back_money}} + + + + + 售后信息 + + 已申请成功,待售后审核中 + 处理中 + 退款完成 + 卖家已经拒绝退款 + + + + 处理方式 + 期望处理方式“{{return_goods.type==0?'退货':return_goods.type==1?'换货':'退款'}}” + + + 问题描述 + {{return_goods.reason}} + + + 售后备注 + {{return_goods.remark}} + + + 问题图片 + + + + + + + + + 您的服务单已申请成功,等待售后审核中 + {{return_goods.addTimeFormat}} + 操作人:系统 + + + 亲爱的客户,您的服务正在处理中 + 操作人:卖家 + + + 亲爱的客户,您的服务单已完成 + 操作人:卖家 + + + 亲爱的客户,商家已经拒绝退款 + 操作人:卖家 + + + diff --git a/pages/user/return_goods_info/return_goods_info.wxss b/pages/user/return_goods_info/return_goods_info.wxss new file mode 100644 index 0000000..36eeef8 --- /dev/null +++ b/pages/user/return_goods_info/return_goods_info.wxss @@ -0,0 +1,145 @@ +.order-mes { + padding: 10rpx 30rpx; + background-color: #fff; +} + +.order-mes .order-name { + height: 54rpx; + line-height: 54rpx; + font-size: 30rpx; + color: #777; + width: 500rpx; + display: inline-block; +} + +.order-name view { + word-break: keep-all; + white-space: nowrap; + overflow: hidden; + width:680rpx; +} + +.apply-btn { + width: 150rpx; + float: right; + margin-top: 20rpx; +} + +.goods-mes { + padding: 10rpx 30rpx; + background-color: #fff; + display: flex; + justify-content: space-between; +} + +.goods-pic { + width: 180rpx; + height: 180rpx; +} + +.goods-des { + width: 490rpx; + font-size: 30rpx; +} + +.goods-name { + width: 100%; + height: 30rpx; + color: #444; + line-height: 1; + margin-bottom: 20rpx; +} + +.apply-mes { + padding: 30rpx; +} + +.apply-item { + display: flex; + height: 60rpx; + line-height: 60rpx; + font-size: 28rpx; + overflow: hidden; + color: #777; +} + +.apply-til { + color: #444; + margin-right: 40rpx; +} + +.apply-state { + margin-top: 20rpx; + background-color: #fff; + padding-left: 50rpx; + padding-top: 80rpx; +} + +.img-title { + position: relative; + border-top: 1rpx solid #dedede; + margin-top: 40rpx; + text-align: center; +} + +.img-title view { + position: relative; + top: -28rpx; + font-size: 28rpx; + color: #666666; + display: inline; + background: white; + padding: 0 5rpx; +} + +.img-box { + display: inline-block; +} + +.img-box image { + height: 120rpx; + width: 120rpx; + padding: 8rpx; +} + +.state-item { + border-left: 1px solid #ccc; + padding-left: 40rpx; +} + +.item-wrap { + position: relative; + margin-bottom: 80rpx; + padding-bottom: 50rpx; + border-bottom: 1px solid #eee; + font-size: 24rpx; + color: #aaa; + line-height: 1; +} + +.item-wrap::before { + content: ''; + position: absolute; + left: -61rpx; + top: 0; + width: 26rpx; + height: 26rpx; + border-radius: 50%; + background-color: #e23435; + border: 4px solid #ed8182; +} + +.state-title { + font-size: 28rpx; + font-weight: bold; + color: #666; + padding-bottom: 20rpx; +} + +.state-title view { + font-weight: normal; +} + +.state-time { + padding-bottom: 20rpx; +} diff --git a/pages/user/return_goods_list/return_goods_list.js b/pages/user/return_goods_list/return_goods_list.js new file mode 100644 index 0000000..ee65f6c --- /dev/null +++ b/pages/user/return_goods_list/return_goods_list.js @@ -0,0 +1,110 @@ +var t = function(t) { + return t && t.__esModule ? t : { + default: t + }; +}(require("../../../utils/LoadMore.js")), e = getApp(),oo=e.globalData,os=oo.setting, + r = e.request,rq=r, s = new t.default(), o = require("../../../utils/util.js"); + +Page({ + data: { + url: e.globalData.setting.url, + resourceUrl: e.globalData.setting.imghost, + iurl: e.globalData.setting.imghost, + list: null, + currentPage: 1 + }, + onLoad: function() { + var th=this,ts=s; + //确保有登陆 + e.getUserInfo(function(){ + ts.init(th, "", "list"), th.requestReturnGoods(); + }) + + }, + onShow: function() { + wx.getStorageSync("user:return_goods_list:update") && (wx.setStorageSync("user:return_goods_list:update", !1), + this.resetData(), this.requestReturnGoods()); + }, + onPullDownRefresh: function() { + this.resetData(), this.requestReturnGoods(); + }, + onReachBottom: function() { + s.canloadMore() && this.requestReturnGoods(); + }, + //----------读取退款退货------------ + requestReturnGoods: function() { + var t = this, th=t,er = t.data.url + "/api/weshop/order/returngoods/page?page=" + t.data.currentPage; + s.request(er, function(e) { + t.data.currentPage++, th.data.list.forEach(function(t, ind, r) { + t.addTimeFommat = o.formatTime(t.addtime); + //-----判断是商品列表是否已经装载------ + if(t.goodslist==undefined){ + var arr=new Array(); + if (t.goods_id==0){ + var gidlist = t.goods_id_list.split(","); + for (var i = 0; i < gidlist.length;i++){ + //------读取商品--------- + rq.get("/api/weshop/goods/get/" + os.stoid + "/" + gidlist[i], { + success: function (ed) { + if (th.data.list[ind].goodslist != undefined){ + th.data.list[ind].goodslist.push(ed.data.data); + }else{ + arr.push(ed.data.data); + th.data.list[ind].goodslist = arr; + } + th.setData({ list: th.data.list }); + } + }) + } + }else{ + //------读取商品--------- + rq.get("/api/weshop/goods/get/" + os.stoid + "/" + t.goods_id,{ + success:function(ed){ + arr.push(ed.data.data); + th.data.list[ind].goodslist=arr; + th.setData({ list: th.data.list}); + } + }) + } + } + } + ), wx.stopPullDownRefresh(); + }, null, { store_id: os.stoid, user_id: oo.user_id} + ); + }, + resetData: function() { + this.data.currentPage = 1, this.data.list = null, s.resetConfig(); + }, + receiveOrder: function(t) { + var e = this, s = t.currentTarget.dataset.id; + wx.showModal({ + title: "确定已收货?", + success: function(t) { + t.confirm && r.post("/api/order/receiveConfirm", { + data: { + return_id: s + }, + success: function(t) { + e.resetData(), e.requestReturnGoods(); + } + }); + } + }); + }, + cancelReturn: function(t) { + var e = this, s = t.currentTarget.dataset.id; + wx.showModal({ + title: "确定取消售后服务?", + success: function(t) { + t.confirm && r.post("/api/order/return_goods_cancel", { + data: { + id: s + }, + success: function(t) { + e.resetData(), e.requestReturnGoods(); + } + }); + } + }); + } +}); \ No newline at end of file diff --git a/pages/user/return_goods_list/return_goods_list.json b/pages/user/return_goods_list/return_goods_list.json new file mode 100644 index 0000000..07f1384 --- /dev/null +++ b/pages/user/return_goods_list/return_goods_list.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "退换货" +} \ No newline at end of file diff --git a/pages/user/return_goods_list/return_goods_list.wxml b/pages/user/return_goods_list/return_goods_list.wxml new file mode 100644 index 0000000..9de6122 --- /dev/null +++ b/pages/user/return_goods_list/return_goods_list.wxml @@ -0,0 +1,29 @@ + + + + 订单号:{{item.order_sn}} + + + 已申请成功,待售后审核中 + 处理中 + 退款完成 + 卖家已经拒绝退款 + + + + + + {{goods.goods_name}} + 申请时间:{{item.addTimeFommat}} + + + 进度查询 + + + + + + 没有找到相关的记录 + 去逛逛 + + diff --git a/pages/user/return_goods_list/return_goods_list.wxss b/pages/user/return_goods_list/return_goods_list.wxss new file mode 100644 index 0000000..40fca37 --- /dev/null +++ b/pages/user/return_goods_list/return_goods_list.wxss @@ -0,0 +1,58 @@ +.return-box { + background-color: white; + margin-bottom: 20rpx; + font-size: 30rpx; +} + +.item { + padding: 20rpx 25rpx; + border-bottom: 3rpx #f8f8f8 solid; +} + +.state { + color: red; + float: right; +} + +.arrow { + margin-top: 5rpx; + width: 25rpx; + height: 28rpx; + float: right; +} + +.return-goods { + height: 100rpx; +} + +.goods_img { + height: 100rpx; + width: 100rpx; + float: left; +} + +.goods-desc { + padding-left: 30rpx; + width: 570rpx; + float: left; +} + +.goods-name { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + padding-bottom: 35rpx; +} + +.apply-time { + font-size: 26rpx; + color: #999999; +} + +.return-btn { + float: right; + border: 1rpx #aaaaaa solid; + padding: 8rpx; + border-radius: 3rpx; + margin: 20rpx 25rpx; +} \ No newline at end of file diff --git a/pages/user/user_coupon/c_filter.wxs b/pages/user/user_coupon/c_filter.wxs new file mode 100644 index 0000000..b1d896d --- /dev/null +++ b/pages/user/user_coupon/c_filter.wxs @@ -0,0 +1,63 @@ +var filters = { + toFix:function(val,count){ + return val.toFixed(count) + }, + format_time:function(ts,isFull) { + var d = getDate(ts*1000) + var fm=[d.getFullYear(), d.getMonth()+1, d.getDate()].join('-'); + if(isFull==1) + fm=fm + ' '+ [d.getHours(), d.getMinutes(), d.getSeconds()].join(':') + return fm; + }, + setcolor:function(ind){ + if(ind==0) return "red"; + if(ind==1) return "green"; + if(ind==2) return "blue"; + if(ind==11) return "green"; + if(ind==12) return "blue"; + return ""; + }, + setbgcolor: function (ind) { + if (ind == 0) return "#ffa1b9"; + if (ind == 1) return "#59e1d2"; + if (ind == 2) return "#a3bcff"; + if (ind == 11) return "#59e1d2"; + if (ind == 12) return "#a3bcff"; + return ""; + }, + + get_type:function(ind){ + if (ind == 0) return "全场通用"; + if (ind == 1) return "品牌"; + if (ind == 2) return "品类"; + if (ind == 11) return "用途"; + if (ind == 12) return "分类1"; + return ""; + }, + get_type_card:function(ind){ + if (ind == 0) return "全场通用"; + if (ind == 1) return "指定品牌"; + if (ind == 2) return "指定品类"; + if (ind == 11) return "指定用途"; + if (ind == 12) return "指定分类1"; + return ""; + }, + format_huiche:function (text) { + if (!text) { + return ""; + } + var reg = getRegExp('\\\\n', 'g') + return text.replace(reg, '\n') + } +} + +module.exports = { + toFix: filters.toFix, + format_time:filters.format_time, + setcolor:filters.setcolor, + setbgcolor: filters.setbgcolor, + get_type: filters.get_type, + get_split_name: filters.get_split_name, + get_type_card: filters.get_type_card, + format_huiche: filters.format_huiche, +} \ No newline at end of file diff --git a/pages/user/user_coupon/filter.wxs b/pages/user/user_coupon/filter.wxs new file mode 100644 index 0000000..c0e8d13 --- /dev/null +++ b/pages/user/user_coupon/filter.wxs @@ -0,0 +1,11 @@ +var format = function (text) { + if (!text) { + return + } + var reg = getRegExp('\\\\n', 'g') + return text.replace(reg, '\n') +} + +module.exports = { + format: format +} diff --git a/pages/user/user_coupon/user_coupon.js b/pages/user/user_coupon/user_coupon.js new file mode 100644 index 0000000..cb47790 --- /dev/null +++ b/pages/user/user_coupon/user_coupon.js @@ -0,0 +1,160 @@ +// pages/user/user_coupon/user_coupon.js +var e = getApp(),os = e.globalData.setting; +var utils = require('../../../utils/util.js'); +var regeneratorRuntime = require('../../../utils/runtime.js'); + +Page({ + /** + * 页面的初始数据 + */ + data: { + judge:0, + quan_list:null, + iurl:os.imghost, + h_pic:null, + GradeId:null, + FormId:null, + now:'', + }, + clik_coupon:function(){ + this.setData({ + judge:1 + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + console.log("onLoad"); + console.log(options); + var h_pic=options.img; + + if(h_pic.indexOf("http")==-1){ + h_pic= os.imghost+h_pic; + } + + var FormId=options.FormId; + var GradeId=options.gradeId; + var now=utils.gettimestamp(); + this.setData({h_pic:h_pic,GradeId:GradeId,FormId:FormId,now:now}); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow:async function () { + var th = this,q_list=null; + + //--获取列表-- + await getApp().request.promiseGet("/api/weshop/users/grade/wechat/cash/page", { + data:{ storeId:os.stoid,FormId:th.data.FormId,GradeId:th.data.GradeId,userId:getApp().globalData.user_id} + }).then(res => { + q_list = res.data.data.pageData; + }) + //取分类最后一级 + for(var i in q_list){ + var name=q_list[i].UseObjectName; + var arr=name.split("\\") + q_list[i].UseObjectName=arr[arr.length-1]; + q_list[i].Remark = q_list[i].Remark.replace(/\n/g, "\n") + } + th.setData({quan_list:q_list}); + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + //获取券 + get_quan:function (e) { + var th=this,index=e.currentTarget.dataset.ind; + var item = this.data.quan_list[index]; + var can_get = item.ObtainTimes; + var Obtain = item.Obtain; + var Id = item.Id; + + if (!Obtain || Obtain == undefined) Obtain = 0; + + getApp().request.post("/api/weshop/users/grade/cash/insert",{ + data:{ + privilegeId:Id, + storeId:os.stoid, + userId:getApp().globalData.user_id, + }, + success:function (e) { + if(e.data.code==0){ + var txt="quan_list["+index+"].ObtainTimes" + var obj={};obj[txt]=can_get-1; + + var text = "quan_list[" + index + "].Obtain"; Obtain++; + obj[text] = Obtain; + th.setData(obj); + getApp().my_warnning("您已成功领取该券",1,th); + } + } + }) + }, + + //点击核销券 + get_out:function (e) { + var qt_txt = this.selectComponent("#pop_txt"); //组件的id + var ob={title:"温馨提示",content:"当前优惠券已领取,点击二维码可立即使用"}; + qt_txt.open(ob); + + }, + + clik_coupon:function (e) { + var ind=e.currentTarget.dataset.ind; + var is_open=this.data.quan_list[ind].is_open; + if(is_open==1) is_open=0; + else is_open=1; + + var txt="quan_list["+ind+"].is_open" + var obj={};obj[txt]=is_open; + this.setData(obj); + }, + + //--显示核销券-- + show_quan:function (e) { + var ind=e.currentTarget.dataset.ind; + var item=this.data.quan_list[ind]; + var pId=this.data.quan_list[ind].Id; + var th=this; + var validay = item.Validay; + var now = e.currentTarget.dataset.now; + + getApp().request.get("/api/weshop/users/grade/cash/code/get",{ + data:{ + storeId:os.stoid, + privilegeId:pId, + userId:getApp().globalData.user_id, + }, + success:function (e) { + console.log(e); + console.log('/code/get'); + var name= e.data.data.UseObjectName; + + //--获取成功的时候-- + if(e.data.code==0){ + var no=e.data.data.CashRepNo; + var qc_com = th.selectComponent("#qc_com"); //组件的id + var obj={val:no,content:"请将二维码展示给核销员,抵券更快捷",now: now, validay: validay, name: name,is_quan:1}; + qc_com.open(obj) + + }else{ + var qt_txt = this.selectComponent("#pop_txt"); //组件的id + var ob={title:"温馨提示",content:"您暂时还没有该券"}; + qt_txt.open(ob); + } + + } + }) + + + } + +}) \ No newline at end of file diff --git a/pages/user/user_coupon/user_coupon.json b/pages/user/user_coupon/user_coupon.json new file mode 100644 index 0000000..31d3bbc --- /dev/null +++ b/pages/user/user_coupon/user_coupon.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "我的优惠券", + "usingComponents": { + "qr_code": "/components/qr_code/qr_code", + "pop_txt": "/components/userqy_pop_up/userqy_pop_up", + "warn": "/components/long_warn/long_warn" + } +} \ No newline at end of file diff --git a/pages/user/user_coupon/user_coupon.wxml b/pages/user/user_coupon/user_coupon.wxml new file mode 100644 index 0000000..0c92b07 --- /dev/null +++ b/pages/user/user_coupon/user_coupon.wxml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x{{item.ObtainTimes}} + + + + + + {{item.CashSum}} + + + + 无使用门槛 + + + 满{{item.BuySum}}元可用 + + + + + + + + + + + + + + + {{filter.get_type_card(item.UseObjectType)}} + + {{item.PrivilegeName}} + + + + {{filter.format_time(now)}}至{{item.Validay}} + + + + + + + + + + + 立即领取 + 已领取 + + + + + 优惠券使用说明 + + + + + + + + + + + {{util.format(item.Remark)}} + + + + + + + + + + + + + + + + + + + diff --git a/pages/user/user_coupon/user_coupon.wxss b/pages/user/user_coupon/user_coupon.wxss new file mode 100644 index 0000000..53b47d6 --- /dev/null +++ b/pages/user/user_coupon/user_coupon.wxss @@ -0,0 +1,181 @@ +.xc-coupon-img{ + width: 100%; + height: 330rpx; +} +.xc-coupon-frame{ + width: 710rpx; + height:auto; + margin: 0 auto; + +} +.xc-coupon-frame .coupon-frame{ + width: 100%; + height: 200rpx; + margin-top:10rpx; + +} +.xc-coupon-frame .coupon-frame .coupon-left{ + width: 215rpx; + height:100%; + overflow: hidden; +} +.xc-money-frame{ + width:96%; + margin-top: -10px; +} + +.xc-rmb-symbol{ + font-size:36rpx; + font-weight: bold +} + +.xc-rmb-val{ + font-size:78rpx; + font-weight: bolder +} +.coupon-explain{ + font-size:25rpx; +width:100%; + + +} +.xc-valuer{ + margin-top:39rpx; + margin-left:28rpx; + font-size:25rpx; +} +.coupon-frame .oval{ + width:155rpx; + height:83rpx; + border-radius: 50%; + right:-78rpx; + top:-37rpx; +} +.coupon-right{ + width:490rpx; + height: 99%; + border-top: 1rpx solid #eaeaea; + border-bottom: 1rpx solid #eaeaea; + border-right: 1rpx solid #eaeaea; + +} +.coupon-annotation{ + width: 95%; + height: 100%; + +} +.xc-brand{ + width:100rpx; + height:35rpx; + line-height: 35rpx; + font-size:21rpx; + border-radius:10rpx; position: relative; top:-1px; +} +.top-frame{ + width:82%; + height: 75rpx; + margin-top:10rpx; + +} +.top-frame .coupon-wode{ + font-size: 25rpx; + margin-left:10rpx; + width:340rpx; + height:88rpx; +} +.coupon-code{ + width:60rpx; + height:60rpx; + margin-top:5rpx; + +} +.frame{ + width: 100% +} +.coupon-time{ + font-size: 23rpx; + line-height:33rpx; + color: #7d7d7d; +} + +.clik-get{ + width:125rpx; + height:45rpx; + border-radius: 25rpx; + line-height: 45rpx; + font-size:25rpx; + bottom:67rpx; + right:6px; +} + +.code-img{ + margin-left:20rpx; +} +.bottmo-explain{ +top:145rpx; +width:94%; +border-top:1rpx dashed #eee; +padding-top:8rpx; +height:38rpx; +line-height: 51rpx; + +} +.font-word{ + font-size: 22rpx; +} +.circle-size{ + background: #a0a0a0; + width: 26rpx; + height: 26rpx; + margin-top:13rpx; +margin-left:8rpx; + + +} +.xc-jiantou{ + width: 10rpx; + height: 10rpx; + border-top: 2rpx solid #fff; + border-right: 2rpx solid #fff; + transform: rotate(133deg); + display:inline-block; + margin-left: 8rpx; + margin-top:6rpx; + +} +.xc-buttom{ + width:700rpx; +min-height:76rpx; +height:auto; +line-height:40rpx; +border-left:1rpx solid #eee; +border-right:1rpx solid #eee; +border-bottom:1rpx solid #eee; +margin:0 0rpx 0 22rpx; + + +} +.explain-coupon{ + + font-size:25rpx; + +} +.circle-frame{ + width: 20rpx; + height: auto; + z-index:1; + left:210rpx; + +} +.circle-sawtooth{ + width: 11rpx; + height: 11rpx; + background: #fff; +} + +.red{background-color: #fe7496;} +.green{ background-color: #22c7c1;} +.blue{background-color:#5e82e3;} +.g_gray{background-color: #aaaaaa} + +.f_text{text-align: center; height:96rpx; } \ No newline at end of file diff --git a/pages/user/user_fw/user_fw.js b/pages/user/user_fw/user_fw.js new file mode 100644 index 0000000..d4fb82f --- /dev/null +++ b/pages/user/user_fw/user_fw.js @@ -0,0 +1,87 @@ +// pages/user/userfw/userfw.js +var e = getApp(),os = e.globalData.setting; +var utils = require('../../../utils/util.js'); +var regeneratorRuntime = require('../../../utils/runtime.js'); + +Page({ + /** + * 页面的初始数据 + */ + data: { + qr_code_object:{val:"12121",content:"请将二维码展示给核销员,服务更快捷!"}, + fw_list:null, + iurl:os.imghost, + userinfo:null, + GradeId:null, + FormId:null, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var FormId=options.FormId; + var GradeId=options.gradeId; + var userinfo=getApp().globalData.userInfo; + if(userinfo==null){ + //界面必须使用warn 做ID,并调用 + getApp().my_warnning("会员为空",0,this); + return false; + } + + this.setData({GradeId:GradeId,FormId:FormId,userinfo:userinfo}); + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow: async function () { + var th = this; + var fw_list=null; + //--获取列表-- + await getApp().request.promiseGet("/api/weshop/users/grade/wechat/sm/page", { + data:{ storeId:os.stoid,FormId:th.data.FormId,GradeId:th.data.GradeId,userId:getApp().globalData.user_id} + }).then(res => { + fw_list = res.data.data.pageData; + }) + + th.setData({fw_list:fw_list}); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /*-- 打开服务项目 --*/ + open_fw:function (e) { + var th=this; + var ind=e.currentTarget.dataset.ind; + var item= this.data.fw_list[ind]; + + //小于0要提示 + if(item.ObtainTimes<=0){ + getApp().my_warnning("该服务已经使用完",0,th); + return false; + } + + var ewm="^"+this.data.userinfo.erpvipid+"|"+item.Id+"|TY01|"; + var tt=this.format_time(1); + ewm=ewm+tt; + th.data.qr_code_object.val=ewm; + th.data.qr_code_object.is_fw=1; + var qc_com = this.selectComponent("#qc_com"); //组件的id + qc_com.open(th.data.qr_code_object) + }, + + format_time:function(isFull) { + var d = new Date(); + var m = d.getMonth() + 1; if(m<10) m="0"+m; + var dd = d.getDate(); if (dd < 10) dd = "0" + dd; + var fm=[d.getFullYear(),m,dd ].join('-'); + if(isFull==1) + fm=fm + ' '+ [d.getHours(), d.getMinutes(), d.getSeconds()].join(':') + return fm; + }, +}) \ No newline at end of file diff --git a/pages/user/user_fw/user_fw.json b/pages/user/user_fw/user_fw.json new file mode 100644 index 0000000..88d15ea --- /dev/null +++ b/pages/user/user_fw/user_fw.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "服务项目", + "usingComponents": { + "qr_code": "/components/qr_code/qr_code", + "warn": "/components/long_warn/long_warn" + } +} \ No newline at end of file diff --git a/pages/user/user_fw/user_fw.wxml b/pages/user/user_fw/user_fw.wxml new file mode 100644 index 0000000..838b119 --- /dev/null +++ b/pages/user/user_fw/user_fw.wxml @@ -0,0 +1,17 @@ + + + + + {{item.PrivilegeName}} + 剩余次数:{{item.ObtainTimes}} + + 有效日期至 {{item.Validay}} + + 立即使用 + 立即使用 + + + + + \ No newline at end of file diff --git a/pages/user/user_fw/user_fw.wxss b/pages/user/user_fw/user_fw.wxss new file mode 100644 index 0000000..ce0532e --- /dev/null +++ b/pages/user/user_fw/user_fw.wxss @@ -0,0 +1,56 @@ +.xc-page{ + width: 100%; + height: 100%; +} +.xc-page .items{ + display: inline-block; + width: 43%; + height:396rpx; + margin-left: 33rpx; + border:2rpx solid #d8d8d8; + box-shadow:10rpx 10rpx 20rpx 6rpx #eee; + margin-top: 33rpx; + border-radius: 20rpx; + padding-top: 30rpx; +} +.xc-page .items .items-img{ + width: 112rpx; + height: 112rpx; + +} +.xc-page .items .items-name{ + font-weight:600; + height:90rpx; +padding:0 16rpx; +} +.xc-page .items .items-frequency{ + margin-top:15rpx; + color:#adadad; +} +.xc-page .items .items-time{ + color:#adadad; + margin-top:6rpx +} +.xc-page .items .items-use{ + border-radius:25rpx; + width: 144rpx; + height: 41rpx; + margin-left:85rpx; + margin-top:35rpx; + line-height:41rpx; +font-size: 22rpx; + +} +.on{ + background: #fe658b; +} +.sn{ + background: #c9c9c9; +} + +.three-level-word{ + font-size:32rpx; +} +.four-level-word{ + font-size:27rpx; +} \ No newline at end of file diff --git a/pages/user/user_spsy/user_spsy.js b/pages/user/user_spsy/user_spsy.js new file mode 100644 index 0000000..e43903d --- /dev/null +++ b/pages/user/user_spsy/user_spsy.js @@ -0,0 +1,71 @@ +// pages/user/usersy/usersy.js +var e = getApp(),os = e.globalData.setting; +var utils = require('../../../utils/util.js'); +var regeneratorRuntime = require('../../../utils/runtime.js'); + +Page({ + /** + * 页面的初始数据 + */ + data: { + qr_code_object:{val:"12121",content:"请将二维码展示给核销员,取货更快捷!"}, + xp_list:null, + iurl:os.imghost, + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { }, + /** + * 生命周期函数--监听页面显示 + */ + onShow:async function () { + var th = this; + var xp_list=null; + //--获取列表-- + await getApp().request.promiseGet("http://172.20.3.102:8080/api/user_qy/xp_list", { + 1: 1 + }).then(res => { + xp_list = res.data; + }) + th.setData({xp_list:xp_list}); + }, + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + + + /*-- 打开服务项目 --*/ + open_xp:function (e) { + var th=this; + var qc_com = this.selectComponent("#qc_com"); //组件的id + qc_com.open(th.data.qr_code_object) + }, + + //--领取商品-- + get_xp:function (e) { + var th=this,index=e.currentTarget.dataset.ind; + getApp().request.post("http://172.20.3.102:8080/api/user_qy/get_gd",{ + data:{}, + success:function (e) { + if(e.data.code==0){ + var txt="xp_list["+index+"].is_get" + var obj={};obj[txt]=1; + th.setData(obj); + } + } + }) + } + + +}) \ No newline at end of file diff --git a/pages/user/user_spsy/user_spsy.json b/pages/user/user_spsy/user_spsy.json new file mode 100644 index 0000000..468dc50 --- /dev/null +++ b/pages/user/user_spsy/user_spsy.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "新品试用", + "usingComponents": { + "qr_code": "/components/qr_code/qr_code" + } +} \ No newline at end of file diff --git a/pages/user/user_spsy/user_spsy.wxml b/pages/user/user_spsy/user_spsy.wxml new file mode 100644 index 0000000..1fb85c4 --- /dev/null +++ b/pages/user/user_spsy/user_spsy.wxml @@ -0,0 +1,28 @@ + + + + + + + + {{item.goods_name}} + + ¥ + + + {{item.goods_price}} + + 立即使用 + 免费领取 + + + + + + + + + + + + diff --git a/pages/user/user_spsy/user_spsy.wxss b/pages/user/user_spsy/user_spsy.wxss new file mode 100644 index 0000000..ec604ef --- /dev/null +++ b/pages/user/user_spsy/user_spsy.wxss @@ -0,0 +1,68 @@ +page{ + width: 100%; + height: 100%; + background:#f4f5fa; +} +.xc-page{ + width: 100%; + height: 100%; + background: #f4f5fa; +} +.xc-page .items{ + display: inline-block; + width: 345rpx; + height:450rpx; + margin-left:20rpx; + margin-top: 25rpx; + border-radius: 15rpx; + background:#fff; +} + +.xc-page .items .zimg{ + width: 120rpx; + height: 120rpx; + left:50%; top:50%; + margin-left: -60rpx; margin-top: -60rpx; +} + + +.new-product{ + width:345rpx; + height:325rpx; + border-radius:15rpx 15rpx 0 0; +} +.product-explain{ + width: 90%; + word-break:break-all; + height: 40rpx; + margin-left:15rpx; + +} +.xc-bottom{ + margin-top: 13rpx; + width: 100%; + margin-left: 15rpx; +} + +.xc-bottom .xc-goods-money{ +color: #ca4e59; + padding-top: 12rpx; +} +.xc-bottom .xc-money{ + color: #ca4e59; + font-size: 40rpx; + height: 100%; + line-height:50rpx +} + +.xc-clike-get{ + width: 120rpx; + height: 36rpx; + border-radius: 20rpx; + background: #ca4e59; + line-height:28rpx; + font-size:27rpx; + margin-left: 120rpx; +padding-top: 10rpx +} + diff --git a/pages/user/userinfo/userinfo.js b/pages/user/userinfo/userinfo.js new file mode 100644 index 0000000..81c1379 --- /dev/null +++ b/pages/user/userinfo/userinfo.js @@ -0,0 +1,84 @@ +function e(e, a, r) { + return a in e ? Object.defineProperty(e, a, { + value: r, + enumerable: !0, + configurable: !0, + writable: !0 + }) : e[a] = r, e; +} + +var a = getApp(), r = a.globalData.setting, + t = a.request, s = require("../../../utils/common.js"), util = require("../../../utils/util.js"); + +Page({ + data: { + url: r.url, + resourceUrl: r.resourceUrl, + iurl: r.imghost, + defaultAvatar: r.resourceUrl + "/static/images/user68.jpg", + user: null, + tc_hide:true, + stoname:"", + }, + onShow: function() { + var e = this; var req=t; + a.getUserInfo(function(a) { + var txt = util.formatTime(a.birthday,'yyyy-M-d'),arr = txt.split(' '); + a.birthday=arr[0]; + var txt2 = util.formatTime(a.reg_time, 'yyyy-M-d'), arr2 = txt.split(' '); + a.reg_time = arr2[0]; + req.get("/api/weshop/pickup/get/" + r.stoid + "/" + a.pickup_id, { + success: function (da) { + console.log('getsto'); + console.log(da); + //设置门店 + e.setData({ stoname: da.data.data.pickup_name}); + } + }) + e.setData({ + user: a + }); + }, !0); + }, + editUserInfo: function(e) { + var r = e.currentTarget.dataset.type; + if (("password" == r || "paypwd" == r) && !this.data.user.mobile) return a.showWarning("请先绑定手机号码"); + r && this.data.user && wx.navigateTo({ + url: "/pages/user/userinfo_edit/userinfo_edit?type=" + r + }); + }, + + /*--------------------修改头像---------------------*/ + changeAvatar: function() { + return false; + var r = this; + wx.chooseImage({ + count: 1, + sizeType: [ "compressed", "original" ], + sourceType: [ "camera", "album" ], + success: function(u) { + t.uploadFile(r.data.url + "/api/user/upload_headpic", { + filePath: u.tempFilePaths[0], + name: "head_pic", + success: function(t) { + var u = s.getFullUrl(t.data.result); + r.setData(e({}, "user.head_pic", u)), a.globalData.userInfo.head_pic = u, a.showSuccess("设置头像成功"); + } + }); + } + }); + }, + + + //------卡片的显示和关闭-------- + show_tc: function () { + this.setData({ + tc_hide: false, + }); + }, + hide_tc: function () { + this.setData({ + tc_hide: true, + }); + }, +}); \ No newline at end of file diff --git a/pages/user/userinfo/userinfo.json b/pages/user/userinfo/userinfo.json new file mode 100644 index 0000000..2f245ea --- /dev/null +++ b/pages/user/userinfo/userinfo.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "个人资料", + "enablePullDownRefresh": false +} \ No newline at end of file diff --git a/pages/user/userinfo/userinfo.wxml b/pages/user/userinfo/userinfo.wxml new file mode 100644 index 0000000..19cd0d1 --- /dev/null +++ b/pages/user/userinfo/userinfo.wxml @@ -0,0 +1,97 @@ + + + + 头像 + + + + 昵称 + + {{user.nickname}} + + + 性别 + + {{user.sex?user.sex==1?'男':'女':'保密'}} + + + + 生日 + + {{user.birthday}} + + + + + 姓名 + + {{user.vipname}} + + + + 身份证 + + {{user.idcard}} + + + 电话 + + {{user.mobile}} + + + 地址 + + {{user.address}} + + + + 所属门店 + + {{stoname}} + + + + 收货地址 + + + + 我的二维码名片 + + + + 绑定的时间 + + {{user.reg_time}} + + + + + + diff --git a/pages/user/userinfo/userinfo.wxss b/pages/user/userinfo/userinfo.wxss new file mode 100644 index 0000000..cbd6456 --- /dev/null +++ b/pages/user/userinfo/userinfo.wxss @@ -0,0 +1,103 @@ +.user-container { + font-size: 30rpx; +} + +.user-head { + width: 100%; + height: 200rpx; + position: relative; + background-color: white; +} + +.user-txt { + float: left; + margin-left: 40rpx; + margin-top: 80rpx; + color: #666; +} + +.user_headimg { + height: 140rpx; + width: 140rpx; + border-radius: 70rpx; + float: right; + margin-right: 30rpx; + margin-top: 25rpx; +} + +.user-name { + width: 100%; + height: 100rpx; + margin-top: 2rpx; + background-color: white; +} +.user-name.mt{ margin-top: 20rpx;} + +.user-name-txt { + float: left; + margin-left: 40rpx; + margin-top: 30rpx; + color: #666; +} + +.user-txt-right { + float: right; + margin-top: 30rpx; + margin-right: 30rpx; + font-sise:34rpx +} + +.user-change { + width: 100%; + height: 100rpx; + margin-top: 20rpx; + background-color: white; +} + +.one-line { + white-space: nowrap; + word-break: keep-all; + overflow: hidden; +} + +.arrow-right { + width: 30rpx; + height: 30rpx; + margin-right: 30rpx; + float: right; + margin-top: 20rpx; +} + + +/*---弹出层---*/ +.modal-box{ + position:fixed; width:100%;height:100%; + top:0px; background:rgba(0,0,0,0.4); + overflow: hidden; +} +.modal-body{ + position:fixed;top:80rpx;left: 0; z-index: 100; + background: #fff; margin-left: 73rpx; + width: 600rpx; + height: 860rpx; + border-radius: 8px; text-align: center; +} +.modal-content{width: 480rpx; margin: 0 auto; margin-top: 60rpx; overflow: hidden } +.modal-content .hd_img{ width:170rpx; height: 170rpx;border-radius:5px } +.ctent_txt{ margin-left: 30rpx; text-align: left} +.txt1{font-size: 34rpx; font-weight: bold} +.txt2{font-size: 30rpx; color:#999; margin-top: 20rpx } +.arrow-right{ width: 40rpx; height: 40rpx; position: relative;top:10rpx; margin-left: 20rpx;} + +.m_ta{margin-top:50rpx; } +.g_img{ width: 480rpx; height: 480rpx} +.s_sao{font-size: 27rpx; margin-top: 25rpx} +.order-ico1{ width: 80rpx;height: 46rpx; margin-left: 40rpx;margin-right: 20rpx;} +.f_btn{font-size:24rpx; padding: 0 12rpx; margin-right: 26rpx; margin-top: -10rpx} +.order-ico3{ width: 54rpx;height: 40rpx; margin-left: 40rpx;margin-right: 20rpx;} + +.wh1001{ width: 62rpx; height: 100%;} +.wh1002{ width: 76rpx; height: 100%;} +.order-ico.cla{width: 32rpx;} +.order-ico.cla2{width: 42rpx;margin-left: 34rpx;} +.order-ico.cla3{width: 40rpx; margin-left: 36rpx;} diff --git a/pages/user/userinfo_edit/userinfo_edit.js b/pages/user/userinfo_edit/userinfo_edit.js new file mode 100644 index 0000000..4745246 --- /dev/null +++ b/pages/user/userinfo_edit/userinfo_edit.js @@ -0,0 +1,107 @@ +var e = getApp(), s = e.globalData.setting, a = e.request, i = require("../../../utils/md5.js"), t = require("../../../utils/common.js"); + +Page({ + data: { + url: s.url, + resourceUrl: s.resourceUrl, + user: null, + type: "", + canGetCode: !1 + }, + onLoad: function(s) { + var a = this; + this.setBarTitle(s.type), e.getUserInfo(function(e) { + a.setData({ + user: e, + type: s.type + }); + }); + }, + setBarTitle: function(e) { + var s = "修改个人信息"; + "nickname" == e ? s = "修改昵称" : "mobile" == e ? s = "修改手机" : "email" == e ? s = "修改邮箱" : "password" == e ? s = "修改密码" : "paypwd" == e ? s = "修改支付密码" : "sex" == e && (s = "修改性别"), + wx.setNavigationBarTitle({ + title: s + }); + }, + formSubmit: function(s) { + var a = this.data.type; + if (a) { + var i = s.detail.value; + "nickname" == a ? this.submitNickname(i) : "mobile" == a ? this.submitMobile(i) : "email" == a ? this.submitEmail(i) : "password" == a ? this.submitPassword(i) : "paypwd" == a ? this.submitPaypwd(i) : "sex" == a ? this.submitSex(i) : e.confirmBox("处理类型出错:" + a); + } + }, + submitNickname: function(s) { + if (!s.nickname) return e.showWarning("请输入昵称"), !1; + this.requestUpdateUser({ + nickname: s.nickname + }); + }, + submitMobile: function(s) { + return s.mobile ? s.mobile_code ? void this.requestUpdateUser({ + mobile: s.mobile, + mobile_code: s.mobile_code + }) : (e.showWarning("请输入验证码"), !1) : (e.showWarning("请输入手机号"), !1); + }, + submitEmail: function(s) { + return s.email ? s.email.indexOf("@") < 0 ? (e.showWarning("邮箱格式不正确"), !1) : void this.requestUpdateUser({ + email: s.email + }) : (e.showWarning("请输入邮箱"), !1); + }, + submitPassword: function(s) { + return this.data.user.password && !s.old_password ? (e.showWarning("请输入旧密码"), !1) : s.new_password ? s.confirm_password ? s.new_password.length < 6 || s.new_password.length > 18 ? (e.showWarning("密码长度不合法"), + !1) : s.new_password !== s.confirm_password ? (e.showWarning("两次密码不一致"), !1) : void a.post("/api/user/password", { + data: { + old_password: i("TPSHOP" + s.old_password), + new_password: i("TPSHOP" + s.new_password) + }, + success: function(s) { + e.showSuccess("修改成功", function() { + wx.navigateBack(); + }); + } + }) : (e.showWarning("请输入确认密码"), !1) : (e.showWarning("请输入新密码"), !1); + }, + submitPaypwd: function(s) { + return s.paypwd_mobile ? s.paypwd_code ? s.paypwd ? s.paypwd_confirm ? s.paypwd.length < 6 || s.paypwd.length > 18 ? (e.showWarning("密码长度不合法"), + !1) : s.paypwd !== s.paypwd_confirm ? (e.showWarning("两次密码不一致"), !1) : void a.post("/api/user/paypwd", { + data: { + new_password: i("TPSHOP" + s.paypwd), + mobile: s.paypwd_mobile, + paypwd_code: s.paypwd_code + }, + success: function(s) { + e.showSuccess("修改成功", function() { + wx.navigateBack(); + }); + } + }) : (e.showWarning("请输入确认密码"), !1) : (e.showWarning("请输入新密码"), !1) : (e.showWarning("请输入验证码"), + !1) : (e.showWarning("请输入手机号"), !1); + }, + submitSex: function(s) { + if (0 == this.data.user.sex) return e.showWarning("请选择性别"), !1; + this.requestUpdateUser({ + sex: this.data.user.sex + }); + }, + changeGender: function(e) { + var s = "boy" == e.currentTarget.dataset.gender ? 1 : 2; + this.setData({ + "user.sex": s + }); + }, + requestUpdateUser: function(e) { + a.post("/api/user/updateUserInfo", { + data: e, + success: function(e) { + wx.navigateBack(); + } + }); + }, + setMobile: function(e) { + this.data.user.mobile = e.detail.value; + }, + getCode: function(e) { + t.sendSmsCode(this.data.user.mobile); + } +}); \ No newline at end of file diff --git a/pages/user/userinfo_edit/userinfo_edit.json b/pages/user/userinfo_edit/userinfo_edit.json new file mode 100644 index 0000000..af3b33f --- /dev/null +++ b/pages/user/userinfo_edit/userinfo_edit.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "修改个人资料", + "enablePullDownRefresh": false +} \ No newline at end of file diff --git a/pages/user/userinfo_edit/userinfo_edit.wxml b/pages/user/userinfo_edit/userinfo_edit.wxml new file mode 100644 index 0000000..86cc5ff --- /dev/null +++ b/pages/user/userinfo_edit/userinfo_edit.wxml @@ -0,0 +1,63 @@ +
+ + + 昵称 + + + + + 手机号 + + + + + + + + + 邮箱 + + + + + 旧密码 + + + + 新密码 + + + + 确认密码 + + + + + + 手机号 + + + + + + + + 新密码 + + + + 确认密码 + + + + + + + + + + + + + +
diff --git a/pages/user/userinfo_edit/userinfo_edit.wxss b/pages/user/userinfo_edit/userinfo_edit.wxss new file mode 100644 index 0000000..d82ce12 --- /dev/null +++ b/pages/user/userinfo_edit/userinfo_edit.wxss @@ -0,0 +1,108 @@ +page { + background-color: white; +} + +.user-container { + padding-top: 100rpx; +} + +.label-input { + font-size: 28rpx; + width: 680rpx; + margin: 0 35rpx; + line-height: 90rpx; + border: 1rpx #ddd solid; + border-radius: 10rpx; +} + +.label { + box-sizing: border-box; + float: left; + padding: 0 25rpx; +} + +.input { + box-sizing: border-box; + float: left; + height: 90rpx; + width: 500rpx; + padding-right: 5rpx; +} + +.simple { + border: 0; + border-radius: 0; + border-bottom: 1rpx #ddd solid; +} + +.submit { + width: 600rpx; + margin: 0 75rpx; + background-color: #e30000; + color: white; + line-height: 90rpx; + border-radius: 10rpx; +} + +.verify-box { + font-size: 28rpx; + width: 680rpx; + margin: 0 35rpx; + line-height: 90rpx; +} + +.verify-input { + box-sizing: border-box; + float: left; + height: 90rpx; + width: 400rpx; + padding-left: 10rpx; +} + +.verify-btn { + box-sizing: border-box; + float: right; + line-height: 90rpx; + padding: 0 10rpx; + background-color: #ec5151; + color: white; + border-radius: 10rpx; +} + +.btn-disable { + background-color: grey; +} + +.item { + margin-bottom: 70rpx; +} + +.gender-box { + width: 50%; + float: left; + padding: 100rpx 0 200rpx 0; +} + +.gender { + background-repeat: no-repeat!important; + background-size: 4.48rem!important; + width: 2.13333rem; + height: 2.73067rem; + margin: 0 auto; +} + +.boy { + background-position: 0 0!important; +} + +.girl { + background-position: 0 -2.92267rem!important; +} + +.boy-click { + background-position: -2.34667rem 0!important; +} + +.girl-click { + background-position: -2.368rem -2.92267rem!important; +} \ No newline at end of file diff --git a/pages/user/userqy/userqy.js b/pages/user/userqy/userqy.js new file mode 100644 index 0000000..f44aee0 --- /dev/null +++ b/pages/user/userqy/userqy.js @@ -0,0 +1,244 @@ +var e = getApp(),os = e.globalData.setting; +var utils = require('../../../utils/util.js'); +var regeneratorRuntime = require('../../../utils/runtime.js'); + +Page({ + /** + * 页面的初始数据 + */ + data: { + backClass: null, + qy_list:null, + currentItemId: 0, + //会员信息 + userinfo:null, + iurl:os.imghost, + defaultAvatar:os.imghost+"/miniapp/images/no-head.jpg", + + cz_val:0, + full_cz_val:0, + gradeId:null, + need_money:0, + g_qy_list:null, + click_gradeId:null, + + this_curr_id:0, + GradeName:'', + is_full:0, //是否满级 + + cur_g_num:0,//当前级需要多少钱 + }, + + swiperChange: function (e) { + var currentItemId = e.detail.current; + this.setData({ + currentItemId: currentItemId + }) + + var g_id=this.data.backClass[currentItemId].Id; + this.get_ca_qy(g_id); + }, + + //--卡的单击事件-- + clickChange: function (e) {}, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var use_info=getApp().globalData.userInfo; + this.setData({userinfo:use_info}); + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow: async function () { + wx.showLoading(); + var cz_val=0,backClass=null,qy_list=null,gradeId=null,gradeEndDate=null,need_money=0,g_qy_list=null,GradeName='',cur_g_num=0; + var gl_data=getApp().globalData; + var sw_cur_id=0; + var th=this; + //获取成长值 + await getApp().request.promiseGet("/api/weshop/users/grade/aftervipinfo/get",{ + data:{ storeId:os.stoid,userId:gl_data.user_id } + }).then(res=>{ + var data=res.data.data; + cz_val=data.GradeSum; + gradeId=data.GradeId; + gradeEndDate=data.GradeEndDate; + GradeName=data.GradeName; + }) + + //获取卡类列表 + await getApp().request.promiseGet("/api/weshop/users/grade/vipgradeinfo/page",{ + data:{ storeId:os.stoid} + }).then(res=>{ + if (res.data.data) + backClass=res.data.data.pageData; + }) + + for(var i in backClass){ + var im=backClass[i]; + if(cz_val{ + if (res.data.data) + qy_list=res.data.data.pageData; + }) + + //获取当前等级的特权 + await getApp().request.promiseGet("/api/weshop/users/grade/privilegeform/list/page",{ + data: { storeId: os.stoid, GradeId: gradeId, userId: gl_data.user_id, pageSize: 100 } + }).then(res=>{ + if (res.data.data) + g_qy_list=res.data.data.pageData; + }); + + for(var i in qy_list){ + var item=qy_list[i]; + var FromId=th.check_is_has_qy(item,g_qy_list); + qy_list[i].ishas = 0; + if(FromId){ + qy_list[i].ishas=1; + qy_list[i].FromId=FromId; + } + } + qy_list.sort(function(a,b){ + return b.ishas-a.ishas + }) + + this.setData({ + cz_val: cz_val, backClass: backClass,qy_list:qy_list, + full_cz_val: backClass?backClass[backClass.length-1].BuyGradeSum:0, + gradeEndDate:gradeEndDate, + gradeId:gradeId, + need_money:need_money, + currentItemId:sw_cur_id, + this_curr_id:sw_cur_id, + GradeName:GradeName,cur_g_num:cur_g_num, + }); + wx.hideLoading(); + }, + + //判断会员是后有改服务项目 + check_is_has_qy:function(item,g_qy_list){ + if (!g_qy_list) return false; + for(var i in g_qy_list){ + var iter=g_qy_list[i]; + if(iter.FormId==item.Id) return g_qy_list[i].FormId; + } + return false; + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + //--新品使用-- + go_url:function (e) { + var th=this; + var no=e.currentTarget.dataset.no; + var ind=e.currentTarget.dataset.ind; + var item=th.data.qy_list[ind]; + if(item.ishas==undefined || !item.ishas){ + var qt_txt = th.selectComponent("#pop_txt"); //组件的id + var ob={title:"温馨提示",content:"当前会员暂无此权益"}; + qt_txt.open(ob); + return false; + } + + if(th.data.click_gradeId!=null && th.data.click_gradeId!=th.data.gradeId){ + var qt_txt = th.selectComponent("#pop_txt"); //组件的id + + var text="当前会员暂无此权益"; + if(th.data.this_curr_id>th.data.currentItemId){ + text="【"+th.data.backClass[th.data.currentItemId].GradeName+"】专享,您当前是【"+th.data.backClass[th.data.this_curr_id].GradeName+"】"; + } + var ob={title:"温馨提示",content:text}; + qt_txt.open(ob); + return false; + } + + var url=e.currentTarget.dataset.img; + + switch (no) { + case "01": + getApp().goto("/pages/user/user_coupon/user_coupon?img=" + +url+"&gradeId="+th.data.gradeId+"&FormId="+item.Id); + break; + case "02": + getApp().goto("/pages/user/user_fw/user_fw?gradeId="+th.data.gradeId+"&FormId="+item.Id); + break; + case "03": + getApp().goto("/pages/user/user_spsy/user_spsy"); + break; + case "10": + getApp().request.get("/api/weshop/users/grade/vipprivilegelist/other/get",{ + data:{storeId:os.stoid, formId:item.Id,userId:getApp().globalData.user_id,gradeId:th.data.gradeId}, + success:function (res) { + var val=res.data.data.Remark; + var title=res.data.data.PrivilegeName; + var qt_txt = th.selectComponent("#pop_txt"); //组件的id + var ob={title:title,content:val}; + qt_txt.open(ob); + } + }) + break; + } + }, + + go_cz:function(){ + getApp().goto("/pages/user/grow_value/grow_value") + }, + + //获取卡类的gr_id + get_ca_qy:async function (gr_id) { + var g_qy_list=null,th=this,qy_list=this.data.qy_list; + var gl_data=getApp().globalData; + await getApp().request.promiseGet("/api/weshop/users/grade/privilegeform/list/page",{ + data: { storeId: os.stoid, GradeId: gr_id, userId: gl_data.user_id, pageSize: 100} + }).then(res=>{ + g_qy_list=res.data.data.pageData; + }) + + for(var i in qy_list){ + var item=qy_list[i]; + qy_list[i].ishas = 0; + if(th.check_is_has_qy(item,g_qy_list)){ + qy_list[i].ishas=1; + qy_list[i].FromId=item.Id; + }else{ + qy_list[i].ishas=0; + } + } + + qy_list.sort(function (a, b) { + return b.ishas - a.ishas + }) + + th.setData({ + qy_list: qy_list, + click_gradeId:gr_id, + }) + } + + +}) \ No newline at end of file diff --git a/pages/user/userqy/userqy.json b/pages/user/userqy/userqy.json new file mode 100644 index 0000000..b803934 --- /dev/null +++ b/pages/user/userqy/userqy.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "会员权益", + "usingComponents": { + "pop_txt": "/components/userqy_pop_up/userqy_pop_up" + } +} \ No newline at end of file diff --git a/pages/user/userqy/userqy.wxml b/pages/user/userqy/userqy.wxml new file mode 100644 index 0000000..8419f4e --- /dev/null +++ b/pages/user/userqy/userqy.wxml @@ -0,0 +1,102 @@ + + + + + + + + {{userinfo.nickname}} {{GradeName}} + + + + + 成长值 + + + + + + {{filter.pInt(cz_val)}} / {{need_money}} + {{filter.pInt(cz_val)}} + + + + + + + + + + + + {{item.GradeName}} + + + + + [{{item.GradeName}}]365天累计成长值≥{{backClass[index+1].BuyGradeSum }}可升级[{{ backClass[index+1].GradeName}}] + + + [{{item.GradeName}}]365天累计成长值≥{{item.BuyGradeSum }}可保级 + + + 会员将在{{filter.replace_time(gradeEndDate)}}到期,365天累计成长值≥{{need_money}}可升级[{{ backClass[index+1].GradeName}}][{{item.GradeName}}]365天累计成长值≥{{item.BuyGradeSum}}可保级 + + + [{{item.GradeName}}]365天累计成长值≥{{backClass[index+1].BuyGradeSum }}可升级[{{ backClass[index+1].GradeName}}] + + + + + 加入会员尽享优惠 + + + + 距离{{item.GradeName}}还需{{ filter.pInt(item.BuyGradeSum-cz_val)}}成长值 + + + + + 您当前是此会员 + + + + + + + + + + + + + + + + + + + + + + + 会员特权 + + + + + + + + + + + {{item.PrivilegeName}} + + + + + + \ No newline at end of file diff --git a/pages/user/userqy/userqy.wxss b/pages/user/userqy/userqy.wxss new file mode 100644 index 0000000..22763a1 --- /dev/null +++ b/pages/user/userqy/userqy.wxss @@ -0,0 +1,214 @@ +.xc-userqy-frame{ + width: 750rpx; + height: 100%; + + } + .xc-userqy-frame .user-frame{ + width: 750rpx; + height: 393rpx; + } +.xc-userqy-frame .user-frame .arc{ + width: 750rpx; + height: 444rpx; + +} +.xc-userqy-frame .user-frame .user-img{ + top:50rpx; + left:19rpx; + height: 136rpx; + width:136rpx; +} +.xc-userqy-frame .user-frame .user-name{ + color: #fff; + top:80rpx; + left: 172rpx; +} +.xc-userqy-frame .user-frame .xc-grow-frame{ + top: 143rpx; + left: 180rpx; +} +.xc-grow-val{ + color: #fff; width:78rpx; + background:#ffbdce; +padding-left:15rpx; +padding-right:15rpx; +border-radius:20rpx; +height:40rpx; +line-height:40rpx; + +} +.progress-bar-not{ + border-radius: 25rpx; + margin-top: 14rpx; + margin-left: 15rpx; + width: 274rpx; + background: #fff; + height: 15rpx; +} +.progress-bar-yes{ + border-radius: 25rpx; + height: 15rpx; + background:#ffd801; +} + + +.xc-userqy-frame .user-frame .progress-bar-val{ + color: #fff; + margin-left: 10rpx; +} + + +.xc-userqy-frame .user-frame .swiper-frame{ + top: 248rpx; + width: 100%; + height: 332rpx; + border-bottom: 10rpx solid #f2f2f2; +} + + +.xc-userqy-frame .privilege-frame { + width: 100%; + height: auto; + + +} +.xc-privilege-img-frame{ + width: 100%; + height:70rpx; + margin-top:200rpx +} +.xc-privilege-img{ + width: 63rpx; + height: 45rpx; + position:relative; + top:22rpx; +} + + .xc-user-privileg{ + width:100rpx; + height: 34rpx; + padding-top:5rpx; + margin-left: -20rpx +} +.xc-user-privileg-right{ + width:100rpx; + height: 34rpx; + margin-left:00rpx; + padding-top:5rpx; +} +.user-word{ + color: #ffaa02; + margin-left:8rpx; + font-size:28rpx; + + +} + +.xc-userqy-frame .project-frame{ + height: auto; + margin-top:60rpx; +} + +.xc-userqy-frame .project-frame .item{ + width: 25%; + display: inline-block; + margin-bottom: 60rpx; +} + +.xc-project-img{ + width: 50rpx; + height: 50rpx; +} +.xc-project-word{ + margin-top: 20rpx; + color: #666 +} +.user-salon { + width: 166rpx; + height:auto; +margin-top:60rpx; + +} +.xc-users-frame{ + width: 50rpx; + border-bottom: 3rpx solid #feaf09; + margin-top:8rpx; + margin-left:40rpx; +} +.xc-users-frame-right{ + width: 50rpx; + border-bottom: 3rpx solid #feaf09; + margin-top:8rpx; + margin-left: 15rpx; + +} +.xc-users-frame-two{ + width:75rpx; + border-bottom: 3rpx solid #feaf09; + margin-top:8rpx; + margin-left:15rpx; + +} + + + +.li{ + width: 100%; + height: 252rpx; +} +.li .vip-img{ + width:490rpx; + height:280rpx; + box-shadow: 0rpx 0rpx 10rpx #888888; + +} +.li .vip-huangguan{ + top:50rpx; + left: 35rpx; + width:65rpx; + height: 55rpx; + +} +.li .emerald{ + top:55rpx; + left: 110rpx; +} + +.li .discounts{ + top:115rpx; + left: 36rpx; + width: 435rpx; +} + .li .money{ + left: 41rpx; + bottom: 28rpx + } +.li1{ + width: 446rpx; + margin: 0 auto; + border-radius: 10rpx; + height: 252rpx; + transform: scale(0.9); +} +.selected{ + transform: scale(1); + box-shadow: 0rpx 0rpx 30rpx #888888; +} + +.mar-bottem{ margin-bottom: 40rpx} +.four-level-word.new {font-size: 24rpx; } + +.li .money.curword{left:0;} +.li .money.curword .text{ + background:rgba(255,255,254,0.3); + border-radius:0 30rpx 30rpx 0; + width: 235rpx; height: 60rpx; + } + + .li .money.curword .text2{ + top: 12rpx; left:30rpx + } + + +.hvip{display: inline-block; font-size: 20rpx; height: 40rpx;line-height: 40rpx; color:#e7bf77; background: #383838; padding: 0 15rpx; border-radius:20rpx; vertical-align: middle } +.vip-mem{width: 26rpx; height: 23rpx; vertical-align:top; margin-top: 8rpx; margin-right: 5rpx} diff --git a/pages/user/visit_log/visit_log.js b/pages/user/visit_log/visit_log.js new file mode 100644 index 0000000..994611e --- /dev/null +++ b/pages/user/visit_log/visit_log.js @@ -0,0 +1,48 @@ +var t = function(t) { + return t && t.__esModule ? t : { + default: t + }; +}(require("../../../utils/LoadMore.js")), i = getApp(), e = i.request, s = new t.default(); + +Page({ + data: { + url: i.globalData.setting.url, + resourceUrl: i.globalData.setting.resourceUrl, + visits: null, + currentPage: 1 + }, + onLoad: function() { + s.init(this, "", "visits"), this.requestVisitLog(); + }, + onShow: function() { + this.resetData(), this.requestVisitLog(); + }, + onPullDownRefresh: function() { + this.resetData(), this.requestVisitLog(); + }, + onReachBottom: function() { + s.canloadMore() && this.requestVisitLog(); + }, + requestVisitLog: function() { + var t = this, i = t.data.url + "/api/user/visit_log?p=" + t.data.currentPage; + s.request(i, function(i) { + t.data.currentPage++, wx.stopPullDownRefresh(); + }); + }, + resetData: function() { + this.data.currentPage = 1, this.data.visits = null, s.resetConfig(); + }, + deleteVisit: function(t) { + var i = this, s = t.currentTarget.dataset.vidx, a = t.currentTarget.dataset.gidx, r = i.data.visits; + e.post("/api/user/del_visit_log", { + data: { + visit_ids: r[s].visit[a].visit_id + }, + success: function(t) { + 1 == r[s].visit.length ? r.splice(s, 1) : r[s].visit.splice(a, 1), i.setData({ + visits: r + }); + } + }); + } +}); \ No newline at end of file diff --git a/pages/user/visit_log/visit_log.json b/pages/user/visit_log/visit_log.json new file mode 100644 index 0000000..0ca1b3a --- /dev/null +++ b/pages/user/visit_log/visit_log.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "访问记录" +} \ No newline at end of file diff --git a/pages/user/visit_log/visit_log.wxml b/pages/user/visit_log/visit_log.wxml new file mode 100644 index 0000000..139074c --- /dev/null +++ b/pages/user/visit_log/visit_log.wxml @@ -0,0 +1,22 @@ + + + + {{visit.date}} + + + + + + + + {{item.goods_name}} + + + ¥{{item.shop_price}} + 看相似 + 删除 + + + + + diff --git a/pages/user/visit_log/visit_log.wxss b/pages/user/visit_log/visit_log.wxss new file mode 100644 index 0000000..65d3f56 --- /dev/null +++ b/pages/user/visit_log/visit_log.wxss @@ -0,0 +1,53 @@ +.log_date { + background-color: #fff; + font-size: 28rpx; + color: #666666; + padding: 28rpx 28rpx; + border-bottom: 1rpx solid #e3e5e9; +} + +.visit { + background-color: #fff; + font-size: 28rpx; + padding: 10rpx 25rpx; +} + +.goods_img { + width: 200rpx; + height: 200rpx; + float: left; +} + +.goods_detail { + padding: 25rpx 0 25rpx 15rpx; + width: 485rpx; + float: left; + border-bottom: 1rpx #e3e5e9 solid; +} + +.goods_name { + height: 64rpx; + line-height: 32rpx; + margin-bottom: 34rpx; + overflow: hidden; +} + +.goods_footer { + height: 50rpx; +} + +.price { + color: red; + float: left; + margin-top: 6rpx; +} + +.similar { + font-size: 26rpx; + color: #777777; + float: right; + padding: 6rpx; + border: 1rpx #bfbfbf solid; + border-radius: 4rpx; + margin-left: 10rpx; +} \ No newline at end of file diff --git a/pages/user/withdrawals/withdrawals.js b/pages/user/withdrawals/withdrawals.js new file mode 100644 index 0000000..532d51f --- /dev/null +++ b/pages/user/withdrawals/withdrawals.js @@ -0,0 +1,54 @@ +var a = getApp(), n = a.request, e = require("../../../utils/common.js"); + +Page({ + data: { + url: a.globalData.setting.url, + userMoney: 0, + capacheUrl: "" + }, + onLoad: function(a) { + this.setData({ + userMoney: a.money + }), this.getCapache(); + }, + submitWithdrawals: function(a) { + var e = a.detail.value; + if (!0 === this.checkFormData(e)) { + var t = this; + n.post("/api/user/withdrawals", { + data: { + account_bank: e.account_bank, + account_name: e.account_name, + bank_name: e.bank_name, + money: e.money, + verify_code: e.verify_code, + paypwd: e.paypwd + }, + success: function() { + wx.showToast({ + title: "已提交申请", + mask: !0, + complete: function() { + setTimeout(function() { + wx.navigateBack(); + }, 1e3); + } + }); + }, + failStatus: function() { + t.getCapache(); + } + }); + } + }, + checkFormData: function(n) { + console.log(n); + var e = parseFloat(n.money); + return isNaN(e) ? a.showWarning("请填写合法的提现金额") : e < .01 ? a.showWarning("请填写大于等于1分的提现金额") : e > this.data.userMoney ? a.showWarning("可提现最大金额是 " + this.data.userMoney + " 元") : n.bank_name.length < 2 ? a.showWarning("请填写正确的银行名称") : isNaN(parseInt(n.account_bank)) || "" == n.account_bank ? a.showWarning("请填写正确的收款账号") : "" == n.account_name ? a.showWarning("请填写正确的开户号") : "" == n.paypwd.length ? a.showWarning("支付密码不能为空") : "" != n.verify_code || a.showWarning("请先输入验证码"); + }, + getCapache: function() { + this.setData({ + capacheUrl: e.getCapache() + }); + } +}); \ No newline at end of file diff --git a/pages/user/withdrawals/withdrawals.json b/pages/user/withdrawals/withdrawals.json new file mode 100644 index 0000000..7032d9c --- /dev/null +++ b/pages/user/withdrawals/withdrawals.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "申请提现" +} \ No newline at end of file diff --git a/pages/user/withdrawals/withdrawals.wxml b/pages/user/withdrawals/withdrawals.wxml new file mode 100644 index 0000000..72776d6 --- /dev/null +++ b/pages/user/withdrawals/withdrawals.wxml @@ -0,0 +1,32 @@ + +
+ + 提现金额 : + + + + 银行名称 : + + + + 收款账号 : + + + + 开户号 : + + + + 支付密码 : + + + + 验证码 : + + + + + + +
+
diff --git a/pages/user/withdrawals/withdrawals.wxss b/pages/user/withdrawals/withdrawals.wxss new file mode 100644 index 0000000..b8978e8 --- /dev/null +++ b/pages/user/withdrawals/withdrawals.wxss @@ -0,0 +1,42 @@ +.panel { + padding-bottom: 50rpx; +} + +.apply-item { + display: flex; + align-items: center; + font-size: 28rpx; + height: 88rpx; + border-bottom: 1px solid #ddd; +} + +.title { + color: #444; + margin-right: 20rpx; +} + +input { + color: #777; + width: 500rpx; +} + +.v-code-text { + width: 220rpx; +} + +.v-code { + width: 260rpx; + height: 60rpx; +} + +.apply-btn { + margin: 60rpx auto 0; + width: 580rpx; + height: 88rpx; + font-size: 28rpx; + line-height: 88rpx; + text-align: center; + color: #fff; + background-color: #e30000; + border-radius: 8rpx; +} \ No newline at end of file diff --git a/pages/user/withdrawals_list/withdrawals_list.js b/pages/user/withdrawals_list/withdrawals_list.js new file mode 100644 index 0000000..940598d --- /dev/null +++ b/pages/user/withdrawals_list/withdrawals_list.js @@ -0,0 +1,31 @@ +var t = function(t) { + return t && t.__esModule ? t : { + default: t + }; +}(require("../../../utils/LoadMore.js")), a = getApp(), e = new t.default(), r = require("../../../utils/util.js"); + +Page({ + data: { + url: a.globalData.setting.url, + resourceUrl: a.globalData.setting.resourceUrl, + withdrawals: null, + currentPage: 1 + }, + onLoad: function() { + e.init(this, "", "withdrawals"), this.requestWithdrawalsList(); + }, + requestWithdrawalsList: function() { + var t = this, a = "/api/user/withdrawals_list/?p=" + t.data.currentPage; + e.request(a, function(a) { + t.data.currentPage++, a.data.result.forEach(function(t, a, e) { + t.createTimeFommat = r.format(t.create_time, "yyyy-MM-dd"); + }), wx.stopPullDownRefresh(); + }); + }, + onReachBottom: function() { + e.canloadMore() && this.requestWithdrawalsList(); + }, + onPullDownRefresh: function() { + this.data.withdrawals = null, this.data.currentPage = 1, e.resetConfig(), this.requestWithdrawalsList(); + } +}); \ No newline at end of file diff --git a/pages/user/withdrawals_list/withdrawals_list.json b/pages/user/withdrawals_list/withdrawals_list.json new file mode 100644 index 0000000..bece1ed --- /dev/null +++ b/pages/user/withdrawals_list/withdrawals_list.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "提现申请记录" +} \ No newline at end of file diff --git a/pages/user/withdrawals_list/withdrawals_list.wxml b/pages/user/withdrawals_list/withdrawals_list.wxml new file mode 100644 index 0000000..805d0ec --- /dev/null +++ b/pages/user/withdrawals_list/withdrawals_list.wxml @@ -0,0 +1,14 @@ + + + 编号 + 申请日期 + 金额 + 状态 + + + {{item.id}} + {{item.createTimeFommat}} + {{item.money}} + {{item.status==0?'申请中':''}}{{item.status==1?'申请成功':''}}{{item.status==2?'申请失败':''}} + + diff --git a/pages/user/withdrawals_list/withdrawals_list.wxss b/pages/user/withdrawals_list/withdrawals_list.wxss new file mode 100644 index 0000000..652c284 --- /dev/null +++ b/pages/user/withdrawals_list/withdrawals_list.wxss @@ -0,0 +1,42 @@ +page { + background-color: white; +} + +.withdrawal-box { + font-size: 28rpx; + padding: 25rpx 30rpx; + border-bottom: 1rpx solid #f8f8f8; +} + +.withdrawal-item { + display: inline-block; + word-break: keep-all; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + color: #666666; + box-sizing: border-box; + text-align: center; +} + +.withdrawal-box .pay { + width: 20%; +} + +.withdrawal-box .time { + width: 27%; +} + +.withdrawal-box .price { + width: 28%; +} + +.withdrawal-box .status { + width: 25%; + color: #e01222; +} + +.withdrawal-box .title { + color: #666666; + font-size: 32rpx; +} \ No newline at end of file diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..8843409 --- /dev/null +++ b/project.config.json @@ -0,0 +1,43 @@ +{ + "description": "项目配置文件", + "packOptions": { + "ignore": [] + }, + "setting": { + "urlCheck": false, + "es6": true, + "postcss": true, + "minified": true, + "newFeature": true, + "autoAudits": false, + "checkInvalidKey": true + }, + "compileType": "miniprogram", + "libVersion": "2.2.4", + "appid": "wx2ea7cdd3ef52cdff", + "projectname": "miaosha", + "debugOptions": { + "hidedInDevtools": [] + }, + "isGameTourist": false, + "simulatorType": "wechat", + "simulatorPluginLibVersion": {}, + "condition": { + "search": { + "current": -1, + "list": [] + }, + "conversation": { + "current": -1, + "list": [] + }, + "game": { + "currentL": -1, + "list": [] + }, + "miniprogram": { + "current": -1, + "list": [] + } + } +} \ No newline at end of file diff --git a/public/static/images/model/bg.jpg b/public/static/images/model/bg.jpg new file mode 100644 index 0000000..35849b8 --- /dev/null +++ b/public/static/images/model/bg.jpg diff --git a/public/static/images/model/bg1.jpg b/public/static/images/model/bg1.jpg new file mode 100644 index 0000000..3e5f2e1 --- /dev/null +++ b/public/static/images/model/bg1.jpg diff --git a/public/static/images/model/car.png b/public/static/images/model/car.png new file mode 100644 index 0000000..de93144 --- /dev/null +++ b/public/static/images/model/car.png diff --git a/public/static/images/model/nav.png b/public/static/images/model/nav.png new file mode 100644 index 0000000..81052eb --- /dev/null +++ b/public/static/images/model/nav.png diff --git a/public/static/images/model/notice.png b/public/static/images/model/notice.png new file mode 100644 index 0000000..79a5d82 --- /dev/null +++ b/public/static/images/model/notice.png diff --git a/public/static/images/model/select.png b/public/static/images/model/select.png new file mode 100644 index 0000000..72a2bb6 --- /dev/null +++ b/public/static/images/model/select.png diff --git a/public/static/images/model/time.png b/public/static/images/model/time.png new file mode 100644 index 0000000..65fa182 --- /dev/null +++ b/public/static/images/model/time.png diff --git a/setting.js b/setting.js new file mode 100644 index 0000000..cf81208 --- /dev/null +++ b/setting.js @@ -0,0 +1,14 @@ +module.exports = { + appName: "派派通", + versionCode: "1.0.0", + appLogo: "../../../images/logo.png", + url: "https://test-weshop.yolipai.net", + //url:"https://weshop.yolipai.net", //外网的网址 + //url:"http://172.20.3.121:8085", //明海的网址 + //url:"http://172.20.3.102:8085", //自己的网址 + banner_err:"../../../images/del/logo.png", + imghost: "https://mshopimg.yolipai.net/", + share: {}, + stoid:1, + +}; diff --git a/sitemap.json b/sitemap.json new file mode 100644 index 0000000..ca02add --- /dev/null +++ b/sitemap.json @@ -0,0 +1,7 @@ +{ + "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [{ + "action": "allow", + "page": "*" + }] +} \ No newline at end of file diff --git a/static/icon/iconfont.css b/static/icon/iconfont.css new file mode 100644 index 0000000..9920e53 --- /dev/null +++ b/static/icon/iconfont.css @@ -0,0 +1,441 @@ +@font-face {font-family: "iconfont"; + src: url('iconfont.eot?t=1554344875646'); /* IE9 */ + src: url('iconfont.eot?t=1554344875646#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAETAAAsAAAAAg0wAAERtAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCPZgqB2UCBqEMBNgIkA4MUC4FMAAQgBYRtB5AAGztplwxBtwMQKRVbNYpysOooSjepnv3/f0bSMWRj6oBLqVlBkDyQQaWGZ86yL7y1kBXbkQiTREGkFfvkfoY+05mLfqBej/olLVNMPNVwO9/WL4QFtcn+ZMJeUr1c1DVWyhx92YGcOOTENd7al52BfTLn/5EurYZiGuaQpGjC8999u2/um7+srSKdKKAAEwk00VwDSnSG5+fW+3+ZxMhtRAksiJQ1GzmqZNRoHTUwGYiEiTbmxMbCKEJRbEDBSEA8L0xEz2gs1Fk35pVHsjmsHIS5qA5beKz/A4AeYoxv+01ORByrhMJ0QqZlQiJdfIg3mE+3PnjvV/Cui3yTFTvxSsTY69xLTdqkncxEYDUJmQmsKBpWDRg56Xwwp5VkJ3t3ku20S0yvOzZk2oVyljvA+Uhf6UsODyRcOGgyQGT47utxYd4DAAL/91XNz3ytzRqWK7pkytp+LSsfTEIkHBKgAdA6hSB38OD6ZC/+rZZY21EB9/N6Vab9aQdEkoX0sALbQdWc6nNRwZnDqF52nJUGKwF0GCPAp19bTKcTGqVoKKJ/F2kNKqRKNAmdJ5jd+V8633bb3ZlUDwQJi/wdgoqgaAwB8g/yUUhqpRbojm0+6BgroAII+HtVyxYgl3vau7MtXYrirHkpT59C0bpzUZ27/z5AkR8gJQHcQABKELUB5AaC3ECQF0RdIuV0KQaC3EAoDSitbdJRdKQcpbNzlUKVQuWrHWLRuGhddnuVzc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.woff?t=1554344875646') format('woff'), + url('iconfont.ttf?t=1554344875646') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ + url('iconfont.svg?t=1554344875646#iconfont') format('svg'); /* iOS 4.1- */ +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-ic_share_CopyLink:before { + content: "\e681"; +} + +.icon-ic_share_Moments:before { + content: "\e682"; +} + +.icon-ic_share_weixin:before { + content: "\e683"; +} + +.icon-ic_share_img:before { + content: "\e6c2"; +} + +.icon-icon_login_hiddenpa:before { + content: "\e642"; +} + +.icon-icon_login_showpas:before { + content: "\e643"; +} + +.icon-icon_login_password:before { + content: "\e644"; +} + +.icon-icon_login_account:before { + content: "\e645"; +} + +.icon-icon_login_verificat:before { + content: "\e646"; +} + +.icon-icon_login_password1:before { + content: "\e647"; +} + +.icon-icon_pay_default:before { + content: "\e653"; +} + +.icon-icon_pay_successful:before { + content: "\e654"; +} + +.icon-icon_positioning:before { + content: "\e655"; +} + +.icon-icon_rightarrow:before { + content: "\e656"; +} + +.icon-icon_home_stores1:before { + content: "\e65c"; +} + +.icon-icon_home_invitation1:before { + content: "\e65d"; +} + +.icon-icon_home_rights1:before { + content: "\e65e"; +} + +.icon-icon_home_coupon1:before { + content: "\e65f"; +} + +.icon-icon_classification_3:before { + content: "\e660"; +} + +.icon-icon_classification_4:before { + content: "\e661"; +} + +.icon-icon_shopping_reduci1:before { + content: "\e663"; +} + +.icon-icon_shopping_addnu1:before { + content: "\e664"; +} + +.icon-icon_page_return:before { + content: "\e665"; +} + +.icon-icon_distribution:before { + content: "\e666"; +} + +.icon-icon_registered_wind:before { + content: "\e667"; +} + +.icon-icon_registered_swee:before { + content: "\e668"; +} + +.icon-icon_details_shoppin:before { + content: "\e669"; +} + +.icon-icon_details_share:before { + content: "\e66a"; +} + +.icon-icon_details_collect:before { + content: "\e66b"; +} + +.icon-icon_details_more:before { + content: "\e66c"; +} + +.icon-icon_home_search_del:before { + content: "\e66d"; +} + +.icon-icon_order_details_zhi:before { + content: "\e66e"; +} + +.icon-icon_order_details_wei:before { + content: "\e670"; +} + +.icon-icon_list_price_Unde:before { + content: "\e671"; +} + +.icon-icon_list_price_on:before { + content: "\e672"; +} + +.icon-icon_search:before { + content: "\e677"; +} + +.icon-icon_mine_account:before { + content: "\e67f"; +} + +.icon-icon_mine_account_au:before { + content: "\e67c"; +} + +.icon-icon_mine_account_pr:before { + content: "\e67b"; +} + +.icon-icon_home_account_no:before { + content: "\e676"; +} + +.icon-icon_mine_order_eval:before { + content: "\e678"; +} + +.icon-icon_mine_order_scor:before { + content: "\e679"; +} + +.icon-icon_list_price_on1:before { + content: "\e67d"; +} + +.icon-icon_list_price_Unde1:before { + content: "\e67e"; +} + +.icon-icon_rightarrow1:before { + content: "\e684"; +} + +.icon-icon_page_return1:before { + content: "\e685"; +} + +.icon-iocn_shutdown:before { + content: "\e686"; +} + +.icon-icon_order_stores:before { + content: "\e687"; +} + +.icon-icon_hoem_qrcode1:before { + content: "\e692"; +} + +.icon-icom_walle_detail:before { + content: "\e690"; +} + +.icon-icom_walle_analysis:before { + content: "\e693"; +} + +.icon-icom_share_weibo1:before { + content: "\e696"; +} + +.icon-icom_share_qq1:before { + content: "\e697"; +} + +.icon-icon_guide:before { + content: "\e694"; +} + +.icon-icon_stores_address:before { + content: "\e695"; +} + +.icon-icon_stores_phone:before { + content: "\e698"; +} + +.icon-icon_distribution1:before { + content: "\e699"; +} + +.icon-tab_mine_nor2:before { + content: "\e69a"; +} + +.icon-tab_hoem_nor:before { + content: "\e69b"; +} + +.icon-tab_shopping_nor:before { + content: "\e69c"; +} + +.icon-tab_classification_n:before { + content: "\e69d"; +} + +.icon-icon_hoem_share1:before { + content: "\e6a2"; +} + +.icon-icon_message:before { + content: "\e6a0"; +} + +.icon-icon_calendar:before { + content: "\e69e"; +} + +.icon-icon_remind1:before { + content: "\e6a8"; +} + +.icon-icon_prestore:before { + content: "\e6a5"; +} + +.icon-icon_customerservic:before { + content: "\e6ac"; +} + +.icon-iocn_tianjiaxinxi:before { + content: "\e6af"; +} + +.icon-icon_bianjixinxi:before { + content: "\e6b0"; +} + +.icon-icon_tupian:before { + content: "\e6b4"; +} + +.icon-icon_weixin:before { + content: "\e6b5"; +} + +.icon-icon_gouwuche:before { + content: "\e6b7"; +} + +.icon-icon_yaoqingma:before { + content: "\e6b9"; +} + +.icon-icon_zhifushibai-:before { + content: "\e6ba"; +} + +.icon-icon_querenzhifujieguo-:before { + content: "\e6bb"; +} + +.icon-icon_weihuoquzhifujieguo-:before { + content: "\e6bc"; +} + +.icon-icon_sousuo:before { + content: "\e6d2"; +} + +.icon-icon_gouxuan:before { + content: "\e6c6"; +} + +.icon-icon_yinhangqiazhifu:before { + content: "\e6c7"; +} + +.icon-icon_huorepintuan:before { + content: "\e6c9"; +} + +.icon-icon_pintuanyure:before { + content: "\e6ca"; +} + +.icon-icon_hoem_share:before { + content: "\e6cc"; +} + +.icon-tab_classification_s1:before { + content: "\e6cd"; +} + +.icon-tab_home_set:before { + content: "\e6ce"; +} + +.icon-tab_shopping_set1:before { + content: "\e6cf"; +} + +.icon-tab_mine_set:before { + content: "\e6d0"; +} + +.icon-icon_mine_nodelive1:before { + content: "\e6dc"; +} + +.icon-icon_mine_noevaluat1:before { + content: "\e6dd"; +} + +.icon-icon_mine_arefund1:before { + content: "\e6de"; +} + +.icon-icon_mine_notpaying1:before { + content: "\e6df"; +} + +.icon-icon_mine_notreceiv1:before { + content: "\e6e0"; +} + +.icon-icon_login_password_1:before { + content: "\e6d1"; +} + +.icon-icon_login_account_i1:before { + content: "\e6d3"; +} + +.icon-icon_login_verificat2:before { + content: "\e6d4"; +} + +.icon-icon_mine_allorders1:before { + content: "\e6d5"; +} + +.icon-icon_pay_choose1:before { + content: "\e6d6"; +} + +.icon-icom_comments_pictur1:before { + content: "\e6d7"; +} + +.icon-iocm_pay_wallet1:before { + content: "\e6d8"; +} + +.icon-icon_home_welfare:before { + content: "\e6d9"; +} + +.icon-icon_mine_order_scor2:before { + content: "\e6da"; +} + +.icon-icom_jump:before { + content: "\e6db"; +} + +.icon-iocm_questionmark:before { + content: "\e6e1"; +} + +.icon-icom_questionmark:before { + content: "\e6ec"; +} + +.icon-icom_Downarrow:before { + content: "\e6ed"; +} + +.icon-icom_sousuo:before { + content: "\e6e2"; +} + +.icon-icon_mine_setup:before { + content: "\e6e3"; +} + diff --git a/static/icon/iconfont.eot b/static/icon/iconfont.eot new file mode 100644 index 0000000..e6f8e4c --- /dev/null +++ b/static/icon/iconfont.eot diff --git a/static/icon/iconfont.js b/static/icon/iconfont.js new file mode 100644 index 0000000..8724c8f --- /dev/null +++ b/static/icon/iconfont.js @@ -0,0 +1 @@ +!function(a){var c,h='',l=(c=document.getElementsByTagName("script"))[c.length-1].getAttribute("data-injectcss");if(l&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}!function(c){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(c,0);else{var l=function(){document.removeEventListener("DOMContentLoaded",l,!1),c()};document.addEventListener("DOMContentLoaded",l,!1)}else document.attachEvent&&(h=c,i=a.document,o=!1,s=function(){o||(o=!0,h())},(t=function(){try{i.documentElement.doScroll("left")}catch(c){return void setTimeout(t,50)}s()})(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,s())});var h,i,o,s,t}(function(){var c,l;(c=document.createElement("div")).innerHTML=h,h=null,(l=c.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",function(c,l){l.firstChild?function(c,l){l.parentNode.insertBefore(c,l)}(c,l.firstChild):l.appendChild(c)}(l,document.body))})}(window); \ No newline at end of file diff --git a/static/icon/iconfont.svg b/static/icon/iconfont.svg new file mode 100644 index 0000000..e941a18 --- /dev/null +++ b/static/icon/iconfont.svg @@ -0,0 +1,344 @@ + + + + + +Created by iconfont + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/icon/iconfont.ttf b/static/icon/iconfont.ttf new file mode 100644 index 0000000..5cec7f7 --- /dev/null +++ b/static/icon/iconfont.ttf diff --git a/static/icon/iconfont.woff b/static/icon/iconfont.woff new file mode 100644 index 0000000..c20027a --- /dev/null +++ b/static/icon/iconfont.woff diff --git a/static/icon/iconfont.woff2 b/static/icon/iconfont.woff2 new file mode 100644 index 0000000..6f229e8 --- /dev/null +++ b/static/icon/iconfont.woff2 diff --git a/utils/LoadMore.js b/utils/LoadMore.js new file mode 100644 index 0000000..75d47ff --- /dev/null +++ b/utils/LoadMore.js @@ -0,0 +1,175 @@ +var oo = require("../setting.js"); +var ut = require('util.js'); + +function a(a, t, e) { + return t in a ? Object.defineProperty(a, t, { + value: e, + enumerable: !0, + configurable: !0, + writable: !0 + }) : a[t] = e, a; +} + +function t(a, t) { + if (!(a instanceof t)) throw new TypeError("Cannot call a class as a function"); +} + +Object.defineProperty(exports, "__esModule", { + value: !0 +}); + +var e = function() { + function a(a, t) { + for (var e = 0; e < t.length; e++) { + var o = t[e]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), + Object.defineProperty(a, o.key, o); + } + } + return function(t, e, o) { + return e && a(t.prototype, e), o && a(t, o), t; + }; +}(), o = getApp(), n = o.request, i = function() { + function i() { + t(this, i), this.data = { + page: null, + listName: "", + resultName: "", + resultListName: "", + scrollTimeStamp: 0, + goodsLoadFinishFlag: !1, + goodsLoading: !1 + }; + } + return e(i, [ { + key: "init", + value: function(a, t, e, o) { + this.data.scrollTimeStamp = 0, this.data.page = a, this.data.listName = t, this.data.resultName = e, + this.data.resultListName = void 0 == o ? t : o, this.data.goodsLoadFinishFlag = !1, + this.data.goodsLoading = !1; + } + }, { + key: "request", + value: function(t, e, i,dd) { + if(dd==undefined) dd=null; + var s = this,rurl=t; + return !s.data.goodsLoading && (s.data.goodsLoading = !0, n.get(t, { + data:dd, + success: function(t) { + var n = !0; + + var i, r = s.data.listName, l = s.data.resultName, d = s.data.resultListName; + i = "" != r ? t.data.data[r] : t.data.data.pageData; //data.pageData是接口固定会出现的,封装好了 + var u = !1, g = null, c = s.data.page; + + console.log('loadmore'); + console.log(t.data.data.pageData); + console.log(c ); + + //如果已经的第二页的时候,就是把数据加入数组 + if (c !=undefined && c.data[l]) { + u = !0; + var f = null; + f = "" != d ? c.data[l][d] : c.data[l], [].push.apply(f, i), g = c.data[l]; + } else g = t.data.data.pageData; + + + //格式化 + var glist=""; + for (var i = 0; i < g.length; i++) { + //if(g[i].prom_type == 1 || g[i].prom_type == 2 || g[i].prom_type == 6) { + if (g[i].prom_type == 1) { + glist += g[i].goods_id+","; + } + if (g[i].original_img!=undefined){ + if (g[i].original_img.indexOf(oo.imghost)==-1) + g[i].original_img = oo.imghost + g[i].original_img; + } + + if (g[i].add_time != undefined){ + var tx = g[i].add_time + ""; + if (tx.indexOf('-') == -1) { + g[i].add_time = ut.formatTime(g[i].add_time, 'yyyy-MM-dd hh:mm:ss'); + } + } + if (rurl.indexOf('comment/page')!=-1){ + console.log('comment/page'); + console.log(g[i].img); + var tx1 = g[i].img; + + if (tx1 != "" && tx1 != null && ut.isString(tx1)){ + var arr = ut.unserialize(tx1); + g[i].img=arr; + } else if (!ut.isArray(tx1)){ + g[i].img=""; + } + } + } + + + //没有活动,就不用调用接口 + if (glist==""){ + c.setData(a({}, l, g)); + if ("function" == typeof e && (n = e(t)), !1 === n) return !1; + i && 0 != i.length || (s.data.goodsLoadFinishFlag = !0, u && o.showWarning("加载完啦", null, 500, !1)); + return false; + } + + c.setData(a({}, l, g)); + if ("function" == typeof e && (n = e(t)), !1 === n) return !1; + i && 0 != i.length || (s.data.goodsLoadFinishFlag = !0, u && o.showWarning("加载完啦", null, 500, !1)); + + return false; + + + glist = ut.sub_last(glist); + //---如果是调用商品列表,就要使用商品实际价格---- + getApp().request.get("/api/weshop/activitylist/getGoodsPrice/" + + oo.stoid + "/" + glist, { + success: function (t) { + console.log('/goods/page'); + console.log(t); + + //g[i].shop_price = t.data.data.prom_price; + //g[i].inter = t.data.data.prom_integral; + if(t.data.code==0){ + + } + + c.setData(a({}, l, g)); + if ("function" == typeof e && (n = e(t)), !1 === n) return !1; + i && 0 != i.length || (s.data.goodsLoadFinishFlag = !0, u && o.showWarning("加载完啦", null, 500, !1)); + return false; + + } + }); + + }, + fail: function(a) { + var t = !0; + return console.log(a), "function" == typeof i && (t = i(a)), t; + }, + complete: function(a) { + s.data.goodsLoading = !1; + } + }), !0); + } + }, { + key: "canloadMore", + value: function() { + console.log("loadMore...Finish:", this.data.goodsLoadFinishFlag); + var a = this; + if (a.data.goodsLoadFinishFlag) return o.showWarning("加载完啦", null, 500, !1), !1; + var t = new Date().getTime(); + return console.log("loadMore...time:", t), t - a.data.scrollTimeStamp > 300 && (a.data.scrollTimeStamp = t, + !0); + } + }, { + key: "resetConfig", + value: function() { + this.data.goodsLoadFinishFlag = !1; + } + } ]), i; +}(); + +exports.default = i; diff --git a/utils/LoadMore2.js b/utils/LoadMore2.js new file mode 100644 index 0000000..376a839 --- /dev/null +++ b/utils/LoadMore2.js @@ -0,0 +1,114 @@ +var oo = require("../setting.js"); +var ut = require('util.js'); + +function a(a, t, e) { + return t in a ? Object.defineProperty(a, t, { + value: e, + enumerable: !0, + configurable: !0, + writable: !0 + }) : a[t] = e, a; +} + +function t(a, t) { + if (!(a instanceof t)) throw new TypeError("Cannot call a class as a function"); +} + +Object.defineProperty(exports, "__esModule", { + value: !0 +}); + +var e = function() { + function a(a, t) { + for (var e = 0; e < t.length; e++) { + var o = t[e]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), + Object.defineProperty(a, o.key, o); + } + } + return function(t, e, o) { + return e && a(t.prototype, e), o && a(t, o), t; + }; +}(), o = getApp(), n = o.request, i = function() { + function i() { + t(this, i), this.data = { + page: null, + listName: "", + resultName: "", + resultListName: "", + scrollTimeStamp: 0, + goodsLoadFinishFlag: !1, + goodsLoading: !1 + }; + } + return e(i, [ { + key: "init", + value: function(a, t, e, o) { + this.data.scrollTimeStamp = 0, this.data.page = a, this.data.listName = t, this.data.resultName = e, + this.data.resultListName = void 0 == o ? t : o, this.data.goodsLoadFinishFlag = !1, + this.data.goodsLoading = !1; + } + }, { + key: "request", + value: function(t, e, i,dd) { + if(dd==undefined) dd=null; + var s = this,rurl=t; + return !s.data.goodsLoading && (s.data.goodsLoading = !0, n.get(t, { + data:dd, + success: function(t) { + var n = !0; + + var i, r = s.data.listName, l = s.data.resultName, d = s.data.resultListName; + i = "" != r ? t.data.data[r] : t.data.data.pageData; //data.pageData是接口固定会出现的,封装好了 + var u = !1, g = null, c = s.data.page; + + console.log('loadmore'); + console.log(t.data.data.pageData); + console.log(c ); + if(t.data.data.pageData.length==0){ + (s.data.goodsLoadFinishFlag = !0, o.showWarning("加载完啦", null, 500, !1)); + return false; + } + + //如果已经的第二页的时候,就是把数据加入数组 + if (c !=undefined && c.data[l]) { + u = !0; + var f = null; + f = "" != d ? c.data[l][d] : c.data[l], [].push.apply(f, i), g = c.data[l]; + } else g = t.data.data.pageData; + + c.setData(a({}, l, g)); + if ("function" == typeof e && (n = e(t)), !1 === n) return !1; + i && 0 != i.length || (s.data.goodsLoadFinishFlag = !0, u && o.showWarning("加载完啦", null, 500, !1)); + return false; + }, + + + fail: function(a) { + var t = !0; + return console.log(a), "function" == typeof i && (t = i(a)), t; + }, + complete: function(a) { + s.data.goodsLoading = !1; + } + }), !0); + } + }, { + key: "canloadMore", + value: function() { + console.log("loadMore...Finish:", this.data.goodsLoadFinishFlag); + var a = this; + if (a.data.goodsLoadFinishFlag) return o.showWarning("加载完啦", null, 500, !1), !1; + var t = new Date().getTime(); + return console.log("loadMore...time:", t), t - a.data.scrollTimeStamp > 300 && (a.data.scrollTimeStamp = t, + !0); + } + }, { + key: "resetConfig", + value: function() { + this.data.goodsLoadFinishFlag = !1; + } + } ]), i; +}(); + +exports.default = i; diff --git a/utils/auth.js b/utils/auth.js new file mode 100644 index 0000000..0a74309 --- /dev/null +++ b/utils/auth.js @@ -0,0 +1,294 @@ +var t = require("./common.js"); +module.exports = { + app: function() { + return getApp(); + }, + auth: function(t) { + var e = this.app(), o = this; + wx.checkSession({ + success: function() { + !e.globalData.wechatUser && o.wxLogin(t); + }, + fail: function() { + o.wxLogin(t); + } + }); + }, + isAuth: function() { + return !!this.app().globalData.wechatUser; + }, + clearAuth: function() { + this.app().globalData.wechatUser = null, wx.setStorageSync("isAuth", !1); + }, + hadAuth: function() { + try { + return !!wx.getStorageSync("isAuth"); + } catch (t) { + return wx.setStorageSync("isAuth", !1), !1; + } + }, + + + login_fir: function (e, o, n) { + + var a = this.app(), app = a, i = this; + + var userinfo= wx.getStorageSync("userinfo"); + if(userinfo){ + a.globalData.userInfo=userinfo; + a.globalData.user_id=userinfo.user_id; + "function" == typeof n && n(a.globalData.userInfo, a.globalData.wechatUser); + return true; + } + + + if (void 0 === e || "" == e) return a.globalData.wechatUser = null, i.alertLoginErrorAndGoHome("登录码为空,请重新尝试"), + !1; + var r = o.userInfo, s = a.globalData.setting.versionCode; + console.log("thirdLogin"); + console.log(e); + a.request.get("/api/weshop/users/openidandkey", { + data: { + js_code: e, + store_id: a.globalData.setting.stoid, + }, + success: function (e) { + console.log("openidandkey"); + console.log(e); + if (e.data.code == 0) { + if (e.data.data.user_id != undefined) { + app.globalData.user_id = e.data.data.user_id; + app.globalData.openid = e.data.data.weapp_openid; + app.globalData.sessionKey = e.data.data.sessionKey; + + wx.setStorageSync("userinfo",e.data.data); + wx.setStorageSync("isAuth", !0), a.globalData.userInfo = e.data.data, a.globalData.userInfo.head_pic = t.getFullUrl(a.globalData.userInfo.head_pic); + "function" == typeof n && n(a.globalData.userInfo, a.globalData.wechatUser); + }else{ + app.globalData.sessionKey = e.data.data.sessionKey; + app.globalData.openid = e.data.data.openid; + app.globalData.getu = r; + + "function" == typeof n && n(); + return false; + } + } else { + return app.showWarning("登入失败!"+e.data.msg); + } + } + }); + }, + + login: function(e, o, n) { + var a = this.app(),app=a, i = this; + if (void 0 === e || "" == e) return a.globalData.wechatUser = null, i.alertLoginErrorAndGoHome("登录码为空,请重新尝试"), + !1; + var r = o.userInfo, s = a.globalData.setting.versionCode; + console.log("thirdLogin"); + console.log(e); + a.request.get("/api/weshop/users/openidandkey", { + data: { + js_code: e, + store_id: a.globalData.setting.stoid, + }, + success: function (e) { + console.log("openidandkey"); + console.log(e); + if(e.data.code==0){ + if (e.data.data.user_id==undefined){ + app.globalData.sessionKey = e.data.data.sessionKey; + app.globalData.openid = e.data.data.openid; + + app.globalData.getu = r; + wx.navigateTo({ + url: '/pages/getphone/getphone', + }) + }else{ + app.globalData.user_id = e.data.data.user_id; + app.globalData.openid = e.data.data.weapp_openid; + app.globalData.sessionKey = e.data.data.sessionKey; + + wx.setStorageSync("userinfo",e.data.data); + wx.setStorageSync("isAuth", !0), a.globalData.userInfo = e.data.data, a.globalData.userInfo.head_pic = t.getFullUrl(a.globalData.userInfo.head_pic); + "function" == typeof n && n(a.globalData.userInfo, a.globalData.wechatUser); + + } + }else{ + return app.showWarning("登入失败!"+e.data.msg); + } + } + }); + }, + + //-------获取用户信息---- + get_u(t){ + var app_d = this.app().globalData, oo = app_d.setting; + var ab = this.app().request; + ab.get("/api/weshop/users/get/" + oo.stoid + "/" + app_d.user_id, { + success: function (e) { + app_d.userInfo = e.data.data; + "function" == typeof t && t(e.data.data); + }, + }); + }, + //-------微信登录-------- + wxLogin: function(t) { + var app_d = this.app().globalData, oo = app_d.setting; + if (app_d.user_id != "" && app_d.user_id != null ){ + var ab = this.app().request; + ab.get("/api/weshop/users/get/" + oo.stoid+"/"+app_d.user_id, { + success: function (e) { + app_d.userInfo = e.data.data; + "function" == typeof t && t(e.data.data); + }, + }); + }else{ + var e = this; + wx.login({ + success: function(o) { + console.log('wxLogin'); + console.log(o); + o.code ? e.doGetWxUser(o.code, t) : wx.showModal({ + title: "获取用户登录态失败", + content: o.errMsg, + showCancel: !1, + complete: function() { + e.goHome(); + } + }); + }, + fail: function(t) { + console.log(t); + } + }); + } + }, + + wxLogin_fir: function (t) { + var app_d = this.app().globalData, oo = app_d.setting; + if (app_d.user_id != "" && app_d.user_id != null) { + var ab = this.app().request; + ab.get("/api/weshop/users/get/" + oo.stoid + "/" + app_d.user_id, { + success: function (e) { + app_d.userInfo = e.data.data; + "function" == typeof t && t(e.data.data); + }, + }); + } else { + var e = this; + wx.login({ + success: function (o) { + console.log('wxLogin'); + console.log(o); + o.code ? e.doGetWxUser(o.code, t,1) : wx.showModal({ + title: "获取用户登录态失败", + content: o.errMsg, + showCancel: !1, + complete: function () { + e.goHome(); + } + }); + }, + fail: function (t) { + console.log(t); + } + }); + } + }, + + + doGetWxUser: function(t, e,ind) { + var o = this, n = o.app(); + n.globalData.code = t; + try { + //获取本地存储 + var a = wx.getStorageSync("wx_user_info"); + var userInfo = a.userInfo; + if (userInfo==undefined){ //判断本地是数据是否正确 + wx.getUserInfo({ + success: function (res) + { + console.log('doGetWxUser'); + console.log(res); + console.log(ind); + //组装用户 + var ar = {'nickName':res.userInfo.nickName, + 'avatarUrl':res.userInfo.avatarUrl, + 'gender': res.userInfo.gender}; + //----会员记录到全局------ + n.globalData.getu = ar; + var uu = {'userInfo': ar}; + a=uu; + + if(ind==1){ + a && void 0 != a ? (n.globalData.wechatUser = a, o.login_fir(t, a, e)) : o.goGetUserInfo(); + }else{ + a && void 0 != a ? (n.globalData.wechatUser = a, o.login(t, a, e)) : o.goGetUserInfo(); + } + + }, + + fail: function () { + //---获取用户信息失败后。请跳转授权页面-- + wx.showModal({ + title: '警告', + content: '尚未进行授权,请点击确定跳转到授权页面进行授权。', + success: function (res) { + if (res.confirm) { + console.log('用户点击确定') + wx.navigateTo({ + url: '/pages/togoin/togoin', + }) + } + } + }) + } + + }) + }else{ + a && void 0 != a ? (n.globalData.wechatUser = a, o.login(t, a, e)) : o.goGetUserInfo(); + } + + } catch (t) { + o.goGetUserInfo(); + } + }, + + failGetWxUser: function(t, e) { + var o = this; + wx.showModal({ + title: "请先授权登录哦", + success: function(t) { + t.confirm ? o.goGetUserInfo() : t.cancel && o.alertNoAuthAndGoHome(); + }, + fail: function(t) { + o.goHome(); + } + }); + }, + + //一些提示的方法 + alertNoAuthAndGoHome: function() { + var t = this; + this.app().showWarning("你尚未授权登录", function() { + t.goHome(); + }, null, !0); + }, + alertLoginErrorAndGoHome: function(t) { + "string" == typeof t && "" != t || (t = "登录时发生错误"); + var e = this; + this.app().showWarning(t, function() { + e.goHome(); + }, null, !0); + }, + goHome: function() { + wx.switchTab({ + url: "/pages/index/index/index" + }); + }, + goGetUserInfo: function() { + wx.navigateTo({ + url: "/pages/user/get_user_info/get_user_info" + }); + } +}; diff --git a/utils/barcode.js b/utils/barcode.js new file mode 100644 index 0000000..57fca94 --- /dev/null +++ b/utils/barcode.js @@ -0,0 +1,402 @@ +var CHAR_TILDE = 126; +var CODE_FNC1 = 102; + +var SET_STARTA = 103; +var SET_STARTB = 104; +var SET_STARTC = 105; +var SET_SHIFT = 98; +var SET_CODEA = 101; +var SET_CODEB = 100; +var SET_STOP = 106; + + +var REPLACE_CODES = { + CHAR_TILDE: CODE_FNC1 //~ corresponds to FNC1 in GS1-128 standard +} + +var CODESET = { + ANY: 1, + AB: 2, + A: 3, + B: 4, + C: 5 +}; + +function getBytes(str) { + var bytes = []; + for (var i = 0; i < str.length; i++) { + bytes.push(str.charCodeAt(i)); + } + return bytes; +} + +exports.code128 = function (ctx, text, width, height) { + + width = parseInt(width); + + height = parseInt(height); + + var codes = stringToCode128(text); + + var g = new Graphics(ctx, width, height); + + var barWeight = g.area.width / ((codes.length - 3) * 11 + 35); + + var x = g.area.left; + var y = g.area.top; + for (var i = 0; i < codes.length; i++) { + var c = codes[i]; + //two bars at a time: 1 black and 1 white + for (var bar = 0; bar < 8; bar += 2) { + var barW = PATTERNS[c][bar] * barWeight; + // var barH = height - y - this.border; + var barH = height - y; + var spcW = PATTERNS[c][bar + 1] * barWeight; + + //no need to draw if 0 width + if (barW > 0) { + g.fillFgRect(x, y, barW, barH); + } + + x += barW + spcW; + } + } + + ctx.draw(); +} + + +function stringToCode128(text) { + + var barc = { + currcs: CODESET.C + }; + + var bytes = getBytes(text); + //decide starting codeset + var index = bytes[0] == CHAR_TILDE ? 1 : 0; + + var csa1 = bytes.length > 0 ? codeSetAllowedFor(bytes[index++]) : CODESET.AB; + var csa2 = bytes.length > 0 ? codeSetAllowedFor(bytes[index++]) : CODESET.AB; + barc.currcs = getBestStartSet(csa1, csa2); + barc.currcs = perhapsCodeC(bytes, barc.currcs); + + //if no codeset changes this will end up with bytes.length+3 + //start, checksum and stop + var codes = new Array(); + + switch (barc.currcs) { + case CODESET.A: + codes.push(SET_STARTA); + break; + case CODESET.B: + codes.push(SET_STARTB); + break; + default: + codes.push(SET_STARTC); + break; + } + + + for (var i = 0; i < bytes.length; i++) { + var b1 = bytes[i]; //get the first of a pair + //should we translate/replace + if (b1 in REPLACE_CODES) { + codes.push(REPLACE_CODES[b1]); + i++ //jump to next + b1 = bytes[i]; + } + + //get the next in the pair if possible + var b2 = bytes.length > (i + 1) ? bytes[i + 1] : -1; + + codes = codes.concat(codesForChar(b1, b2, barc.currcs)); + //code C takes 2 chars each time + if (barc.currcs == CODESET.C) i++; + } + + //calculate checksum according to Code 128 standards + var checksum = codes[0]; + for (var weight = 1; weight < codes.length; weight++) { + checksum += (weight * codes[weight]); + } + codes.push(checksum % 103); + + codes.push(SET_STOP); + + //encoding should now be complete + return codes; + + function getBestStartSet(csa1, csa2) { + //tries to figure out the best codeset + //to start with to get the most compact code + var vote = 0; + vote += csa1 == CODESET.A ? 1 : 0; + vote += csa1 == CODESET.B ? -1 : 0; + vote += csa2 == CODESET.A ? 1 : 0; + vote += csa2 == CODESET.B ? -1 : 0; + //tie goes to B due to my own predudices + return vote > 0 ? CODESET.A : CODESET.B; + } + + function perhapsCodeC(bytes, codeset) { + for (var i = 0; i < bytes.length; i++) { + var b = bytes[i] + if ((b < 48 || b > 57) && b != CHAR_TILDE) + return codeset; + } + return CODESET.C; + } + + //chr1 is current byte + //chr2 is the next byte to process. looks ahead. + function codesForChar(chr1, chr2, currcs) { + var result = []; + var shifter = -1; + + if (charCompatible(chr1, currcs)) { + if (currcs == CODESET.C) { + if (chr2 == -1) { + shifter = SET_CODEB; + currcs = CODESET.B; + } + else if ((chr2 != -1) && !charCompatible(chr2, currcs)) { + //need to check ahead as well + if (charCompatible(chr2, CODESET.A)) { + shifter = SET_CODEA; + currcs = CODESET.A; + } + else { + shifter = SET_CODEB; + currcs = CODESET.B; + } + } + } + } + else { + //if there is a next char AND that next char is also not compatible + if ((chr2 != -1) && !charCompatible(chr2, currcs)) { + //need to switch code sets + switch (currcs) { + case CODESET.A: + shifter = SET_CODEB; + currcs = CODESET.B; + break; + case CODESET.B: + shifter = SET_CODEA; + currcs = CODESET.A; + break; + } + } + else { + //no need to shift code sets, a temporary SHIFT will suffice + shifter = SET_SHIFT; + } + } + + //ok some type of shift is nessecary + if (shifter != -1) { + result.push(shifter); + result.push(codeValue(chr2)); + } + else { + if (currcs == CODESET.C) { + //include next as well + result.push(codeValue(chr1, chr2)); + } + else { + result.push(codeValue(chr1)); + } + } + barc.currcs = currcs; + + return result; + } +} + +//reduce the ascii code to fit into the Code128 char table +function codeValue(chr1, chr2) { + if (typeof chr2 == "undefined") { + return chr1 >= 32 ? chr1 - 32 : chr1 + 64; + } + else { + return parseInt(String.fromCharCode(chr1) + String.fromCharCode(chr2)); + } +} + +function charCompatible(chr, codeset) { + var csa = codeSetAllowedFor(chr); + if (csa == CODESET.ANY) return true; + //if we need to change from current + if (csa == CODESET.AB) return true; + if (csa == CODESET.A && codeset == CODESET.A) return true; + if (csa == CODESET.B && codeset == CODESET.B) return true; + return false; +} + +function codeSetAllowedFor(chr) { + if (chr >= 48 && chr <= 57) { + //0-9 + return CODESET.ANY; + } + else if (chr >= 32 && chr <= 95) { + //0-9 A-Z + return CODESET.AB; + } + else { + //if non printable + return chr < 32 ? CODESET.A : CODESET.B; + } +} + +var Graphics = function (ctx, width, height) { + + this.width = width; + this.height = height; + this.quiet = Math.round(this.width / 40); + + this.border_size = 0; + this.padding_width = 0; + + this.area = { + width: width - this.padding_width * 2 - this.quiet * 2, + height: height - this.border_size * 2, + top: this.border_size - 4, + left: this.padding_width + this.quiet + }; + + this.ctx = ctx; + this.fg = "#000000"; + this.bg = "#ffffff"; + + // fill background + this.fillBgRect(0, 0, width, height); + + // fill center to create border + this.fillBgRect(0, this.border_size, width, height - this.border_size * 2); +} + +//use native color +Graphics.prototype._fillRect = function (x, y, width, height, color) { + this.ctx.setFillStyle(color) + this.ctx.fillRect(x, y, width, height) +} + +Graphics.prototype.fillFgRect = function (x, y, width, height) { + this._fillRect(x, y, width, height, this.fg); +} + +Graphics.prototype.fillBgRect = function (x, y, width, height) { + this._fillRect(x, y, width, height, this.bg); +} + +var PATTERNS = [ + [2, 1, 2, 2, 2, 2, 0, 0], // 0 + [2, 2, 2, 1, 2, 2, 0, 0], // 1 + [2, 2, 2, 2, 2, 1, 0, 0], // 2 + [1, 2, 1, 2, 2, 3, 0, 0], // 3 + [1, 2, 1, 3, 2, 2, 0, 0], // 4 + [1, 3, 1, 2, 2, 2, 0, 0], // 5 + [1, 2, 2, 2, 1, 3, 0, 0], // 6 + [1, 2, 2, 3, 1, 2, 0, 0], // 7 + [1, 3, 2, 2, 1, 2, 0, 0], // 8 + [2, 2, 1, 2, 1, 3, 0, 0], // 9 + [2, 2, 1, 3, 1, 2, 0, 0], // 10 + [2, 3, 1, 2, 1, 2, 0, 0], // 11 + [1, 1, 2, 2, 3, 2, 0, 0], // 12 + [1, 2, 2, 1, 3, 2, 0, 0], // 13 + [1, 2, 2, 2, 3, 1, 0, 0], // 14 + [1, 1, 3, 2, 2, 2, 0, 0], // 15 + [1, 2, 3, 1, 2, 2, 0, 0], // 16 + [1, 2, 3, 2, 2, 1, 0, 0], // 17 + [2, 2, 3, 2, 1, 1, 0, 0], // 18 + [2, 2, 1, 1, 3, 2, 0, 0], // 19 + [2, 2, 1, 2, 3, 1, 0, 0], // 20 + [2, 1, 3, 2, 1, 2, 0, 0], // 21 + [2, 2, 3, 1, 1, 2, 0, 0], // 22 + [3, 1, 2, 1, 3, 1, 0, 0], // 23 + [3, 1, 1, 2, 2, 2, 0, 0], // 24 + [3, 2, 1, 1, 2, 2, 0, 0], // 25 + [3, 2, 1, 2, 2, 1, 0, 0], // 26 + [3, 1, 2, 2, 1, 2, 0, 0], // 27 + [3, 2, 2, 1, 1, 2, 0, 0], // 28 + [3, 2, 2, 2, 1, 1, 0, 0], // 29 + [2, 1, 2, 1, 2, 3, 0, 0], // 30 + [2, 1, 2, 3, 2, 1, 0, 0], // 31 + [2, 3, 2, 1, 2, 1, 0, 0], // 32 + [1, 1, 1, 3, 2, 3, 0, 0], // 33 + [1, 3, 1, 1, 2, 3, 0, 0], // 34 + [1, 3, 1, 3, 2, 1, 0, 0], // 35 + [1, 1, 2, 3, 1, 3, 0, 0], // 36 + [1, 3, 2, 1, 1, 3, 0, 0], // 37 + [1, 3, 2, 3, 1, 1, 0, 0], // 38 + [2, 1, 1, 3, 1, 3, 0, 0], // 39 + [2, 3, 1, 1, 1, 3, 0, 0], // 40 + [2, 3, 1, 3, 1, 1, 0, 0], // 41 + [1, 1, 2, 1, 3, 3, 0, 0], // 42 + [1, 1, 2, 3, 3, 1, 0, 0], // 43 + [1, 3, 2, 1, 3, 1, 0, 0], // 44 + [1, 1, 3, 1, 2, 3, 0, 0], // 45 + [1, 1, 3, 3, 2, 1, 0, 0], // 46 + [1, 3, 3, 1, 2, 1, 0, 0], // 47 + [3, 1, 3, 1, 2, 1, 0, 0], // 48 + [2, 1, 1, 3, 3, 1, 0, 0], // 49 + [2, 3, 1, 1, 3, 1, 0, 0], // 50 + [2, 1, 3, 1, 1, 3, 0, 0], // 51 + [2, 1, 3, 3, 1, 1, 0, 0], // 52 + [2, 1, 3, 1, 3, 1, 0, 0], // 53 + [3, 1, 1, 1, 2, 3, 0, 0], // 54 + [3, 1, 1, 3, 2, 1, 0, 0], // 55 + [3, 3, 1, 1, 2, 1, 0, 0], // 56 + [3, 1, 2, 1, 1, 3, 0, 0], // 57 + [3, 1, 2, 3, 1, 1, 0, 0], // 58 + [3, 3, 2, 1, 1, 1, 0, 0], // 59 + [3, 1, 4, 1, 1, 1, 0, 0], // 60 + [2, 2, 1, 4, 1, 1, 0, 0], // 61 + [4, 3, 1, 1, 1, 1, 0, 0], // 62 + [1, 1, 1, 2, 2, 4, 0, 0], // 63 + [1, 1, 1, 4, 2, 2, 0, 0], // 64 + [1, 2, 1, 1, 2, 4, 0, 0], // 65 + [1, 2, 1, 4, 2, 1, 0, 0], // 66 + [1, 4, 1, 1, 2, 2, 0, 0], // 67 + [1, 4, 1, 2, 2, 1, 0, 0], // 68 + [1, 1, 2, 2, 1, 4, 0, 0], // 69 + [1, 1, 2, 4, 1, 2, 0, 0], // 70 + [1, 2, 2, 1, 1, 4, 0, 0], // 71 + [1, 2, 2, 4, 1, 1, 0, 0], // 72 + [1, 4, 2, 1, 1, 2, 0, 0], // 73 + [1, 4, 2, 2, 1, 1, 0, 0], // 74 + [2, 4, 1, 2, 1, 1, 0, 0], // 75 + [2, 2, 1, 1, 1, 4, 0, 0], // 76 + [4, 1, 3, 1, 1, 1, 0, 0], // 77 + [2, 4, 1, 1, 1, 2, 0, 0], // 78 + [1, 3, 4, 1, 1, 1, 0, 0], // 79 + [1, 1, 1, 2, 4, 2, 0, 0], // 80 + [1, 2, 1, 1, 4, 2, 0, 0], // 81 + [1, 2, 1, 2, 4, 1, 0, 0], // 82 + [1, 1, 4, 2, 1, 2, 0, 0], // 83 + [1, 2, 4, 1, 1, 2, 0, 0], // 84 + [1, 2, 4, 2, 1, 1, 0, 0], // 85 + [4, 1, 1, 2, 1, 2, 0, 0], // 86 + [4, 2, 1, 1, 1, 2, 0, 0], // 87 + [4, 2, 1, 2, 1, 1, 0, 0], // 88 + [2, 1, 2, 1, 4, 1, 0, 0], // 89 + [2, 1, 4, 1, 2, 1, 0, 0], // 90 + [4, 1, 2, 1, 2, 1, 0, 0], // 91 + [1, 1, 1, 1, 4, 3, 0, 0], // 92 + [1, 1, 1, 3, 4, 1, 0, 0], // 93 + [1, 3, 1, 1, 4, 1, 0, 0], // 94 + [1, 1, 4, 1, 1, 3, 0, 0], // 95 + [1, 1, 4, 3, 1, 1, 0, 0], // 96 + [4, 1, 1, 1, 1, 3, 0, 0], // 97 + [4, 1, 1, 3, 1, 1, 0, 0], // 98 + [1, 1, 3, 1, 4, 1, 0, 0], // 99 + [1, 1, 4, 1, 3, 1, 0, 0], // 100 + [3, 1, 1, 1, 4, 1, 0, 0], // 101 + [4, 1, 1, 1, 3, 1, 0, 0], // 102 + [2, 1, 1, 4, 1, 2, 0, 0], // 103 + [2, 1, 1, 2, 1, 4, 0, 0], // 104 + [2, 1, 1, 2, 3, 2, 0, 0], // 105 + [2, 3, 3, 1, 1, 1, 2, 0] // 106 +] + diff --git a/utils/common.js b/utils/common.js new file mode 100644 index 0000000..2af9ffd --- /dev/null +++ b/utils/common.js @@ -0,0 +1,87 @@ +function e(e, t, r) { + return t in e ? Object.defineProperty(e, t, { + value: r, + enumerable: !0, + configurable: !0, + writable: !0 + }) : e[t] = r, e; +} + +var t = require("util.js"); + +module.exports = { + app: function() { + return getApp(); + }, + + //------------获取全路径的图片地址----------- + getFullUrl: function(e) { + if(e==undefined || e=="") return ""; + if(e.indexOf("http")!=-1) return e; + e=this.app().globalData.setting.imghost + e; + return e; + }, + getConfigByName: function(e, t, r) { + for (var a = 0; a < e.length; a++) if (e[a].name === t && (void 0 === r || void 0 !== r && e[a].inc_type === r)) return e[a].value; + return console.warn(t), console.warn(e), null; + }, + + //--------跳转到支付页面-------- + jumpToCart4: function(e, r) { + var a = { + order_sn: e.order_sn, + order_amount: e.order_amount + }; + + //t=1正常单 2组合单 + if(e.type==1){ a.type=1; } + e.master_order_sn && (a.master_order_sn = e.master_order_sn); + var n = "/pages/cart/cart4/cart4?" + t.Obj2Str(a); + r ? wx.redirectTo({ + url: n + }) : wx.navigateTo({ + url: n + }); + }, + getCapache: function() { + return this.app().request.modifyUrl("/api/user/verify?is_image=1&t=" + Date.parse(new Date())); + }, + wxParseAddFullImageUrl: function(t, r) { + if (void 0 !== t.data[r].images) { + for (var a = t.data[r], n = 0; n < a.images.length; n++) a.images[n].attr.src = this.getFullUrl(a.images[n].attr.src), + a.imageUrls[n] = this.getFullUrl(a.imageUrls[n]); + console.log(a), t.setData(e({}, r, a)); + } + }, + sendSmsCode: function(e, t, r) { + a = this; + if (!e) return a.app().showWarning("手机号码不能为空"); + void 0 !== t && null !== t || (t = 6); + var a = this; + this.app().request.post("/home/api/send_validate_code", { + data: { + mobile: e, + scene: t, + type: "mobile" + }, + success: function(e) { + "function" == typeof r && r(), a.app().confirmBox(e.data.msg); + } + }); + }, + sendBindSmsCode: function(e, t) { + r = this; + if (!e) return r.app().showWarning("手机号码不能为空"); + var r = this; + this.app().request.post("/home/api/send_validate_code", { + data: { + mobile: e, + scene: "1", + type: "user_reg" + }, + success: function(e) { + "function" == typeof t && t(), r.app().confirmBox(e.data.msg); + } + }); + } +}; \ No newline at end of file diff --git a/utils/filter.wxs b/utils/filter.wxs new file mode 100644 index 0000000..b93f1a2 --- /dev/null +++ b/utils/filter.wxs @@ -0,0 +1,34 @@ +var filters = { + toFix:function(val,count){ + return val.toFixed(count) + }, + replace_time:function(val){ + if(!val) return "不限"; + return val.replace("00:00:00",""); + }, + + replace_time2: function (val) { + var a = val.split(" "); + return a[0]; + }, + + format_time:function(ts,isFull) { + var d = getDate(ts*1000) + var fm=[d.getFullYear(), d.getMonth()+1, d.getDate()].join('-'); + if(isFull==1) + fm=fm + ' '+ [d.getHours(), d.getMinutes(), d.getSeconds()].join(':') + return fm; + } + + pInt:function(t) { + var d = parseInt(t); return d; + } + +} +module.exports = { + toFix: filters.toFix, + replace_time:filters.replace_time, + replace_time2: filters.replace_time2, + format_time:filters.format_time, + pInt:filters.pInt +} \ No newline at end of file diff --git a/utils/index.js b/utils/index.js new file mode 100644 index 0000000..96304b3 --- /dev/null +++ b/utils/index.js @@ -0,0 +1,37 @@ +var barcode = require('./barcode'); +var qrcode = require('./qrcode'); + +function convert_length(length) { + return Math.round(wx.getSystemInfoSync().windowWidth * length / 750); +} + +function barc(id, code, width, height,ob) { + var ctx=null; + if(ob){ + ctx= wx.createCanvasContext(id,ob) + }else{ + ctx=wx.createCanvasContext(id) + } + barcode.code128(ctx, code, convert_length(width), convert_length(height)) + return ctx; +} + +function qrc(id, code, width, height,ob) { + var ctx=null; + if(ob) { + ctx= wx.createCanvasContext(id,ob); + }else{ + ctx=wx.createCanvasContext(id) + } + qrcode.api.draw(code, { + ctx:ctx, + width: convert_length(width), + height: convert_length(height) + }) + return ctx; +} + +module.exports = { + barcode: barc, + qrcode: qrc +} \ No newline at end of file diff --git a/utils/md5.js b/utils/md5.js new file mode 100644 index 0000000..9b6af26 --- /dev/null +++ b/utils/md5.js @@ -0,0 +1,52 @@ +function n(n, r) { + var t = (65535 & n) + (65535 & r); + return (n >> 16) + (r >> 16) + (t >> 16) << 16 | 65535 & t; +} + +function r(n, r) { + return n << r | n >>> 32 - r; +} + +function t(t, u, e, o, c, f) { + return n(r(n(n(u, t), n(o, f)), c), e); +} + +function u(n, r, u, e, o, c, f) { + return t(r & u | ~r & e, n, r, o, c, f); +} + +function e(n, r, u, e, o, c, f) { + return t(r & e | u & ~e, n, r, o, c, f); +} + +function o(n, r, u, e, o, c, f) { + return t(r ^ u ^ e, n, r, o, c, f); +} + +function c(n, r, u, e, o, c, f) { + return t(u ^ (r | ~e), n, r, o, c, f); +} + +function f(r) { + for (var t = 1732584193, f = -271733879, i = -1732584194, a = 271733878, h = 0; h < r.length; h += 16) { + var l = t, g = f, v = i, d = a; + f = c(f = c(f = c(f = c(f = o(f = o(f = o(f = o(f = e(f = e(f = e(f = e(f = u(f = u(f = u(f = u(f, i = u(i, a = u(a, t = u(t, f, i, a, r[h + 0], 7, -680876936), f, i, r[h + 1], 12, -389564586), t, f, r[h + 2], 17, 606105819), a, t, r[h + 3], 22, -1044525330), i = u(i, a = u(a, t = u(t, f, i, a, r[h + 4], 7, -176418897), f, i, r[h + 5], 12, 1200080426), t, f, r[h + 6], 17, -1473231341), a, t, r[h + 7], 22, -45705983), i = u(i, a = u(a, t = u(t, f, i, a, r[h + 8], 7, 1770035416), f, i, r[h + 9], 12, -1958414417), t, f, r[h + 10], 17, -42063), a, t, r[h + 11], 22, -1990404162), i = u(i, a = u(a, t = u(t, f, i, a, r[h + 12], 7, 1804603682), f, i, r[h + 13], 12, -40341101), t, f, r[h + 14], 17, -1502002290), a, t, r[h + 15], 22, 1236535329), i = e(i, a = e(a, t = e(t, f, i, a, r[h + 1], 5, -165796510), f, i, r[h + 6], 9, -1069501632), t, f, r[h + 11], 14, 643717713), a, t, r[h + 0], 20, -373897302), i = e(i, a = e(a, t = e(t, f, i, a, r[h + 5], 5, -701558691), f, i, r[h + 10], 9, 38016083), t, f, r[h + 15], 14, -660478335), a, t, r[h + 4], 20, -405537848), i = e(i, a = e(a, t = e(t, f, i, a, r[h + 9], 5, 568446438), f, i, r[h + 14], 9, -1019803690), t, f, r[h + 3], 14, -187363961), a, t, r[h + 8], 20, 1163531501), i = e(i, a = e(a, t = e(t, f, i, a, r[h + 13], 5, -1444681467), f, i, r[h + 2], 9, -51403784), t, f, r[h + 7], 14, 1735328473), a, t, r[h + 12], 20, -1926607734), i = o(i, a = o(a, t = o(t, f, i, a, r[h + 5], 4, -378558), f, i, r[h + 8], 11, -2022574463), t, f, r[h + 11], 16, 1839030562), a, t, r[h + 14], 23, -35309556), i = o(i, a = o(a, t = o(t, f, i, a, r[h + 1], 4, -1530992060), f, i, r[h + 4], 11, 1272893353), t, f, r[h + 7], 16, -155497632), a, t, r[h + 10], 23, -1094730640), i = o(i, a = o(a, t = o(t, f, i, a, r[h + 13], 4, 681279174), f, i, r[h + 0], 11, -358537222), t, f, r[h + 3], 16, -722521979), a, t, r[h + 6], 23, 76029189), i = o(i, a = o(a, t = o(t, f, i, a, r[h + 9], 4, -640364487), f, i, r[h + 12], 11, -421815835), t, f, r[h + 15], 16, 530742520), a, t, r[h + 2], 23, -995338651), i = c(i, a = c(a, t = c(t, f, i, a, r[h + 0], 6, -198630844), f, i, r[h + 7], 10, 1126891415), t, f, r[h + 14], 15, -1416354905), a, t, r[h + 5], 21, -57434055), i = c(i, a = c(a, t = c(t, f, i, a, r[h + 12], 6, 1700485571), f, i, r[h + 3], 10, -1894986606), t, f, r[h + 10], 15, -1051523), a, t, r[h + 1], 21, -2054922799), i = c(i, a = c(a, t = c(t, f, i, a, r[h + 8], 6, 1873313359), f, i, r[h + 15], 10, -30611744), t, f, r[h + 6], 15, -1560198380), a, t, r[h + 13], 21, 1309151649), i = c(i, a = c(a, t = c(t, f, i, a, r[h + 4], 6, -145523070), f, i, r[h + 11], 10, -1120210379), t, f, r[h + 2], 15, 718787259), a, t, r[h + 9], 21, -343485551), + t = n(t, l), f = n(f, g), i = n(i, v), a = n(a, d); + } + return [ t, f, i, a ]; +} + +function i(n) { + for (var r = "", t = 0; t < 4 * n.length; t++) r += "0123456789abcdef".charAt(n[t >> 2] >> t % 4 * 8 + 4 & 15) + "0123456789abcdef".charAt(n[t >> 2] >> t % 4 * 8 & 15); + return r; +} + +function a(n) { + for (var r = 1 + (n.length + 8 >> 6), t = new Array(16 * r), u = 0; u < 16 * r; u++) t[u] = 0; + for (u = 0; u < n.length; u++) t[u >> 2] |= (255 & n.charCodeAt(u)) << u % 4 * 8; + return t[u >> 2] |= 128 << u % 4 * 8, t[16 * r - 2] = 8 * n.length, t; +} + +module.exports = function(n) { + return i(f(a(n))); +}; \ No newline at end of file diff --git a/utils/page_need.wxs b/utils/page_need.wxs new file mode 100644 index 0000000..5ffe45f --- /dev/null +++ b/utils/page_need.wxs @@ -0,0 +1,57 @@ + +var formatNumber = function(n){ + n = n.toString() + return n[1] ? n : '0' + n +} + +var regYear = getRegExp("(y+)", "i"); + +var dateFormat = function(timestamp,format){ + if (!format) { + format = "yyyy-MM-dd hh:mm:ss"; + } + timestamp = parseInt(timestamp); + var realDate = getDate(timestamp); + + console.log('time2323'); + console.log(timestamp); + console.log(realDate); + + + function timeFormat(num) { + return num < 10 ? '0' + num : num; + } + var date = [ + ["M+", timeFormat(realDate.getMonth() + 1)], + ["d+", timeFormat(realDate.getDate())], + ["h+", timeFormat(realDate.getHours())], + ["m+", timeFormat(realDate.getMinutes())], + ["s+", timeFormat(realDate.getSeconds())], + ["q+", Math.floor((realDate.getMonth() + 3) / 3)], + ["S+", realDate.getMilliseconds()], + ]; + var reg1 = regYear.exec(format); + console.log('12121'); + console.log(reg1[0]); + console.log(realDate.getFullYear()); + if (reg1) { + + format = format.replace(reg1[1], (realDate.getFullYear() + '').substring(4 - reg1[1].length)); + } + for (var i=0;i + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * + * See Main.js for Author/license details + */ + +function utf16to8(str) { + var out, i, len, c; + + out = ""; + len = str.length; + for (i = 0; i < len; i++) { + c = str.charCodeAt(i); + if ((c >= 0x0001) && (c <= 0x007F)) { + out += str.charAt(i); + } else if (c > 0x07FF) { + out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F)); + out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F)); + out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); + } else { + out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F)); + out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); + } + } + return out; +} + +function utf8to16(str) { + var out, i, len, c; + var char2, char3; + + out = ""; + len = str.length; + i = 0; + while (i < len) { + c = str.charCodeAt(i++); + switch (c >> 4) { + case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: + // 0xxxxxxx + out += str.charAt(i - 1); + break; + case 12: case 13: + // 110x xxxx 10xx xxxx + char2 = str.charCodeAt(i++); + out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F)); + break; + case 14: + // 1110 xxxx 10xx xxxx 10xx xxxx + char2 = str.charCodeAt(i++); + char3 = str.charCodeAt(i++); + out += String.fromCharCode(((c & 0x0F) << 12) | + ((char2 & 0x3F) << 6) | + ((char3 & 0x3F) << 0)); + break; + } + } + return out; +} + + +function HTML_AJAX_Serialize_PHP() {} +HTML_AJAX_Serialize_PHP.prototype = { + error: false, + message: "", + cont: "", + defaultEncoding: 'UTF-8', + contentType: 'application/php-serialized; charset: UTF-8', + // {{{ serialize + /** + * Serializes a variable + * + * @param mixed inp the variable to serialize + * @return string a string representation of the input, + * which can be reconstructed by unserialize() + * @author Arpad Ray + * @author David Coallier + */ + serialize: function(inp) { + var type = HTML_AJAX_Util.getType(inp); + var val; + switch (type) { + case "undefined": + val = "N"; + break; + case "boolean": + val = "b:" + (inp ? "1" : "0"); + break; + case "number": + val = (Math.round(inp) == inp ? "i" : "d") + ":" + inp; + break; + case "string": + val = "s:" + inp.length + ":\"" + inp + "\""; + break; + case "array": + val = "a"; + case "object": + if (type == "object") { + var objname = inp.constructor.toString().match(/(\w+)\(\)/); + if (objname == undefined) { + return; + } + objname[1] = this.serialize(objname[1]); + val = "O" + objname[1].substring(1, objname[1].length - 1); + } + var count = 0; + var vals = ""; + var okey; + for (key in inp) { + okey = (key.match(/^[0-9]+$/) ? parseInt(key) : key); + vals += this.serialize(okey) + + this.serialize(inp[key]); + count++; + } + val += ":" + count + ":{" + vals + "}"; + break; + } + if (type != "object" && type != "array") val += ";"; + return val; + }, + // }}} + // {{{ unserialize + /** + * Reconstructs a serialized variable + * + * @param string inp the string to reconstruct + * @return mixed the variable represented by the input string, or void on failure + */ + unserialize: function(inp) { + this.error = 0; + if (inp == "" || inp.length < 2) { + this.raiseError("input is too short"); + return; + } + var val, kret, vret, cval; + var type = inp.charAt(0); + var cont = inp.substring(2); + var size = 0, divpos = 0, endcont = 0, rest = "", next = ""; + + switch (type) { + case "N": // null + if (inp.charAt(1) != ";") { + this.raiseError("missing ; for null", cont); + } + // leave val undefined + rest = cont; + break; + case "b": // boolean + if (!/[01];/.test(cont.substring(0,2))) { + this.raiseError("value not 0 or 1, or missing ; for boolean", cont); + } + val = (cont.charAt(0) == "1"); + rest = cont.substring(1); + break; + case "s": // string + val = ""; + divpos = cont.indexOf(":"); + if (divpos == -1) { + this.raiseError("missing : for string", cont); + break; + } + size = parseInt(cont.substring(0, divpos)); + if (size == 0) { + if (cont.length - divpos < 4) { + this.raiseError("string is too short", cont); + break; + } + rest = cont.substring(divpos + 4); + break; + } + if ((cont.length - divpos - size) < 4) { + this.raiseError("string is too short", cont); + break; + } + if (cont.substring(divpos + 2 + size, divpos + 4 + size) != "\";") { + this.raiseError("string is too long, or missing \";", cont); + } + val = cont.substring(divpos + 2, divpos + 2 + size); + rest = cont.substring(divpos + 4 + size); + break; + case "i": // integer + case "d": // float + var dotfound = 0; + for (var i = 0; i < cont.length; i++) { + cval = cont.charAt(i); + if (isNaN(parseInt(cval)) && !(type == "d" && cval == "." && !dotfound++)) { + endcont = i; + break; + } + } + if (!endcont || cont.charAt(endcont) != ";") { + this.raiseError("missing or invalid value, or missing ; for int/float", cont); + } + val = cont.substring(0, endcont); + val = (type == "i" ? parseInt(val) : parseFloat(val)); + rest = cont.substring(endcont + 1); + break; + case "a": // array + if (cont.length < 4) { + this.raiseError("array is too short", cont); + return; + } + divpos = cont.indexOf(":", 1); + if (divpos == -1) { + this.raiseError("missing : for array", cont); + return; + } + size = parseInt(cont.substring(0, divpos)); + cont = cont.substring(divpos + 2); + val = new Array(); + if (cont.length < 1) { + this.raiseError("array is too short", cont); + return; + } + for (var i = 0; i < size; i++) { + kret = this.unserialize(cont, 1); + if (this.error || kret[0] == undefined || kret[1] == "") { + this.raiseError("missing or invalid key, or missing value for array", cont); + return; + } + vret = this.unserialize(kret[1], 1); + if (this.error) { + this.raiseError("invalid value for array", cont); + return; + } + val[kret[0]] = vret[0]; + cont = vret[1]; + } + if (cont.charAt(0) != "}") { + this.raiseError("missing ending }, or too many values for array", cont); + return; + } + rest = cont.substring(1); + break; + case "O": // object + divpos = cont.indexOf(":"); + if (divpos == -1) { + this.raiseError("missing : for object", cont); + return; + } + size = parseInt(cont.substring(0, divpos)); + var objname = cont.substring(divpos + 2, divpos + 2 + size); + if (cont.substring(divpos + 2 + size, divpos + 4 + size) != "\":") { + this.raiseError("object name is too long, or missing \":", cont); + return; + } + var objprops = this.unserialize("a:" + cont.substring(divpos + 4 + size), 1); + if (this.error) { + this.raiseError("invalid object properties", cont); + return; + } + rest = objprops[1]; + var objout = "function " + objname + "(){"; + for (key in objprops[0]) { + objout += "this." + key + "=objprops[0]['" + key + "'];"; + } + objout += "}val=new " + objname + "();"; + eval(objout); + break; + default: + this.raiseError("invalid input type", cont); + } + return (arguments.length == 1 ? val : [val, rest]); + }, + // }}} + // {{{ getError + /** + * Gets the last error message + * + * @return string the last error message from unserialize() + */ + getError: function() { + return this.message + "\n" + this.cont; + }, + // }}} + // {{{ raiseError + /** + * Raises an eror (called by unserialize().) + * + * @param string message the error message + * @param string cont the remaining unserialized content + */ + raiseError: function(message, cont) { + this.error = 1; + this.message = message; + this.cont = cont; + } + // }}} +} +// }}} + diff --git a/utils/qrcode.js b/utils/qrcode.js new file mode 100644 index 0000000..7f3826e --- /dev/null +++ b/utils/qrcode.js @@ -0,0 +1,769 @@ +var QR = (function () { + + // alignment pattern + var adelta = [ + 0, 11, 15, 19, 23, 27, 31, // force 1 pat + 16, 18, 20, 22, 24, 26, 28, 20, 22, 24, 24, 26, 28, 28, 22, 24, 24, + 26, 26, 28, 28, 24, 24, 26, 26, 26, 28, 28, 24, 26, 26, 26, 28, 28 + ]; + + // version block + var vpat = [ + 0xc94, 0x5bc, 0xa99, 0x4d3, 0xbf6, 0x762, 0x847, 0x60d, + 0x928, 0xb78, 0x45d, 0xa17, 0x532, 0x9a6, 0x683, 0x8c9, + 0x7ec, 0xec4, 0x1e1, 0xfab, 0x08e, 0xc1a, 0x33f, 0xd75, + 0x250, 0x9d5, 0x6f0, 0x8ba, 0x79f, 0xb0b, 0x42e, 0xa64, + 0x541, 0xc69 + ]; + + // final format bits with mask: level << 3 | mask + var fmtword = [ + 0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976, //L + 0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0, //M + 0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed, //Q + 0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b //H + ]; + + // 4 per version: number of blocks 1,2; data width; ecc width + var eccblocks = [ + 1, 0, 19, 7, 1, 0, 16, 10, 1, 0, 13, 13, 1, 0, 9, 17, + 1, 0, 34, 10, 1, 0, 28, 16, 1, 0, 22, 22, 1, 0, 16, 28, + 1, 0, 55, 15, 1, 0, 44, 26, 2, 0, 17, 18, 2, 0, 13, 22, + 1, 0, 80, 20, 2, 0, 32, 18, 2, 0, 24, 26, 4, 0, 9, 16, + 1, 0, 108, 26, 2, 0, 43, 24, 2, 2, 15, 18, 2, 2, 11, 22, + 2, 0, 68, 18, 4, 0, 27, 16, 4, 0, 19, 24, 4, 0, 15, 28, + 2, 0, 78, 20, 4, 0, 31, 18, 2, 4, 14, 18, 4, 1, 13, 26, + 2, 0, 97, 24, 2, 2, 38, 22, 4, 2, 18, 22, 4, 2, 14, 26, + 2, 0, 116, 30, 3, 2, 36, 22, 4, 4, 16, 20, 4, 4, 12, 24, + 2, 2, 68, 18, 4, 1, 43, 26, 6, 2, 19, 24, 6, 2, 15, 28, + 4, 0, 81, 20, 1, 4, 50, 30, 4, 4, 22, 28, 3, 8, 12, 24, + 2, 2, 92, 24, 6, 2, 36, 22, 4, 6, 20, 26, 7, 4, 14, 28, + 4, 0, 107, 26, 8, 1, 37, 22, 8, 4, 20, 24, 12, 4, 11, 22, + 3, 1, 115, 30, 4, 5, 40, 24, 11, 5, 16, 20, 11, 5, 12, 24, + 5, 1, 87, 22, 5, 5, 41, 24, 5, 7, 24, 30, 11, 7, 12, 24, + 5, 1, 98, 24, 7, 3, 45, 28, 15, 2, 19, 24, 3, 13, 15, 30, + 1, 5, 107, 28, 10, 1, 46, 28, 1, 15, 22, 28, 2, 17, 14, 28, + 5, 1, 120, 30, 9, 4, 43, 26, 17, 1, 22, 28, 2, 19, 14, 28, + 3, 4, 113, 28, 3, 11, 44, 26, 17, 4, 21, 26, 9, 16, 13, 26, + 3, 5, 107, 28, 3, 13, 41, 26, 15, 5, 24, 30, 15, 10, 15, 28, + 4, 4, 116, 28, 17, 0, 42, 26, 17, 6, 22, 28, 19, 6, 16, 30, + 2, 7, 111, 28, 17, 0, 46, 28, 7, 16, 24, 30, 34, 0, 13, 24, + 4, 5, 121, 30, 4, 14, 47, 28, 11, 14, 24, 30, 16, 14, 15, 30, + 6, 4, 117, 30, 6, 14, 45, 28, 11, 16, 24, 30, 30, 2, 16, 30, + 8, 4, 106, 26, 8, 13, 47, 28, 7, 22, 24, 30, 22, 13, 15, 30, + 10, 2, 114, 28, 19, 4, 46, 28, 28, 6, 22, 28, 33, 4, 16, 30, + 8, 4, 122, 30, 22, 3, 45, 28, 8, 26, 23, 30, 12, 28, 15, 30, + 3, 10, 117, 30, 3, 23, 45, 28, 4, 31, 24, 30, 11, 31, 15, 30, + 7, 7, 116, 30, 21, 7, 45, 28, 1, 37, 23, 30, 19, 26, 15, 30, + 5, 10, 115, 30, 19, 10, 47, 28, 15, 25, 24, 30, 23, 25, 15, 30, + 13, 3, 115, 30, 2, 29, 46, 28, 42, 1, 24, 30, 23, 28, 15, 30, + 17, 0, 115, 30, 10, 23, 46, 28, 10, 35, 24, 30, 19, 35, 15, 30, + 17, 1, 115, 30, 14, 21, 46, 28, 29, 19, 24, 30, 11, 46, 15, 30, + 13, 6, 115, 30, 14, 23, 46, 28, 44, 7, 24, 30, 59, 1, 16, 30, + 12, 7, 121, 30, 12, 26, 47, 28, 39, 14, 24, 30, 22, 41, 15, 30, + 6, 14, 121, 30, 6, 34, 47, 28, 46, 10, 24, 30, 2, 64, 15, 30, + 17, 4, 122, 30, 29, 14, 46, 28, 49, 10, 24, 30, 24, 46, 15, 30, + 4, 18, 122, 30, 13, 32, 46, 28, 48, 14, 24, 30, 42, 32, 15, 30, + 20, 4, 117, 30, 40, 7, 47, 28, 43, 22, 24, 30, 10, 67, 15, 30, + 19, 6, 118, 30, 18, 31, 47, 28, 34, 34, 24, 30, 20, 61, 15, 30 + ]; + + // Galois field log table + var glog = [ + 0xff, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1a, 0xc6, 0x03, 0xdf, 0x33, 0xee, 0x1b, 0x68, 0xc7, 0x4b, + 0x04, 0x64, 0xe0, 0x0e, 0x34, 0x8d, 0xef, 0x81, 0x1c, 0xc1, 0x69, 0xf8, 0xc8, 0x08, 0x4c, 0x71, + 0x05, 0x8a, 0x65, 0x2f, 0xe1, 0x24, 0x0f, 0x21, 0x35, 0x93, 0x8e, 0xda, 0xf0, 0x12, 0x82, 0x45, + 0x1d, 0xb5, 0xc2, 0x7d, 0x6a, 0x27, 0xf9, 0xb9, 0xc9, 0x9a, 0x09, 0x78, 0x4d, 0xe4, 0x72, 0xa6, + 0x06, 0xbf, 0x8b, 0x62, 0x66, 0xdd, 0x30, 0xfd, 0xe2, 0x98, 0x25, 0xb3, 0x10, 0x91, 0x22, 0x88, + 0x36, 0xd0, 0x94, 0xce, 0x8f, 0x96, 0xdb, 0xbd, 0xf1, 0xd2, 0x13, 0x5c, 0x83, 0x38, 0x46, 0x40, + 0x1e, 0x42, 0xb6, 0xa3, 0xc3, 0x48, 0x7e, 0x6e, 0x6b, 0x3a, 0x28, 0x54, 0xfa, 0x85, 0xba, 0x3d, + 0xca, 0x5e, 0x9b, 0x9f, 0x0a, 0x15, 0x79, 0x2b, 0x4e, 0xd4, 0xe5, 0xac, 0x73, 0xf3, 0xa7, 0x57, + 0x07, 0x70, 0xc0, 0xf7, 0x8c, 0x80, 0x63, 0x0d, 0x67, 0x4a, 0xde, 0xed, 0x31, 0xc5, 0xfe, 0x18, + 0xe3, 0xa5, 0x99, 0x77, 0x26, 0xb8, 0xb4, 0x7c, 0x11, 0x44, 0x92, 0xd9, 0x23, 0x20, 0x89, 0x2e, + 0x37, 0x3f, 0xd1, 0x5b, 0x95, 0xbc, 0xcf, 0xcd, 0x90, 0x87, 0x97, 0xb2, 0xdc, 0xfc, 0xbe, 0x61, + 0xf2, 0x56, 0xd3, 0xab, 0x14, 0x2a, 0x5d, 0x9e, 0x84, 0x3c, 0x39, 0x53, 0x47, 0x6d, 0x41, 0xa2, + 0x1f, 0x2d, 0x43, 0xd8, 0xb7, 0x7b, 0xa4, 0x76, 0xc4, 0x17, 0x49, 0xec, 0x7f, 0x0c, 0x6f, 0xf6, + 0x6c, 0xa1, 0x3b, 0x52, 0x29, 0x9d, 0x55, 0xaa, 0xfb, 0x60, 0x86, 0xb1, 0xbb, 0xcc, 0x3e, 0x5a, + 0xcb, 0x59, 0x5f, 0xb0, 0x9c, 0xa9, 0xa0, 0x51, 0x0b, 0xf5, 0x16, 0xeb, 0x7a, 0x75, 0x2c, 0xd7, + 0x4f, 0xae, 0xd5, 0xe9, 0xe6, 0xe7, 0xad, 0xe8, 0x74, 0xd6, 0xf4, 0xea, 0xa8, 0x50, 0x58, 0xaf + ]; + + // Galios field exponent table + var gexp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, 0x62, 0xc4, 0x95, 0x37, 0x6e, 0xdc, 0xa5, 0x57, 0xae, 0x41, + 0x82, 0x19, 0x32, 0x64, 0xc8, 0x8d, 0x07, 0x0e, 0x1c, 0x38, 0x70, 0xe0, 0xdd, 0xa7, 0x53, 0xa6, + 0x51, 0xa2, 0x59, 0xb2, 0x79, 0xf2, 0xf9, 0xef, 0xc3, 0x9b, 0x2b, 0x56, 0xac, 0x45, 0x8a, 0x09, + 0x12, 0x24, 0x48, 0x90, 0x3d, 0x7a, 0xf4, 0xf5, 0xf7, 0xf3, 0xfb, 0xeb, 0xcb, 0x8b, 0x0b, 0x16, + 0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83, 0x1b, 0x36, 0x6c, 0xd8, 0xad, 0x47, 0x8e, 0x00 + ]; + + // Working buffers: + // data input and ecc append, image working buffer, fixed part of image, run lengths for badness + var strinbuf = [], eccbuf = [], qrframe = [], framask = [], rlens = []; + // Control values - width is based on version, last 4 are from table. + var version, width, neccblk1, neccblk2, datablkw, eccblkwid; + var ecclevel = 2; + // set bit to indicate cell in qrframe is immutable. symmetric around diagonal + function setmask(x, y) { + var bt; + if (x > y) { + bt = x; + x = y; + y = bt; + } + // y*y = 1+3+5... + bt = y; + bt *= y; + bt += y; + bt >>= 1; + bt += x; + framask[bt] = 1; + } + + // enter alignment pattern - black to qrframe, white to mask (later black frame merged to mask) + function putalign(x, y) { + var j; + + qrframe[x + width * y] = 1; + for (j = -2; j < 2; j++) { + qrframe[(x + j) + width * (y - 2)] = 1; + qrframe[(x - 2) + width * (y + j + 1)] = 1; + qrframe[(x + 2) + width * (y + j)] = 1; + qrframe[(x + j + 1) + width * (y + 2)] = 1; + } + for (j = 0; j < 2; j++) { + setmask(x - 1, y + j); + setmask(x + 1, y - j); + setmask(x - j, y - 1); + setmask(x + j, y + 1); + } + } + + //======================================================================== + // Reed Solomon error correction + // exponentiation mod N + function modnn(x) { + while (x >= 255) { + x -= 255; + x = (x >> 8) + (x & 255); + } + return x; + } + + var genpoly = []; + + // Calculate and append ECC data to data block. Block is in strinbuf, indexes to buffers given. + function appendrs(data, dlen, ecbuf, eclen) { + var i, j, fb; + + for (i = 0; i < eclen; i++) + strinbuf[ecbuf + i] = 0; + for (i = 0; i < dlen; i++) { + fb = glog[strinbuf[data + i] ^ strinbuf[ecbuf]]; + if (fb != 255) /* fb term is non-zero */ + for (j = 1; j < eclen; j++) + strinbuf[ecbuf + j - 1] = strinbuf[ecbuf + j] ^ gexp[modnn(fb + genpoly[eclen - j])]; + else + for (j = ecbuf; j < ecbuf + eclen; j++) + strinbuf[j] = strinbuf[j + 1]; + strinbuf[ecbuf + eclen - 1] = fb == 255 ? 0 : gexp[modnn(fb + genpoly[0])]; + } + } + + //======================================================================== + // Frame data insert following the path rules + + // check mask - since symmetrical use half. + function ismasked(x, y) { + var bt; + if (x > y) { + bt = x; + x = y; + y = bt; + } + bt = y; + bt += y * y; + bt >>= 1; + bt += x; + return framask[bt]; + } + + //======================================================================== + // Apply the selected mask out of the 8. + function applymask(m) { + var x, y, r3x, r3y; + + switch (m) { + case 0: + for (y = 0; y < width; y++) + for (x = 0; x < width; x++) + if (!((x + y) & 1) && !ismasked(x, y)) + qrframe[x + y * width] ^= 1; + break; + case 1: + for (y = 0; y < width; y++) + for (x = 0; x < width; x++) + if (!(y & 1) && !ismasked(x, y)) + qrframe[x + y * width] ^= 1; + break; + case 2: + for (y = 0; y < width; y++) + for (r3x = 0, x = 0; x < width; x++ , r3x++) { + if (r3x == 3) + r3x = 0; + if (!r3x && !ismasked(x, y)) + qrframe[x + y * width] ^= 1; + } + break; + case 3: + for (r3y = 0, y = 0; y < width; y++ , r3y++) { + if (r3y == 3) + r3y = 0; + for (r3x = r3y, x = 0; x < width; x++ , r3x++) { + if (r3x == 3) + r3x = 0; + if (!r3x && !ismasked(x, y)) + qrframe[x + y * width] ^= 1; + } + } + break; + case 4: + for (y = 0; y < width; y++) + for (r3x = 0, r3y = ((y >> 1) & 1), x = 0; x < width; x++ , r3x++) { + if (r3x == 3) { + r3x = 0; + r3y = !r3y; + } + if (!r3y && !ismasked(x, y)) + qrframe[x + y * width] ^= 1; + } + break; + case 5: + for (r3y = 0, y = 0; y < width; y++ , r3y++) { + if (r3y == 3) + r3y = 0; + for (r3x = 0, x = 0; x < width; x++ , r3x++) { + if (r3x == 3) + r3x = 0; + if (!((x & y & 1) + !(!r3x | !r3y)) && !ismasked(x, y)) + qrframe[x + y * width] ^= 1; + } + } + break; + case 6: + for (r3y = 0, y = 0; y < width; y++ , r3y++) { + if (r3y == 3) + r3y = 0; + for (r3x = 0, x = 0; x < width; x++ , r3x++) { + if (r3x == 3) + r3x = 0; + if (!(((x & y & 1) + (r3x && (r3x == r3y))) & 1) && !ismasked(x, y)) + qrframe[x + y * width] ^= 1; + } + } + break; + case 7: + for (r3y = 0, y = 0; y < width; y++ , r3y++) { + if (r3y == 3) + r3y = 0; + for (r3x = 0, x = 0; x < width; x++ , r3x++) { + if (r3x == 3) + r3x = 0; + if (!(((r3x && (r3x == r3y)) + ((x + y) & 1)) & 1) && !ismasked(x, y)) + qrframe[x + y * width] ^= 1; + } + } + break; + } + return; + } + + // Badness coefficients. + var N1 = 3, N2 = 3, N3 = 40, N4 = 10; + + // Using the table of the length of each run, calculate the amount of bad image + // - long runs or those that look like finders; called twice, once each for X and Y + function badruns(length) { + var i; + var runsbad = 0; + for (i = 0; i <= length; i++) + if (rlens[i] >= 5) + runsbad += N1 + rlens[i] - 5; + // BwBBBwB as in finder + for (i = 3; i < length - 1; i += 2) + if (rlens[i - 2] == rlens[i + 2] + && rlens[i + 2] == rlens[i - 1] + && rlens[i - 1] == rlens[i + 1] + && rlens[i - 1] * 3 == rlens[i] + // white around the black pattern? Not part of spec + && (rlens[i - 3] == 0 // beginning + || i + 3 > length // end + || rlens[i - 3] * 3 >= rlens[i] * 4 || rlens[i + 3] * 3 >= rlens[i] * 4) + ) + runsbad += N3; + return runsbad; + } + + // Calculate how bad the masked image is - blocks, imbalance, runs, or finders. + function badcheck() { + var x, y, h, b, b1; + var thisbad = 0; + var bw = 0; + + // blocks of same color. + for (y = 0; y < width - 1; y++) + for (x = 0; x < width - 1; x++) + if ((qrframe[x + width * y] && qrframe[(x + 1) + width * y] + && qrframe[x + width * (y + 1)] && qrframe[(x + 1) + width * (y + 1)]) // all black + || !(qrframe[x + width * y] || qrframe[(x + 1) + width * y] + || qrframe[x + width * (y + 1)] || qrframe[(x + 1) + width * (y + 1)])) // all white + thisbad += N2; + + // X runs + for (y = 0; y < width; y++) { + rlens[0] = 0; + for (h = b = x = 0; x < width; x++) { + if ((b1 = qrframe[x + width * y]) == b) + rlens[h]++; + else + rlens[++h] = 1; + b = b1; + bw += b ? 1 : -1; + } + thisbad += badruns(h); + } + + // black/white imbalance + if (bw < 0) + bw = -bw; + + var big = bw; + var count = 0; + big += big << 2; + big <<= 1; + while (big > width * width) + big -= width * width, count++; + thisbad += count * N4; + + // Y runs + for (x = 0; x < width; x++) { + rlens[0] = 0; + for (h = b = y = 0; y < width; y++) { + if ((b1 = qrframe[x + width * y]) == b) + rlens[h]++; + else + rlens[++h] = 1; + b = b1; + } + thisbad += badruns(h); + } + return thisbad; + } + + function genframe(instring) { + var x, y, k, t, v, i, j, m; + + // find the smallest version that fits the string + t = instring.length; + version = 0; + do { + version++; + k = (ecclevel - 1) * 4 + (version - 1) * 16; + neccblk1 = eccblocks[k++]; + neccblk2 = eccblocks[k++]; + datablkw = eccblocks[k++]; + eccblkwid = eccblocks[k]; + k = datablkw * (neccblk1 + neccblk2) + neccblk2 - 3 + (version <= 9); + if (t <= k) + break; + } while (version < 40); + + // FIXME - insure that it fits insted of being truncated + width = 17 + 4 * version; + + // allocate, clear and setup data structures + v = datablkw + (datablkw + eccblkwid) * (neccblk1 + neccblk2) + neccblk2; + for (t = 0; t < v; t++) + eccbuf[t] = 0; + strinbuf = instring.slice(0); + + for (t = 0; t < width * width; t++) + qrframe[t] = 0; + + for (t = 0; t < (width * (width + 1) + 1) / 2; t++) + framask[t] = 0; + + // insert finders - black to frame, white to mask + for (t = 0; t < 3; t++) { + k = 0; + y = 0; + if (t == 1) + k = (width - 7); + if (t == 2) + y = (width - 7); + qrframe[(y + 3) + width * (k + 3)] = 1; + for (x = 0; x < 6; x++) { + qrframe[(y + x) + width * k] = 1; + qrframe[y + width * (k + x + 1)] = 1; + qrframe[(y + 6) + width * (k + x)] = 1; + qrframe[(y + x + 1) + width * (k + 6)] = 1; + } + for (x = 1; x < 5; x++) { + setmask(y + x, k + 1); + setmask(y + 1, k + x + 1); + setmask(y + 5, k + x); + setmask(y + x + 1, k + 5); + } + for (x = 2; x < 4; x++) { + qrframe[(y + x) + width * (k + 2)] = 1; + qrframe[(y + 2) + width * (k + x + 1)] = 1; + qrframe[(y + 4) + width * (k + x)] = 1; + qrframe[(y + x + 1) + width * (k + 4)] = 1; + } + } + + // alignment blocks + if (version > 1) { + t = adelta[version]; + y = width - 7; + for (; ;) { + x = width - 7; + while (x > t - 3) { + putalign(x, y); + if (x < t) + break; + x -= t; + } + if (y <= t + 9) + break; + y -= t; + putalign(6, y); + putalign(y, 6); + } + } + + // single black + qrframe[8 + width * (width - 8)] = 1; + + // timing gap - mask only + for (y = 0; y < 7; y++) { + setmask(7, y); + setmask(width - 8, y); + setmask(7, y + width - 7); + } + for (x = 0; x < 8; x++) { + setmask(x, 7); + setmask(x + width - 8, 7); + setmask(x, width - 8); + } + + // reserve mask-format area + for (x = 0; x < 9; x++) + setmask(x, 8); + for (x = 0; x < 8; x++) { + setmask(x + width - 8, 8); + setmask(8, x); + } + for (y = 0; y < 7; y++) + setmask(8, y + width - 7); + + // timing row/col + for (x = 0; x < width - 14; x++) + if (x & 1) { + setmask(8 + x, 6); + setmask(6, 8 + x); + } + else { + qrframe[(8 + x) + width * 6] = 1; + qrframe[6 + width * (8 + x)] = 1; + } + + // version block + if (version > 6) { + t = vpat[version - 7]; + k = 17; + for (x = 0; x < 6; x++) + for (y = 0; y < 3; y++ , k--) + if (1 & (k > 11 ? version >> (k - 12) : t >> k)) { + qrframe[(5 - x) + width * (2 - y + width - 11)] = 1; + qrframe[(2 - y + width - 11) + width * (5 - x)] = 1; + } + else { + setmask(5 - x, 2 - y + width - 11); + setmask(2 - y + width - 11, 5 - x); + } + } + + // sync mask bits - only set above for white spaces, so add in black bits + for (y = 0; y < width; y++) + for (x = 0; x <= y; x++) + if (qrframe[x + width * y]) + setmask(x, y); + + // convert string to bitstream + // 8 bit data to QR-coded 8 bit data (numeric or alphanum, or kanji not supported) + v = strinbuf.length; + + // string to array + for (i = 0; i < v; i++) + eccbuf[i] = strinbuf.charCodeAt(i); + strinbuf = eccbuf.slice(0); + + // calculate max string length + x = datablkw * (neccblk1 + neccblk2) + neccblk2; + if (v >= x - 2) { + v = x - 2; + if (version > 9) + v--; + } + + // shift and repack to insert length prefix + i = v; + if (version > 9) { + strinbuf[i + 2] = 0; + strinbuf[i + 3] = 0; + while (i--) { + t = strinbuf[i]; + strinbuf[i + 3] |= 255 & (t << 4); + strinbuf[i + 2] = t >> 4; + } + strinbuf[2] |= 255 & (v << 4); + strinbuf[1] = v >> 4; + strinbuf[0] = 0x40 | (v >> 12); + } + else { + strinbuf[i + 1] = 0; + strinbuf[i + 2] = 0; + while (i--) { + t = strinbuf[i]; + strinbuf[i + 2] |= 255 & (t << 4); + strinbuf[i + 1] = t >> 4; + } + strinbuf[1] |= 255 & (v << 4); + strinbuf[0] = 0x40 | (v >> 4); + } + // fill to end with pad pattern + i = v + 3 - (version < 10); + while (i < x) { + strinbuf[i++] = 0xec; + // buffer has room if (i == x) break; + strinbuf[i++] = 0x11; + } + + // calculate and append ECC + + // calculate generator polynomial + genpoly[0] = 1; + for (i = 0; i < eccblkwid; i++) { + genpoly[i + 1] = 1; + for (j = i; j > 0; j--) + genpoly[j] = genpoly[j] + ? genpoly[j - 1] ^ gexp[modnn(glog[genpoly[j]] + i)] : genpoly[j - 1]; + genpoly[0] = gexp[modnn(glog[genpoly[0]] + i)]; + } + for (i = 0; i <= eccblkwid; i++) + genpoly[i] = glog[genpoly[i]]; // use logs for genpoly[] to save calc step + + // append ecc to data buffer + k = x; + y = 0; + for (i = 0; i < neccblk1; i++) { + appendrs(y, datablkw, k, eccblkwid); + y += datablkw; + k += eccblkwid; + } + for (i = 0; i < neccblk2; i++) { + appendrs(y, datablkw + 1, k, eccblkwid); + y += datablkw + 1; + k += eccblkwid; + } + // interleave blocks + y = 0; + for (i = 0; i < datablkw; i++) { + for (j = 0; j < neccblk1; j++) + eccbuf[y++] = strinbuf[i + j * datablkw]; + for (j = 0; j < neccblk2; j++) + eccbuf[y++] = strinbuf[(neccblk1 * datablkw) + i + (j * (datablkw + 1))]; + } + for (j = 0; j < neccblk2; j++) + eccbuf[y++] = strinbuf[(neccblk1 * datablkw) + i + (j * (datablkw + 1))]; + for (i = 0; i < eccblkwid; i++) + for (j = 0; j < neccblk1 + neccblk2; j++) + eccbuf[y++] = strinbuf[x + i + j * eccblkwid]; + strinbuf = eccbuf; + + // pack bits into frame avoiding masked area. + x = y = width - 1; + k = v = 1; // up, minus + /* inteleaved data and ecc codes */ + m = (datablkw + eccblkwid) * (neccblk1 + neccblk2) + neccblk2; + for (i = 0; i < m; i++) { + t = strinbuf[i]; + for (j = 0; j < 8; j++ , t <<= 1) { + if (0x80 & t) + qrframe[x + width * y] = 1; + do { // find next fill position + if (v) + x--; + else { + x++; + if (k) { + if (y != 0) + y--; + else { + x -= 2; + k = !k; + if (x == 6) { + x--; + y = 9; + } + } + } + else { + if (y != width - 1) + y++; + else { + x -= 2; + k = !k; + if (x == 6) { + x--; + y -= 8; + } + } + } + } + v = !v; + } while (ismasked(x, y)); + } + } + + // save pre-mask copy of frame + strinbuf = qrframe.slice(0); + t = 0; // best + y = 30000; // demerit + // for instead of while since in original arduino code + // if an early mask was "good enough" it wouldn't try for a better one + // since they get more complex and take longer. + for (k = 0; k < 8; k++) { + applymask(k); // returns black-white imbalance + x = badcheck(); + if (x < y) { // current mask better than previous best? + y = x; + t = k; + } + if (t == 7) + break; // don't increment i to a void redoing mask + qrframe = strinbuf.slice(0); // reset for next pass + } + if (t != k) // redo best mask - none good enough, last wasn't t + applymask(t); + + // add in final mask/ecclevel bytes + y = fmtword[t + ((ecclevel - 1) << 3)]; + // low byte + for (k = 0; k < 8; k++ , y >>= 1) + if (y & 1) { + qrframe[(width - 1 - k) + width * 8] = 1; + if (k < 6) + qrframe[8 + width * k] = 1; + else + qrframe[8 + width * (k + 1)] = 1; + } + // high byte + for (k = 0; k < 7; k++ , y >>= 1) + if (y & 1) { + qrframe[8 + width * (width - 7 + k)] = 1; + if (k) + qrframe[(6 - k) + width * 8] = 1; + else + qrframe[7 + width * 8] = 1; + } + + // return image + return qrframe; + } + + var _canvas = null, + _size = null; + + var api = { + + get ecclevel() { + return ecclevel; + }, + + set ecclevel(val) { + ecclevel = val; + }, + + get size() { + return _size; + }, + + set size(val) { + _size = val + }, + + get canvas() { + return _canvas; + }, + + set canvas(el) { + _canvas = el; + }, + + getFrame: function (string) { + return genframe(string); + }, + + draw: function (string, canvas, size, ecc) { + + ecclevel = ecc || ecclevel; + canvas = canvas || _canvas; + + if (!canvas) { + console.warn('No canvas provided to draw QR code in!') + return; + } + + size = size || _size || Math.min(canvas.width, canvas.height); + + var frame = genframe(string), + ctx = canvas.ctx, + px = Math.round(size / (width + 8)); + + var roundedSize = px * (width + 8), + offset = Math.floor((size - roundedSize) / 2); + + size = roundedSize; + + ctx.clearRect(0, 0, canvas.width, canvas.height); + ctx.setFillStyle('#000000'); + + for (var i = 0; i < width; i++) { + for (var j = 0; j < width; j++) { + if (frame[j * width + i]) { + ctx.fillRect(px * (4 + i) + offset, px * (4 + j) + offset, px, px); + } + } + } + ctx.draw(); + } + } + + module.exports = { + api: api + } + +})() \ No newline at end of file diff --git a/utils/regions/Regions.js b/utils/regions/Regions.js new file mode 100644 index 0000000..d0f824d --- /dev/null +++ b/utils/regions/Regions.js @@ -0,0 +1,77 @@ +function e(e, t, s) { + return t in e ? Object.defineProperty(e, t, { + value: s, + enumerable: !0, + configurable: !0, + writable: !0 + }) : e[t] = s, e; +} + +function t(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); +} + +Object.defineProperty(exports, "__esModule", { + value: !0 +}); +var s = function() { + function e(e, t) { + for (var s = 0; s < t.length; s++) { + var a = t[s]; + a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), + Object.defineProperty(e, a.key, a); + } + } + return function(t, s, a) { + return s && e(t.prototype, s), a && e(t, a), t; + }; +}(), a = function() { + function a(s, i, n) { + t(this, a), this.page = s, this.options = n, this.address = {}, this.currentArea = 0; + var r = this; + this.page.openRegionsModal = function(e) { + r.openRegionsModal(e); + }, this.page.closeRegionsModal = function() { + r.closeRegionsModal(); + }, this.dataName = i, this.page.setData(e({}, i, {})); + } + return s(a, [ { + key: "openRegionsModal", + value: function(t) { + var s = this, a = t.currentTarget.dataset.id, i = t.currentTarget.dataset.name; + isNaN(parseInt(a)) || !parseInt(a) ? (a = 0, this.currentArea = 0) : (0 == this.currentArea ? (this.address.province_name = i, + this.address.province = a, this.address.city_name = "", this.address.city = 0, this.address.district_name = "", + this.address.district = 0, this.address.twon_name = "", this.address.twon = 0) : 1 == this.currentArea ? (this.address.city_name = i, + this.address.city = a) : 2 == this.currentArea ? (this.address.district_name = i, + this.address.district = a) : 3 == this.currentArea && (this.address.twon_name = i, + this.address.twon = a), this.currentArea++), "function" == typeof this.options.selectCall && this.options.selectCall(t, a, i, this.address), + this.currentArea !== this.options.endAreaLevel ? + getApp().request.get("/api/weshop/region/page", { + data: { + parent_id: a, + pageSize:1000 + }, + success: function(t) { + t.data.data.pageData && t.data.data.pageData.length > 0 ? s.page.setData(e({}, s.dataName, { + regions: t.data.data.pageData, + showRegionsModal: !0 + })) : s.endCall(a, i); + } + }) : this.endCall(a, i); + } + }, { + key: "closeRegionsModal", + value: function() { + this.page.setData(e({}, this.dataName, { + showCategoryModal: !1 + })); + } + }, { + key: "endCall", + value: function(e, t) { + this.closeRegionsModal(), "function" == typeof this.options.endAreaLevelCall && this.options.endAreaLevelCall(e, t, this.address); + } + } ]), a; +}(); + +exports.default = a; \ No newline at end of file diff --git a/utils/regions/regions.wxml b/utils/regions/regions.wxml new file mode 100644 index 0000000..9566a09 --- /dev/null +++ b/utils/regions/regions.wxml @@ -0,0 +1,8 @@ + diff --git a/utils/regions/regions.wxss b/utils/regions/regions.wxss new file mode 100644 index 0000000..3946540 --- /dev/null +++ b/utils/regions/regions.wxss @@ -0,0 +1,19 @@ +.regions { + z-index: 20; + position: fixed; + top: 0; + bottom: 0; + right: 0; + left: 100rpx; + overflow-x: hidden; + font-size: 28rpx; + color: #afafaf; + background-color: white; + padding: 0 25rpx; + color: #444; +} + +.region { + line-height: 84rpx; + border-bottom: 1rpx solid #e8ecf1; +} diff --git a/utils/request.js b/utils/request.js new file mode 100644 index 0000000..351a1be --- /dev/null +++ b/utils/request.js @@ -0,0 +1,204 @@ +var t = require("util.js"); + +module.exports = { + uniqueId: "", + request: function(e, i, o) { + var n = this, a = o.header ? o.header : { + "content-type": "application/x-www-form-urlencoded" + //"content-type": "application/texts" + }, s = "GET" != (e = e.toUpperCase()) && o.data ? t.json2Form(o.data) : o.data; + i = this.modifyUrl(i, o), o.isShowLoading = void 0 === o.isShowLoading || o.isShowLoading, + o.isShowLoading && this.showLoading(), console.log("app.request", i, o), wx.request(Object.assign({}, o, { + url: i, + method: e, + data: s, + header: a, + success: function(t) { + o.isShowLoading && n.hideLoading(), n.doSuccess(o, t); + }, + fail: function(t) { + o.isShowLoading && n.hideLoading(), n.doFail(o, t); + } + })); + }, + get: function (t, e) { + this.request("GET", t, e); + }, + post: function (t, e) { + this.request("POST", t, e); + }, + delete: function (t, e) { + this.request("DELETE", t, e); + }, + put: function (t, e) { + this.request("PUT", t, e); + }, + + + uploadFile: function(t, e) { + var i = this; + t = this.modifyUrl(t, e), console.log("app.request", t, e), e.isShowLoading = void 0 === e.isShowLoading || e.isShowLoading, + e.isShowLoading && this.showLoading(), wx.uploadFile(Object.assign({}, e, { + url: t, + filePath: e.filePath, + name: e.name, + success: function(t) { + i.hideLoading(), console.log("app.request", t), t.data = JSON.parse(i.filterJsonData(t.data)), + i.doSuccess(e, t); + }, + fail: function(t) { + i.hideLoading(), i.doFail(e, t); + } + })); + }, + + doSuccess: function(t, e) { + if (console.log("app.request", e), 1 != t.successReload) { + if (200 != e.statusCode) return this.showError("请求出错[" + e.statusCode + "]", t), + !1; + + if(e.data.status!=undefined){ + if (1 != e.data.status) { + if ("function" == typeof t.failStatus && 0 == t.failStatus(e)) return !1; + if (-100 == e.data.status || -101 == e.data.status || -102 == e.data.status) { + var i = getApp(); + return i.auth.clearAuth(), i.showWarning("正在重新登录", function() { + var t = getCurrentPages(); + "pages/user/index/index" != t[t.length - 1].route ? wx.switchTab({ + url: "/pages/user/index/index" + }) : wx.switchTab({ + url: "/pages/index/index/index" + }); + }, null, !0), !1; + } + var o = "string" == typeof e.data.msg ? e.data.msg : "数据格式错误"; + return this.showError(o, t), !1; + } + } + "function" == typeof t.success && t.success(e); + } else "function" == typeof t.success && t.success(e); + }, + doFail: function(t, e) { + if (console.log("app.request", e), "function" == typeof t.fail && 0 == t.fail(e)) return !1; + this.showError("请求失败", t); + }, + filterJsonData: function(t) { + for (var e = t, i = 0; i < t.length && (e = t.substr(i), "{" != t.charAt(i)); i++) ; + return e; + }, + modifyUrl: function(t, e) { + if (void 0 === e && (e = {}), 0 != t.indexOf("http") && ("string" == typeof e.baseUrl ? t = e.baseUrl + t : void 0 === e.baseUrl && (t = getApp().globalData.setting.url + t)), + "boolean" == typeof e.notAuthParam && 1 == e.notAuthParam) return t; + //var i = "is_json=1&unique_id=" + this.getUniqueId() + "&token=" + this.getToken(); + return t += (t.indexOf("?") > 0 ? "&" : "?");// + i; + }, + + modifyUrl2: function (t, e) { + if (void 0 === e && (e = {}), 0 != t.indexOf("http") && ("string" == typeof e.baseUrl ? t = e.baseUrl + t : void 0 === e.baseUrl && (t = getApp().globalData.setting.hurl + t)), + "boolean" == typeof e.notAuthParam && 1 == e.notAuthParam) return t; + //var i = "is_json=1&unique_id=" + this.getUniqueId() + "&token=" + this.getToken(); + return t += (t.indexOf("?") > 0 ? "&" : "?");// + i; + }, + + + getToken: function() { + var t = getApp(); + return null == t.globalData.userInfo ? "" : t.globalData.userInfo.token; + }, + getUniqueId: function() { + return this.uniqueId ? this.uniqueId : (this.uniqueId = "miniapp" + t.randomString(17), + this.uniqueId); + }, + showLoading: function() { + wx.showLoading({ + title: "加载中" + }); + }, + hideLoading: function() { + wx.hideLoading(); + }, + showError: function(t, e) { + wx.showModal({ + title: t, + showCancel: !1, + complete: function() { + 1 == e.failRollback && wx.navigateBack(); + } + }); + }, + + request2: function (e, i, o) { + var n = this, a = o.header ? o.header : { + "content-type": "application/x-www-form-urlencoded" + }, s = "GET" != (e = e.toUpperCase()) && o.data ? t.json2Form(o.data) : o.data; + i = this.modifyUrl2(i, o), o.isShowLoading = void 0 === o.isShowLoading || o.isShowLoading, + o.isShowLoading && this.showLoading(), console.log("app.request", i, o), wx.request(Object.assign({}, o, { + url: i, + method: e, + data: s, + header: a, + success: function (t) { + o.isShowLoading && n.hideLoading(), n.doSuccess2(o, t); + }, + fail: function (t) { + o.isShowLoading && n.hideLoading(), n.doFail(o, t); + } + })); + }, + get2: function (t, e) { + this.request2("GET", t, e); + }, + doSuccess2: function (t, e){ + if (console.log("app.request", e), 1 != t.successReload) { + if (200 != e.statusCode) return this.showError("请求出错[" + e.statusCode + "]", t), + !1; + if (0 != e.data.code) { + if ("function" == typeof t.failStatus && 0 == t.failStatus(e)) return !1; + var o = "string" == typeof e.data.msg ? e.data.msg : "数据格式错误"; + return this.showError(o, t), !1; + } + "function" == typeof t.success && t.success(e); + } else "function" == typeof t.success && t.success(e); + }, + + //---promise的使用get---- + promiseGet:function(url,data){ + var th=this; + if(url.indexOf("http")==-1) url=getApp().globalData.setting.url +url; + return new Promise((resolve, reject) => { + data.isShowLoading && th.showLoading(); + wx.request({ + url, + method: 'GET', + header: {"content-type": "application/x-www-form-urlencoded" }, + data:data.data, + success(res) { + data.isShowLoading && th.hideLoading(); + resolve(res); + }, + fail(err) { data.isShowLoading && th.hideLoading(); reject(err); } + }) + }) + }, + + //---promise的使用get---- + promisePost:function(url,data){ + var th=this; + if(url.indexOf("http")==-1) url=getApp().globalData.setting.url +url; + return new Promise((resolve, reject) => { + data.isShowLoading && th.showLoading(); + wx.request({ + url, + method: 'POST', + header: {"content-type": "application/x-www-form-urlencoded" }, + data:data.data, + success(res) { + data.isShowLoading && th.hideLoading(); + resolve(res); + }, + fail(err) { data.isShowLoading && th.hideLoading(); reject(err); } + }) + }) + } + +}; \ No newline at end of file diff --git a/utils/runtime.js b/utils/runtime.js new file mode 100644 index 0000000..51056c6 --- /dev/null +++ b/utils/runtime.js @@ -0,0 +1,710 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +var regeneratorRuntime = (function (exports) { + "use strict"; + + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined; // More compressible than void 0. + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + exports.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + var IteratorPrototype = {}; + IteratorPrototype[iteratorSymbol] = function () { + return this; + }; + + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && + NativeIteratorPrototype !== Op && + hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } + + var Gp = GeneratorFunctionPrototype.prototype = + Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunctionPrototype[toStringTagSymbol] = + GeneratorFunction.displayName = "GeneratorFunction"; + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } + + exports.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + exports.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + if (!(toStringTagSymbol in genFun)) { + genFun[toStringTagSymbol] = "GeneratorFunction"; + } + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + exports.awrap = function(arg) { + return { __await: arg }; + }; + + function AsyncIterator(generator) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && + typeof value === "object" && + hasOwn.call(value, "__await")) { + return Promise.resolve(value.__await).then(function(value) { + invoke("next", value, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }); + } + + return Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. + result.value = unwrapped; + resolve(result); + }, function(error) { + // If a rejected Promise was yielded, throw the rejection back + // into the async generator function so it can be handled there. + return invoke("throw", error, resolve, reject); + }); + } + } + + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new Promise(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : callInvokeWithMethodAndArg(); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + AsyncIterator.prototype[asyncIteratorSymbol] = function () { + return this; + }; + exports.AsyncIterator = AsyncIterator; + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + exports.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return exports.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + context.method = method; + context.arg = arg; + + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; + + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + + context.dispatchException(context.arg); + + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + if (record.arg === ContinueSentinel) { + continue; + } + + return { + value: record.arg, + done: context.done + }; + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } + + // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + if (method === undefined) { + // A .throw or .return when the delegate iterator has no .throw + // method always terminates the yield* loop. + context.delegate = null; + + if (context.method === "throw") { + if (delegate.iterator.return) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); + + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } + + context.method = "throw"; + context.arg = new TypeError( + "The iterator does not provide a 'throw' method"); + } + + return ContinueSentinel; + } + + var record = tryCatch(method, delegate.iterator, context.arg); + + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + + var info = record.arg; + + if (! info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; + + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; + + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined; + } + + } else { + // Re-yield the result returned by the delegate method. + return info; + } + + // The delegate iterator is finished, so forget it and continue with + // the outer generator. + context.delegate = null; + return ContinueSentinel; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + Gp[toStringTagSymbol] = "Generator"; + + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + Gp[iteratorSymbol] = function() { + return this; + }; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + exports.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + exports.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + + this.method = "next"; + this.arg = undefined; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined; + } + + return !! caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + + return this.complete(record); + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + + return ContinueSentinel; + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined; + } + + return ContinueSentinel; + } + }; + + // Regardless of whether this script is executing as a CommonJS module + // or not, return the runtime object so that we can declare the variable + // regeneratorRuntime in the outer scope, which allows this module to be + // injected easily by `bin/regenerator --include-runtime script.js`. + return exports; + +}( + // If this script is executing as a CommonJS module, use module.exports + // as the regeneratorRuntime namespace. Otherwise create a new empty + // object. Either way, the resulting object will be used to initialize + // the regeneratorRuntime variable at the top of this file. + typeof module === "object" ? module.exports : {} +)); diff --git a/utils/selectFiles.js b/utils/selectFiles.js new file mode 100644 index 0000000..09371c9 --- /dev/null +++ b/utils/selectFiles.js @@ -0,0 +1,32 @@ +module.exports = { + selectPhotos: function(e, s, o) { + if (void 0 === e[s]) { + var c = 5 - e.length; + c > 0 && wx.chooseImage({ + count: c, + sizeType: [ "compressed" ], + sourceType: [ "camera", "album" ], + success: function(s) { + e = e.concat(s.tempFilePaths), o(e); + } + }); + } else wx.chooseImage({ + count: 1, + sizeType: [ "compressed" ], + sourceType: [ "camera", "album" ], + success: function(c) { + e[s] = c.tempFilePaths[0], o(e); + } + }); + }, + removePhoto: function(e, s, o) { + if (void 0 !== e[s]) { + wx.showModal({ + title: "确定删除该图片?", + success: function(c) { + c.confirm && (e.splice(s, 1), o(e)); + } + }); + } else o(e); + } +}; \ No newline at end of file diff --git a/utils/util.js b/utils/util.js new file mode 100644 index 0000000..26779aa --- /dev/null +++ b/utils/util.js @@ -0,0 +1,290 @@ + +function isString(str) { + return (typeof str == 'string') && str.constructor == String; +} +function isArray(obj) { + return (typeof obj == 'object') && obj.constructor == Array; +} + +function sub_last(str){ + return str.substring(0, str.length - 1) +} +function trim(str) { return str.replace(/(^s*)|(s*$)/g, "");} +function e(e) { + var r = ""; for (var t in e) r += (r ? "&" : "") + t + "=" + e[t]; return r; +} + +function utf16to8(str) { + var out, i, len, c; out = ""; len = str.length; + for (i = 0; i < len; i++) { + c = str.charCodeAt(i); + if ((c >= 0x0001) && (c <= 0x007F)) { + out += str.charAt(i); + } else if (c > 0x07FF) { + out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F)); + out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F)); + out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); + } else { + out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F)); + out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); + } + } + return out; +} + +function utf8to16(str) { + var out, i, len, c; var char2, char3; + out = "";len = str.length; i = 0; + while (i < len) { + c = str.charCodeAt(i++); + switch (c >> 4) { + case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: + // 0xxxxxxx + out += str.charAt(i - 1); + break; + case 12: case 13: + // 110x xxxx 10xx xxxx + char2 = str.charCodeAt(i++); + out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F)); + break; + case 14: + // 1110 xxxx 10xx xxxx 10xx xxxx + char2 = str.charCodeAt(i++); + char3 = str.charCodeAt(i++); + out += String.fromCharCode(((c & 0x0F) << 12) | + ((char2 & 0x3F) << 6) | + ((char3 & 0x3F) << 0)); + break; + } + } + return out; +} + + +function unserialize_o(ss) { + var p = 0, ht = [], hv = 1,r = null; + function unser_null() { p++; return null; } + function unser_boolean() { p++; var b = (ss.charAt(p++) == '1'); p++; return b; } + function unser_integer() { p++; + var i = parseInt(ss.substring(p, p = ss.indexOf(';', p))); p++; return i;} + function unser_double() { + p++;var d = ss.substring(p, p = ss.indexOf(';', p)); + switch (d) { + case 'INF': d = Number.POSITIVE_INFINITY; break; + case '-INF': d = Number.NEGATIVE_INFINITY; break; + default: d = parseFloat(d); + } + p++; return d; + } + function unser_string() { + p++;var l = parseInt(ss.substring(p, p = ss.indexOf(':', p))); + p += 2; var s = utf8to16(ss.substring(p, p += l)); + p += 2; return s; + } + function unser_array() { + p++; var n = parseInt(ss.substring(p, p = ss.indexOf(':', p))); + p += 2; var a = []; ht[hv++] = a; + for (var i = 0; i < n; i++) { + var k; + switch (ss.charAt(p++)) { + case 'i': k = unser_integer(); break; + case 's': k = unser_string(); break; + case 'U': k = unser_unicode_string(); break; + default: return false; + } + a[k] = __unserialize(); + } + p++; return a; + } + function unser_object() { + p++; + var l = parseInt(ss.substring(p, p = ss.indexOf(':', p))); + p += 2; + var cn = utf8to16(ss.substring(p, p += l)); + p += 2; + var n = parseInt(ss.substring(p, p = ss.indexOf(':', p))); + p += 2; + if (eval(['typeof(', cn, ') == "undefined"'].join(''))) { + eval(['function ', cn, '(){}'].join('')); + } + var o = eval(['new ', cn, '()'].join('')); + ht[hv++] = o; + for (var i = 0; i < n; i++) { + var k; + switch (ss.charAt(p++)) { + case 's': k = unser_string(); break; + case 'U': k = unser_unicode_string(); break; + default: return false; + } + if (k.charAt(0) == '\0') { + k = k.substring(k.indexOf('\0', 1) + 1, k.length); + } + o[k] = __unserialize(); + } + p++; + if (typeof (o.__wakeup) == 'function') o.__wakeup(); + return o; + } + function unser_custom_object() { + p++; + var l = parseInt(ss.substring(p, p = ss.indexOf(':', p))); + p += 2; + var cn = utf8to16(ss.substring(p, p += l)); + p += 2; + var n = parseInt(ss.substring(p, p = ss.indexOf(':', p))); + p += 2; + if (eval(['typeof(', cn, ') == "undefined"'].join(''))) { + eval(['function ', cn, '(){}'].join('')); + } + var o = eval(['new ', cn, '()'].join('')); + ht[hv++] = o; + if (typeof (o.unserialize) != 'function') p += n; + else o.unserialize(ss.substring(p, p += n)); + p++; + return o; + } + + function unser_unicode_string() { + p++; var l = parseInt(ss.substring(p, p = ss.indexOf(':', p))); + p += 2; var sb = []; + for (i = 0; i < l; i++) { + if ((sb[i] = ss.charAt(p++)) == '\\') { + sb[i] = String.fromCharCode(parseInt(ss.substring(p, p += 4), 16)); + } + } + p += 2; return sb.join(''); + } + function unser_ref() { p++; var r = parseInt(ss.substring(p, p = ss.indexOf(';', p))); p++; return ht[r];} + function __unserialize() { + switch (ss.charAt(p++)) { + case 'N': return ht[hv++] = unser_null(); + case 'b': return ht[hv++] = unser_boolean(); + case 'i': return ht[hv++] = unser_integer(); + case 'd': return ht[hv++] = unser_double(); + case 's': return ht[hv++] = unser_string(); + case 'U': return ht[hv++] = unser_unicode_string(); + case 'r': return ht[hv++] = unser_ref(); + case 'a': return unser_array(); + case 'O': return unser_object(); + case 'C': return unser_custom_object(); + case 'R': return unser_ref(); + default: return false; + } + } + return __unserialize(); +} + +//---数组序列化的反转--- +function unserialize(ss) { + if (ss=="" || ss==undefined || ss==null) return ''; + //ss ='a:2:{i:0;s:60:"/public/upload/comment/8704/2017/10-14/15079840099736199.png";i:1;s:60:"/public/upload/comment/8704/2017/10-14/15079840132718554.jpg";}'; + ss=ss.substring(7); + var arr = ss.split('i:'), rs=new Array(); + for (var i = 0; i < arr.length;i++){ + var ind0 = arr[i].indexOf('/public'); + var ind1 = arr[i].indexOf('";'); + var txt = arr[i].substring(ind0, ind1); + rs.push(txt); + } + return rs; +} + +//-----判断一个对象是不是空对象-------- +function isEmptyObject(obj) { + for (var key in obj) { return false }; + return true +}; + +function gettimestamp(){ + var timestamp = Date.parse(new Date()); + timestamp = timestamp / 1000; + return timestamp; +} +module.exports = { + formatTime: function(e, r) { + var t = e ? new Date(1e3 * e) : new Date(), n = t.getFullYear(), o = t.getMonth() + 1, a = t.getDate(), u = t.getHours(), i = t.getMinutes(), f = t.getSeconds(), s = function(e) { + return (e = e.toString())[1] ? e : "0" + e; + }; + return void 0 !== r && 0 == r ? [ n, o, a ].map(s).join("-") + " " + [ u, i ].map(s).join(":") : [ n, o, a ].map(s).join("-") + " " + [ u, i, f ].map(s).join(":"); + }, + format: function(e, r) { + var t = new Date(); + t.setTime(1e3 * e); + var n = { + "M+": t.getMonth() + 1, + "d+": t.getDate(), + "h+": t.getHours(), + "m+": t.getMinutes(), + "s+": t.getSeconds(), + "q+": Math.floor((t.getMonth() + 3) / 3), + S: t.getMilliseconds() + }; + void 0 === r && (r = "yyyy-MM-dd hh:mm:ss"), /(y+)/.test(r) && (r = r.replace(RegExp.$1, (t.getFullYear() + "").substr(4 - RegExp.$1.length))); + for (var o in n) new RegExp("(" + o + ")").test(r) && (r = r.replace(RegExp.$1, 1 == RegExp.$1.length ? n[o] : ("00" + n[o]).substr(("" + n[o]).length))); + return r; + }, + json2Form: function(e) { + var r = []; + for (var t in e) r.push(encodeURIComponent(t) + "=" + encodeURIComponent(e[t])); + return r.join("&"); + }, + randomString: function(e) { + e = e || 32; + for (var r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", t = r.length, n = "", o = 0; o < e; o++) n += r.charAt(Math.floor(Math.random() * (t + 1))); + return n; + }, + inArray: function(e, r) { + for (var t = 0; t < r.length; t++) if (e == r[t]) return !0; + return !1; + }, + sortSize: function(e, r) { + return void 0 === r && (r = 0), r ? e.sort(function(e, r) { + return r - e; + }) : e.sort(function(e, r) { + return e - r; + }), e; + }, + convertRequestArray: function(e, r) { + for (var t = {}, n = 0; n < r.length; n++) t[e + "[" + n + "]"] = r[n]; + return t; + }, + remainTime: function(e) { + var r = "", t = !1, n = Math.floor(e / 864e5); + r = n ? n + "天" : "", t = !!n, e -= 864e5 * n; + var o = Math.floor(e / 36e5); + r += o ? o + "时" : t ? "0时" : "", t = !!o, e -= 36e5 * o; + var a = Math.floor(e / 6e4); + r += a ? a + "分" : t ? "0分" : "", e -= 6e4 * a; + var u = Math.floor(e / 1e3); + return r += u ? u + "秒" : "0秒"; + }, + transTime: function(e) { + var r = { + hour: 0, + minute: 0, + second: 0 + }, t = Math.floor(e / 36e5); + r.hour = t || "0", e -= 36e5 * t; + var n = Math.floor(e / 6e4); + r.minute = n || "0", e -= 6e4 * n; + var o = Math.floor(e / 1e3); + return r.second = o || "0", r; + }, + Obj2Str: e, + JumpTo: function(r, t, n) { + var o = e(t); + n ? wx.redirectTo({ + url: r + o + }) : wx.navigateTo({ + url: r + o + }); + }, + unserialize: unserialize, + unserialize_o: unserialize_o, + trim: trim, //去空格 + isEmptyObject: isEmptyObject, //判断空对象 + gettimestamp: gettimestamp, //获取时间戳 + isString: isString, + isArray: isArray, + sub_last: sub_last,//去掉末尾一个字符 +}; diff --git a/utils/wxParse/html2json.js b/utils/wxParse/html2json.js new file mode 100644 index 0000000..671e6a2 --- /dev/null +++ b/utils/wxParse/html2json.js @@ -0,0 +1,105 @@ +function e(e) { + for (var t = {}, r = e.split(","), s = 0; s < r.length; s++) t[r[s]] = !0; + return t; +} + +function t(e) { + return e.replace(/<\?xml.*\?>\n/, "").replace(/<.*!doctype.*\>\n/, "").replace(/<.*!DOCTYPE.*\>\n/, ""); +} + +function r(e) { + return e.replace(/\r?\n+/g, "").replace(//gi, "").replace(/\/\*.*?\*\//gi, "").replace(/[ ]+ 0 && void 0 !== arguments[0] ? arguments[0] : "", t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "/wxParse/emojis/", r = arguments[2]; + a = e, o = t, i = r; + } +}; \ No newline at end of file diff --git a/utils/wxParse/htmlparser.js b/utils/wxParse/htmlparser.js new file mode 100644 index 0000000..de7b6e9 --- /dev/null +++ b/utils/wxParse/htmlparser.js @@ -0,0 +1,48 @@ +function e(e) { + for (var t = {}, r = e.split(","), s = 0; s < r.length; s++) t[r[s]] = !0; + return t; +} + +var t = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/, r = /^<\/([-A-Za-z0-9_]+)[^>]*>/, s = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g, a = e("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"), n = e("a,address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"), i = e("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"), o = e("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"), l = e("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"), c = e("wxxxcode-style,script,style,view,scroll-view,block"); + +module.exports = function(e, d) { + function f(e, t) { + if (t) for (t = t.toLowerCase(), r = b.length - 1; r >= 0 && b[r] != t; r--) ; else var r = 0; + if (r >= 0) { + for (var s = b.length - 1; s >= r; s--) d.end && d.end(b[s]); + b.length = r; + } + } + var p, u, h, b = [], m = e; + for (b.last = function() { + return this[this.length - 1]; + }; e; ) { + if (u = !0, b.last() && c[b.last()]) e = e.replace(new RegExp("([\\s\\S]*?)]*>"), function(e, t) { + return t = t.replace(/|/g, "$1$2"), d.chars && d.chars(t), + ""; + }), f(0, b.last()); else if (0 == e.indexOf("\x3c!--") ? (p = e.indexOf("--\x3e")) >= 0 && (d.comment && d.comment(e.substring(4, p)), + e = e.substring(p + 3), u = !1) : 0 == e.indexOf("" : "Error in unnamed extension", a = { + valid: !0, + error: "" + }; + s.helper.isArray(e) || (e = [ e ]); + for (var o = 0; o < e.length; ++o) { + var i = t + " sub-extension " + o + ": ", l = e[o]; + if ("object" !== (void 0 === l ? "undefined" : n(l))) return a.valid = !1, a.error = i + "must be an object, but " + (void 0 === l ? "undefined" : n(l)) + " given", + a; + if (!s.helper.isString(l.type)) return a.valid = !1, a.error = i + 'property "type" must be a string, but ' + n(l.type) + " given", + a; + var c = l.type = l.type.toLowerCase(); + if ("language" === c && (c = l.type = "lang"), "html" === c && (c = l.type = "output"), + "lang" !== c && "output" !== c && "listener" !== c) return a.valid = !1, a.error = i + "type " + c + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"', + a; + if ("listener" === c) { + if (s.helper.isUndefined(l.listeners)) return a.valid = !1, a.error = i + '. Extensions of type "listener" must have a property called "listeners"', + a; + } else if (s.helper.isUndefined(l.filter) && s.helper.isUndefined(l.regex)) return a.valid = !1, + a.error = i + c + ' extensions must define either a "regex" property or a "filter" method', + a; + if (l.listeners) { + if ("object" !== n(l.listeners)) return a.valid = !1, a.error = i + '"listeners" property must be an object but ' + n(l.listeners) + " given", + a; + for (var u in l.listeners) if (l.listeners.hasOwnProperty(u) && "function" != typeof l.listeners[u]) return a.valid = !1, + a.error = i + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + u + " must be a function but " + n(l.listeners[u]) + " given", + a; + } + if (l.filter) { + if ("function" != typeof l.filter) return a.valid = !1, a.error = i + '"filter" must be a function, but ' + n(l.filter) + " given", + a; + } else if (l.regex) { + if (s.helper.isString(l.regex) && (l.regex = new RegExp(l.regex, "g")), !l.regex instanceof RegExp) return a.valid = !1, + a.error = i + '"regex" property must either be a string or a RegExp object, but ' + n(l.regex) + " given", + a; + if (s.helper.isUndefined(l.replace)) return a.valid = !1, a.error = i + '"regex" extensions must implement a replace string or function', + a; + } + } + return a; +} + +function t(e, r) { + return "~E" + r.charCodeAt(0) + "E"; +} + +var n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { + return typeof e; +} : function(e) { + return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; +}, s = {}, a = {}, o = {}, i = e(!0), l = { + github: { + omitExtraWLInCodeBlocks: !0, + prefixHeaderId: "user-content-", + simplifiedAutoLink: !0, + literalMidWordUnderscores: !0, + strikethrough: !0, + tables: !0, + tablesHeaderId: !0, + ghCodeBlocks: !0, + tasklists: !0 + }, + vanilla: e(!0) +}; + +s.helper = {}, s.extensions = {}, s.setOption = function(e, r) { + return i[e] = r, this; +}, s.getOption = function(e) { + return i[e]; +}, s.getOptions = function() { + return i; +}, s.resetOptions = function() { + i = e(!0); +}, s.setFlavor = function(e) { + if (l.hasOwnProperty(e)) { + var r = l[e]; + for (var t in r) r.hasOwnProperty(t) && (i[t] = r[t]); + } +}, s.getDefaultOptions = function(r) { + return e(r); +}, s.subParser = function(e, r) { + if (s.helper.isString(e)) { + if (void 0 === r) { + if (a.hasOwnProperty(e)) return a[e]; + throw Error("SubParser named " + e + " not registered!"); + } + a[e] = r; + } +}, s.extension = function(e, t) { + if (!s.helper.isString(e)) throw Error("Extension 'name' must be a string"); + if (e = s.helper.stdExtName(e), s.helper.isUndefined(t)) { + if (!o.hasOwnProperty(e)) throw Error("Extension named " + e + " is not registered!"); + return o[e]; + } + "function" == typeof t && (t = t()), s.helper.isArray(t) || (t = [ t ]); + var n = r(t, e); + if (!n.valid) throw Error(n.error); + o[e] = t; +}, s.getAllExtensions = function() { + return o; +}, s.removeExtension = function(e) { + delete o[e]; +}, s.resetExtensions = function() { + o = {}; +}, s.validateExtension = function(e) { + var t = r(e, null); + return !!t.valid || (console.warn(t.error), !1); +}, s.hasOwnProperty("helper") || (s.helper = {}), s.helper.isString = function(e) { + return "string" == typeof e || e instanceof String; +}, s.helper.isFunction = function(e) { + var r = {}; + return e && "[object Function]" === r.toString.call(e); +}, s.helper.forEach = function(e, r) { + if ("function" == typeof e.forEach) e.forEach(r); else for (var t = 0; t < e.length; t++) r(e[t], t, e); +}, s.helper.isArray = function(e) { + return e.constructor === Array; +}, s.helper.isUndefined = function(e) { + return void 0 === e; +}, s.helper.stdExtName = function(e) { + return e.replace(/[_-]||\s/g, "").toLowerCase(); +}, s.helper.escapeCharactersCallback = t, s.helper.escapeCharacters = function(e, r, n) { + var s = "([" + r.replace(/([\[\]\\])/g, "\\$1") + "])"; + n && (s = "\\\\" + s); + var a = new RegExp(s, "g"); + return e = e.replace(a, t); +}; + +var c = function(e, r, t, n) { + var s, a, o, i, l, c = n || "", u = c.indexOf("g") > -1, p = new RegExp(r + "|" + t, "g" + c.replace(/g/g, "")), h = new RegExp(r, c.replace(/g/g, "")), d = []; + do { + for (s = 0; o = p.exec(e); ) if (h.test(o[0])) s++ || (i = (a = p.lastIndex) - o[0].length); else if (s && !--s) { + l = o.index + o[0].length; + var f = { + left: { + start: i, + end: a + }, + match: { + start: a, + end: o.index + }, + right: { + start: o.index, + end: l + }, + wholeMatch: { + start: i, + end: l + } + }; + if (d.push(f), !u) return d; + } + } while (s && (p.lastIndex = a)); + return d; +}; + +s.helper.matchRecursiveRegExp = function(e, r, t, n) { + for (var s = c(e, r, t, n), a = [], o = 0; o < s.length; ++o) a.push([ e.slice(s[o].wholeMatch.start, s[o].wholeMatch.end), e.slice(s[o].match.start, s[o].match.end), e.slice(s[o].left.start, s[o].left.end), e.slice(s[o].right.start, s[o].right.end) ]); + return a; +}, s.helper.replaceRecursiveRegExp = function(e, r, t, n, a) { + if (!s.helper.isFunction(r)) { + var o = r; + r = function() { + return o; + }; + } + var i = c(e, t, n, a), l = e, u = i.length; + if (u > 0) { + var p = []; + 0 !== i[0].wholeMatch.start && p.push(e.slice(0, i[0].wholeMatch.start)); + for (var h = 0; h < u; ++h) p.push(r(e.slice(i[h].wholeMatch.start, i[h].wholeMatch.end), e.slice(i[h].match.start, i[h].match.end), e.slice(i[h].left.start, i[h].left.end), e.slice(i[h].right.start, i[h].right.end))), + h < u - 1 && p.push(e.slice(i[h].wholeMatch.end, i[h + 1].wholeMatch.start)); + i[u - 1].wholeMatch.end < e.length && p.push(e.slice(i[u - 1].wholeMatch.end)), + l = p.join(""); + } + return l; +}, s.helper.isUndefined(console) && (console = { + warn: function(e) { + alert(e); + }, + log: function(e) { + alert(e); + }, + error: function(e) { + throw e; + } +}), s.Converter = function(e) { + function t(e, t) { + if (t = t || null, s.helper.isString(e)) { + if (e = s.helper.stdExtName(e), t = e, s.extensions[e]) return console.warn("DEPRECATION WARNING: " + e + " is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"), + void a(s.extensions[e], e); + if (s.helper.isUndefined(o[e])) throw Error('Extension "' + e + '" could not be loaded. It was either not found or is not a valid extension.'); + e = o[e]; + } + "function" == typeof e && (e = e()), s.helper.isArray(e) || (e = [ e ]); + var n = r(e, t); + if (!n.valid) throw Error(n.error); + for (var i = 0; i < e.length; ++i) { + switch (e[i].type) { + case "lang": + h.push(e[i]); + break; + + case "output": + d.push(e[i]); + } + if (e[i].hasOwnProperty(f)) for (var l in e[i].listeners) e[i].listeners.hasOwnProperty(l) && c(l, e[i].listeners[l]); + } + } + function a(e, t) { + "function" == typeof e && (e = e(new s.Converter())), s.helper.isArray(e) || (e = [ e ]); + var n = r(e, t); + if (!n.valid) throw Error(n.error); + for (var a = 0; a < e.length; ++a) switch (e[a].type) { + case "lang": + h.push(e[a]); + break; + + case "output": + d.push(e[a]); + break; + + default: + throw Error("Extension loader error: Type unrecognized!!!"); + } + } + function c(e, r) { + if (!s.helper.isString(e)) throw Error("Invalid argument in converter.listen() method: name must be a string, but " + (void 0 === e ? "undefined" : n(e)) + " given"); + if ("function" != typeof r) throw Error("Invalid argument in converter.listen() method: callback must be a function, but " + (void 0 === r ? "undefined" : n(r)) + " given"); + f.hasOwnProperty(e) || (f[e] = []), f[e].push(r); + } + function u(e) { + var r = e.match(/^\s*/)[0].length, t = new RegExp("^\\s{0," + r + "}", "gm"); + return e.replace(t, ""); + } + var p = {}, h = [], d = [], f = {}; + !function() { + e = e || {}; + for (var r in i) i.hasOwnProperty(r) && (p[r] = i[r]); + if ("object" !== (void 0 === e ? "undefined" : n(e))) throw Error("Converter expects the passed parameter to be an object, but " + (void 0 === e ? "undefined" : n(e)) + " was passed instead."); + for (var a in e) e.hasOwnProperty(a) && (p[a] = e[a]); + p.extensions && s.helper.forEach(p.extensions, t); + }(), this._dispatch = function(e, r, t, n) { + if (f.hasOwnProperty(e)) for (var s = 0; s < f[e].length; ++s) { + var a = f[e][s](e, r, this, t, n); + a && void 0 !== a && (r = a); + } + return r; + }, this.listen = function(e, r) { + return c(e, r), this; + }, this.makeHtml = function(e) { + if (!e) return e; + var r = { + gHtmlBlocks: [], + gHtmlMdBlocks: [], + gHtmlSpans: [], + gUrls: {}, + gTitles: {}, + gDimensions: {}, + gListLevel: 0, + hashLinkCounts: {}, + langExtensions: h, + outputModifiers: d, + converter: this, + ghCodeBlocks: [] + }; + return e = e.replace(/~/g, "~T"), e = e.replace(/\$/g, "~D"), e = e.replace(/\r\n/g, "\n"), + e = e.replace(/\r/g, "\n"), p.smartIndentationFix && (e = u(e)), e = e, e = s.subParser("detab")(e, p, r), + e = s.subParser("stripBlankLines")(e, p, r), s.helper.forEach(h, function(t) { + e = s.subParser("runExtension")(t, e, p, r); + }), e = s.subParser("hashPreCodeTags")(e, p, r), e = s.subParser("githubCodeBlocks")(e, p, r), + e = s.subParser("hashHTMLBlocks")(e, p, r), e = s.subParser("hashHTMLSpans")(e, p, r), + e = s.subParser("stripLinkDefinitions")(e, p, r), e = s.subParser("blockGamut")(e, p, r), + e = s.subParser("unhashHTMLSpans")(e, p, r), e = s.subParser("unescapeSpecialChars")(e, p, r), + e = e.replace(/~D/g, "$$"), e = e.replace(/~T/g, "~"), s.helper.forEach(d, function(t) { + e = s.subParser("runExtension")(t, e, p, r); + }), e; + }, this.setOption = function(e, r) { + p[e] = r; + }, this.getOption = function(e) { + return p[e]; + }, this.getOptions = function() { + return p; + }, this.addExtension = function(e, r) { + t(e, r = r || null); + }, this.useExtension = function(e) { + t(e); + }, this.setFlavor = function(e) { + if (l.hasOwnProperty(e)) { + var r = l[e]; + for (var t in r) r.hasOwnProperty(t) && (p[t] = r[t]); + } + }, this.removeExtension = function(e) { + s.helper.isArray(e) || (e = [ e ]); + for (var r = 0; r < e.length; ++r) { + for (var t = e[r], n = 0; n < h.length; ++n) h[n] === t && h[n].splice(n, 1); + for (;0 < d.length; ++n) d[0] === t && d[0].splice(n, 1); + } + }, this.getAllExtensions = function() { + return { + language: h, + output: d + }; + }; +}, s.subParser("anchors", function(e, r, t) { + var n = function(e, r, n, a, o, i, l, c) { + s.helper.isUndefined(c) && (c = ""), e = r; + var u = n, p = a.toLowerCase(), h = o, d = c; + if (!h) if (p || (p = u.toLowerCase().replace(/ ?\n/g, " ")), h = "#" + p, s.helper.isUndefined(t.gUrls[p])) { + if (!(e.search(/\(\s*\)$/m) > -1)) return e; + h = ""; + } else h = t.gUrls[p], s.helper.isUndefined(t.gTitles[p]) || (d = t.gTitles[p]); + var f = '"; + }; + return e = (e = t.converter._dispatch("anchors.before", e, r, t)).replace(/(\[((?:\[[^\]]*]|[^\[\]])*)][ ]?(?:\n[ ]*)?\[(.*?)])()()()()/g, n), + e = e.replace(/(\[((?:\[[^\]]*]|[^\[\]])*)]\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, n), + e = e.replace(/(\[([^\[\]]+)])()()()()()/g, n), e = t.converter._dispatch("anchors.after", e, r, t); +}), s.subParser("autoLinks", function(e, r, t) { + function n(e, r) { + var t = r; + return /^www\./i.test(r) && (r = r.replace(/^www\./i, "http://www.")), '' + t + ""; + } + function a(e, r) { + var t = s.subParser("unescapeSpecialChars")(r); + return s.subParser("encodeEmailAddress")(t); + } + var o = /\b(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+)(?=\s|$)(?!["<>])/gi, i = /<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)>/gi, l = /(?:^|[ \n\t])([A-Za-z0-9!#$%&'*+-/=?^_`\{|}~\.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?:$|[ \n\t])/gi, c = /<(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi; + return e = (e = t.converter._dispatch("autoLinks.before", e, r, t)).replace(i, n), + e = e.replace(c, a), r.simplifiedAutoLink && (e = (e = e.replace(o, n)).replace(l, a)), + e = t.converter._dispatch("autoLinks.after", e, r, t); +}), s.subParser("blockGamut", function(e, r, t) { + e = t.converter._dispatch("blockGamut.before", e, r, t), e = s.subParser("blockQuotes")(e, r, t), + e = s.subParser("headers")(e, r, t); + var n = s.subParser("hashBlock")("
", r, t); + return e = e.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm, n), e = e.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm, n), + e = e.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm, n), e = s.subParser("lists")(e, r, t), + e = s.subParser("codeBlocks")(e, r, t), e = s.subParser("tables")(e, r, t), e = s.subParser("hashHTMLBlocks")(e, r, t), + e = s.subParser("paragraphs")(e, r, t), e = t.converter._dispatch("blockGamut.after", e, r, t); +}), s.subParser("blockQuotes", function(e, r, t) { + return e = t.converter._dispatch("blockQuotes.before", e, r, t), e = e.replace(/((^[ \t]{0,3}>[ \t]?.+\n(.+\n)*\n*)+)/gm, function(e, n) { + var a = n; + return a = a.replace(/^[ \t]*>[ \t]?/gm, "~0"), a = a.replace(/~0/g, ""), a = a.replace(/^[ \t]+$/gm, ""), + a = s.subParser("githubCodeBlocks")(a, r, t), a = s.subParser("blockGamut")(a, r, t), + a = a.replace(/(^|\n)/g, "$1 "), a = a.replace(/(\s*
[^\r]+?<\/pre>)/gm, function(e, r) {
+            var t = r;
+            return t = t.replace(/^  /gm, "~0"), t = t.replace(/~0/g, "");
+        }), s.subParser("hashBlock")("
\n" + a + "\n
", r, t); + }), e = t.converter._dispatch("blockQuotes.after", e, r, t); +}), s.subParser("codeBlocks", function(e, r, t) { + e = t.converter._dispatch("codeBlocks.before", e, r, t); + var n = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g; + return e = (e += "~0").replace(n, function(e, n, a) { + var o = n, i = a, l = "\n"; + return o = s.subParser("outdent")(o), o = s.subParser("encodeCode")(o), o = s.subParser("detab")(o), + o = o.replace(/^\n+/g, ""), o = o.replace(/\n+$/g, ""), r.omitExtraWLInCodeBlocks && (l = ""), + o = "
" + o + l + "
", s.subParser("hashBlock")(o, r, t) + i; + }), e = e.replace(/~0/, ""), e = t.converter._dispatch("codeBlocks.after", e, r, t); +}), s.subParser("codeSpans", function(e, r, t) { + return void 0 === (e = t.converter._dispatch("codeSpans.before", e, r, t)) && (e = ""), + e = e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm, function(e, r, t, n) { + var a = n; + return a = a.replace(/^([ \t]*)/g, ""), a = a.replace(/[ \t]*$/g, ""), a = s.subParser("encodeCode")(a), + r + "" + a + ""; + }), e = t.converter._dispatch("codeSpans.after", e, r, t); +}), s.subParser("detab", function(e) { + return e = e.replace(/\t(?=\t)/g, " "), e = e.replace(/\t/g, "~A~B"), e = e.replace(/~B(.+?)~A/g, function(e, r) { + for (var t = r, n = 4 - t.length % 4, s = 0; s < n; s++) t += " "; + return t; + }), e = e.replace(/~A/g, " "), e = e.replace(/~B/g, ""); +}), s.subParser("encodeAmpsAndAngles", function(e) { + return e = e.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&"), e = e.replace(/<(?![a-z\/?\$!])/gi, "<"); +}), s.subParser("encodeBackslashEscapes", function(e) { + return e = e.replace(/\\(\\)/g, s.helper.escapeCharactersCallback), e = e.replace(/\\([`*_{}\[\]()>#+-.!])/g, s.helper.escapeCharactersCallback); +}), s.subParser("encodeCode", function(e) { + return e = e.replace(/&/g, "&"), e = e.replace(//g, ">"), + e = s.helper.escapeCharacters(e, "*_{}[]\\", !1); +}), s.subParser("encodeEmailAddress", function(e) { + var r = [ function(e) { + return "&#" + e.charCodeAt(0) + ";"; + }, function(e) { + return "&#x" + e.charCodeAt(0).toString(16) + ";"; + }, function(e) { + return e; + } ]; + return e = "mailto:" + e, e = e.replace(/./g, function(e) { + if ("@" === e) e = r[Math.floor(2 * Math.random())](e); else if (":" !== e) { + var t = Math.random(); + e = t > .9 ? r[2](e) : t > .45 ? r[1](e) : r[0](e); + } + return e; + }), e = '' + e + "", e = e.replace(/">.+:/g, '">'); +}), s.subParser("escapeSpecialCharsWithinTagAttributes", function(e) { + var r = /(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|)/gi; + return e = e.replace(r, function(e) { + var r = e.replace(/(.)<\/?code>(?=.)/g, "$1`"); + return r = s.helper.escapeCharacters(r, "\\`*_", !1); + }); +}), s.subParser("githubCodeBlocks", function(e, r, t) { + return r.ghCodeBlocks ? (e = t.converter._dispatch("githubCodeBlocks.before", e, r, t), + e += "~0", e = e.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g, function(e, n, a) { + var o = r.omitExtraWLInCodeBlocks ? "" : "\n"; + return a = s.subParser("encodeCode")(a), a = s.subParser("detab")(a), a = a.replace(/^\n+/g, ""), + a = a.replace(/\n+$/g, ""), a = "
" + a + o + "
", + a = s.subParser("hashBlock")(a, r, t), "\n\n~G" + (t.ghCodeBlocks.push({ + text: e, + codeblock: a + }) - 1) + "G\n\n"; + }), e = e.replace(/~0/, ""), t.converter._dispatch("githubCodeBlocks.after", e, r, t)) : e; +}), s.subParser("hashBlock", function(e, r, t) { + return e = e.replace(/(^\n+|\n+$)/g, ""), "\n\n~K" + (t.gHtmlBlocks.push(e) - 1) + "K\n\n"; +}), s.subParser("hashElement", function(e, r, t) { + return function(e, r) { + var n = r; + return n = n.replace(/\n\n/g, "\n"), n = n.replace(/^\n/, ""), n = n.replace(/\n+$/g, ""), + n = "\n\n~K" + (t.gHtmlBlocks.push(n) - 1) + "K\n\n"; + }; +}), s.subParser("hashHTMLBlocks", function(e, r, t) { + for (var n = [ "pre", "div", "h1", "h2", "h3", "h4", "h5", "h6", "blockquote", "table", "dl", "ol", "ul", "script", "noscript", "form", "fieldset", "iframe", "math", "style", "section", "header", "footer", "nav", "article", "aside", "address", "audio", "canvas", "figure", "hgroup", "output", "video", "p" ], a = 0; a < n.length; ++a) e = s.helper.replaceRecursiveRegExp(e, function(e, r, n, s) { + var a = e; + return -1 !== n.search(/\bmarkdown\b/) && (a = n + t.converter.makeHtml(r) + s), + "\n\n~K" + (t.gHtmlBlocks.push(a) - 1) + "K\n\n"; + }, "^(?: |\\t){0,3}<" + n[a] + "\\b[^>]*>", "", "gim"); + return e = e.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g, s.subParser("hashElement")(e, r, t)), + e = e.replace(/()/g, s.subParser("hashElement")(e, r, t)), e = e.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g, s.subParser("hashElement")(e, r, t)); +}), s.subParser("hashHTMLSpans", function(e, r, t) { + for (var n = s.helper.matchRecursiveRegExp(e, "]*>", "", "gi"), a = 0; a < n.length; ++a) e = e.replace(n[a][0], "~L" + (t.gHtmlSpans.push(n[a][0]) - 1) + "L"); + return e; +}), s.subParser("unhashHTMLSpans", function(e, r, t) { + for (var n = 0; n < t.gHtmlSpans.length; ++n) e = e.replace("~L" + n + "L", t.gHtmlSpans[n]); + return e; +}), s.subParser("hashPreCodeTags", function(e, r, t) { + return e = s.helper.replaceRecursiveRegExp(e, function(e, r, n, a) { + var o = n + s.subParser("encodeCode")(r) + a; + return "\n\n~G" + (t.ghCodeBlocks.push({ + text: e, + codeblock: o + }) - 1) + "G\n\n"; + }, "^(?: |\\t){0,3}]*>\\s*]*>", "^(?: |\\t){0,3}\\s*
", "gim"); +}), s.subParser("headers", function(e, r, t) { + function n(e) { + var r, n = e.replace(/[^\w]/g, "").toLowerCase(); + return t.hashLinkCounts[n] ? r = n + "-" + t.hashLinkCounts[n]++ : (r = n, t.hashLinkCounts[n] = 1), + !0 === a && (a = "section"), s.helper.isString(a) ? a + r : r; + } + e = t.converter._dispatch("headers.before", e, r, t); + var a = r.prefixHeaderId, o = isNaN(parseInt(r.headerLevelStart)) ? 1 : parseInt(r.headerLevelStart), i = r.smoothLivePreview ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm, l = r.smoothLivePreview ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm; + return e = e.replace(i, function(e, a) { + var i = s.subParser("spanGamut")(a, r, t), l = r.noHeaderId ? "" : ' id="' + n(a) + '"', c = o, u = "" + i + ""; + return s.subParser("hashBlock")(u, r, t); + }), e = e.replace(l, function(e, a) { + var i = s.subParser("spanGamut")(a, r, t), l = r.noHeaderId ? "" : ' id="' + n(a) + '"', c = o + 1, u = "" + i + ""; + return s.subParser("hashBlock")(u, r, t); + }), e = e.replace(/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm, function(e, a, i) { + var l = s.subParser("spanGamut")(i, r, t), c = r.noHeaderId ? "" : ' id="' + n(i) + '"', u = o - 1 + a.length, p = "" + l + ""; + return s.subParser("hashBlock")(p, r, t); + }), e = t.converter._dispatch("headers.after", e, r, t); +}), s.subParser("images", function(e, r, t) { + function n(e, r, n, a, o, i, l, c) { + var u = t.gUrls, p = t.gTitles, h = t.gDimensions; + if (n = n.toLowerCase(), c || (c = ""), "" === a || null === a) { + if ("" !== n && null !== n || (n = r.toLowerCase().replace(/ ?\n/g, " ")), a = "#" + n, + s.helper.isUndefined(u[n])) return e; + a = u[n], s.helper.isUndefined(p[n]) || (c = p[n]), s.helper.isUndefined(h[n]) || (o = h[n].width, + i = h[n].height); + } + r = r.replace(/"/g, """), r = s.helper.escapeCharacters(r, "*_", !1); + var d = '' + r + '?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(['"])(.*?)\6[ \t]*)?\)/g, o = /!\[([^\]]*?)] ?(?:\n *)?\[(.*?)]()()()()()/g; + return e = (e = t.converter._dispatch("images.before", e, r, t)).replace(o, n), + e = e.replace(a, n), e = t.converter._dispatch("images.after", e, r, t); +}), s.subParser("italicsAndBold", function(e, r, t) { + return e = t.converter._dispatch("italicsAndBold.before", e, r, t), e = r.literalMidWordUnderscores ? (e = (e = (e = e.replace(/(^|\s|>|\b)__(?=\S)([\s\S]+?)__(?=\b|<|\s|$)/gm, "$1$2")).replace(/(^|\s|>|\b)_(?=\S)([\s\S]+?)_(?=\b|<|\s|$)/gm, "$1$2")).replace(/(\*\*)(?=\S)([^\r]*?\S[*]*)\1/g, "$2")).replace(/(\*)(?=\S)([^\r]*?\S)\1/g, "$2") : (e = e.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g, "$2")).replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g, "$2"), + e = t.converter._dispatch("italicsAndBold.after", e, r, t); +}), s.subParser("lists", function(e, r, t) { + function n(e, n) { + t.gListLevel++, e = e.replace(/\n{2,}$/, "\n"), e += "~0"; + var a = /(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm, o = /\n[ \t]*\n(?!~0)/.test(e); + return e = e.replace(a, function(e, n, a, i, l, c, u) { + u = u && "" !== u.trim(); + var p = s.subParser("outdent")(l, r, t), h = ""; + return c && r.tasklists && (h = ' class="task-list-item" style="list-style-type: none;"', + p = p.replace(/^[ \t]*\[(x|X| )?]/m, function() { + var e = ' -1 ? (p = s.subParser("githubCodeBlocks")(p, r, t), + p = s.subParser("blockGamut")(p, r, t)) : (p = (p = s.subParser("lists")(p, r, t)).replace(/\n$/, ""), + p = o ? s.subParser("paragraphs")(p, r, t) : s.subParser("spanGamut")(p, r, t)), + p = "\n" + p + "\n"; + }), e = e.replace(/~0/g, ""), t.gListLevel--, n && (e = e.replace(/\s+$/, "")), + e; + } + function a(e, r, t) { + var s = "ul" === r ? /^ {0,2}\d+\.[ \t]/gm : /^ {0,2}[*+-][ \t]/gm, a = [], o = ""; + if (-1 !== e.search(s)) { + !function e(a) { + var i = a.search(s); + -1 !== i ? (o += "\n\n<" + r + ">" + n(a.slice(0, i), !!t) + "\n\n", + s = "ul" === (r = "ul" === r ? "ol" : "ul") ? /^ {0,2}\d+\.[ \t]/gm : /^ {0,2}[*+-][ \t]/gm, + e(a.slice(i))) : o += "\n\n<" + r + ">" + n(a, !!t) + "\n\n"; + }(e); + for (var i = 0; i < a.length; ++i) ; + } else o = "\n\n<" + r + ">" + n(e, !!t) + "\n\n"; + return o; + } + e = t.converter._dispatch("lists.before", e, r, t), e += "~0"; + var o = /^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm; + return t.gListLevel ? e = e.replace(o, function(e, r, t) { + return a(r, t.search(/[*+-]/g) > -1 ? "ul" : "ol", !0); + }) : (o = /(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm, + e = e.replace(o, function(e, r, t, n) { + return a(t, n.search(/[*+-]/g) > -1 ? "ul" : "ol"); + })), e = e.replace(/~0/, ""), e = t.converter._dispatch("lists.after", e, r, t); +}), s.subParser("outdent", function(e) { + return e = e.replace(/^(\t|[ ]{1,4})/gm, "~0"), e = e.replace(/~0/g, ""); +}), s.subParser("paragraphs", function(e, r, t) { + for (var n = (e = (e = (e = t.converter._dispatch("paragraphs.before", e, r, t)).replace(/^\n+/g, "")).replace(/\n+$/g, "")).split(/\n{2,}/g), a = [], o = n.length, i = 0; i < o; i++) { + var l = n[i]; + l.search(/~(K|G)(\d+)\1/g) >= 0 ? a.push(l) : (l = (l = s.subParser("spanGamut")(l, r, t)).replace(/^([ \t]*)/g, "

"), + l += "

", a.push(l)); + } + for (o = a.length, i = 0; i < o; i++) { + for (var c = "", u = a[i], p = !1; u.search(/~(K|G)(\d+)\1/) >= 0; ) { + var h = RegExp.$1, d = RegExp.$2; + c = (c = "K" === h ? t.gHtmlBlocks[d] : p ? s.subParser("encodeCode")(t.ghCodeBlocks[d].text) : t.ghCodeBlocks[d].codeblock).replace(/\$/g, "$$$$"), + u = u.replace(/(\n\n)?~(K|G)\d+\2(\n\n)?/, c), /^]*>\s*]*>/.test(u) && (p = !0); + } + a[i] = u; + } + return e = a.join("\n\n"), e = e.replace(/^\n+/g, ""), e = e.replace(/\n+$/g, ""), + t.converter._dispatch("paragraphs.after", e, r, t); +}), s.subParser("runExtension", function(e, r, t, n) { + if (e.filter) r = e.filter(r, n.converter, t); else if (e.regex) { + var s = e.regex; + !s instanceof RegExp && (s = new RegExp(s, "g")), r = r.replace(s, e.replace); + } + return r; +}), s.subParser("spanGamut", function(e, r, t) { + return e = t.converter._dispatch("spanGamut.before", e, r, t), e = s.subParser("codeSpans")(e, r, t), + e = s.subParser("escapeSpecialCharsWithinTagAttributes")(e, r, t), e = s.subParser("encodeBackslashEscapes")(e, r, t), + e = s.subParser("images")(e, r, t), e = s.subParser("anchors")(e, r, t), e = s.subParser("autoLinks")(e, r, t), + e = s.subParser("encodeAmpsAndAngles")(e, r, t), e = s.subParser("italicsAndBold")(e, r, t), + e = s.subParser("strikethrough")(e, r, t), e = e.replace(/ +\n/g, "
\n"), + e = t.converter._dispatch("spanGamut.after", e, r, t); +}), s.subParser("strikethrough", function(e, r, t) { + return r.strikethrough && (e = (e = t.converter._dispatch("strikethrough.before", e, r, t)).replace(/(?:~T){2}([\s\S]+?)(?:~T){2}/g, "$1"), + e = t.converter._dispatch("strikethrough.after", e, r, t)), e; +}), s.subParser("stripBlankLines", function(e) { + return e.replace(/^[ \t]+$/gm, ""); +}), s.subParser("stripLinkDefinitions", function(e, r, t) { + var n = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=~0))/gm; + return e += "~0", e = e.replace(n, function(e, n, a, o, i, l, c) { + return n = n.toLowerCase(), t.gUrls[n] = s.subParser("encodeAmpsAndAngles")(a), + l ? l + c : (c && (t.gTitles[n] = c.replace(/"|'/g, """)), r.parseImgDimensions && o && i && (t.gDimensions[n] = { + width: o, + height: i + }), ""); + }), e = e.replace(/~0/, ""); +}), s.subParser("tables", function(e, r, t) { + function n(e) { + return /^:[ \t]*--*$/.test(e) ? ' style="text-align:left;"' : /^--*[ \t]*:[ \t]*$/.test(e) ? ' style="text-align:right;"' : /^:[ \t]*--*[ \t]*:$/.test(e) ? ' style="text-align:center;"' : ""; + } + function a(e, n) { + var a = ""; + return e = e.trim(), r.tableHeaderId && (a = ' id="' + e.replace(/ /g, "_").toLowerCase() + '"'), + e = s.subParser("spanGamut")(e, r, t), "" + e + "\n"; + } + function o(e, n) { + return "" + s.subParser("spanGamut")(e, r, t) + "\n"; + } + function i(e, r) { + for (var t = "\n\n\n", n = e.length, s = 0; s < n; ++s) t += e[s]; + for (t += "\n\n\n", s = 0; s < r.length; ++s) { + t += "\n"; + for (var a = 0; a < n; ++a) t += r[s][a]; + t += "\n"; + } + return t += "\n
\n"; + } + if (!r.tables) return e; + var l = /^[ \t]{0,3}\|?.+\|.+\n[ \t]{0,3}\|?[ \t]*:?[ \t]*(?:-|=){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:-|=){2,}[\s\S]+?(?:\n\n|~0)/gm; + return e = t.converter._dispatch("tables.before", e, r, t), e = e.replace(l, function(e) { + var r, t = e.split("\n"); + for (r = 0; r < t.length; ++r) /^[ \t]{0,3}\|/.test(t[r]) && (t[r] = t[r].replace(/^[ \t]{0,3}\|/, "")), + /\|[ \t]*$/.test(t[r]) && (t[r] = t[r].replace(/\|[ \t]*$/, "")); + var l = t[0].split("|").map(function(e) { + return e.trim(); + }), c = t[1].split("|").map(function(e) { + return e.trim(); + }), u = [], p = [], h = [], d = []; + for (t.shift(), t.shift(), r = 0; r < t.length; ++r) "" !== t[r].trim() && u.push(t[r].split("|").map(function(e) { + return e.trim(); + })); + if (l.length < c.length) return e; + for (r = 0; r < c.length; ++r) h.push(n(c[r])); + for (r = 0; r < l.length; ++r) s.helper.isUndefined(h[r]) && (h[r] = ""), p.push(a(l[r], h[r])); + for (r = 0; r < u.length; ++r) { + for (var f = [], g = 0; g < p.length; ++g) s.helper.isUndefined(u[r][g]), f.push(o(u[r][g], h[g])); + d.push(f); + } + return i(p, d); + }), e = t.converter._dispatch("tables.after", e, r, t); +}), s.subParser("unescapeSpecialChars", function(e) { + return e = e.replace(/~E(\d+)E/g, function(e, r) { + var t = parseInt(r); + return String.fromCharCode(t); + }); +}), module.exports = s; \ No newline at end of file diff --git a/utils/wxParse/wxDiscode.js b/utils/wxParse/wxDiscode.js new file mode 100644 index 0000000..50dc774 --- /dev/null +++ b/utils/wxParse/wxDiscode.js @@ -0,0 +1,74 @@ +function e(e) { + return e = e.replace(/∀/g, "∀"), e = e.replace(/∂/g, "∂"), e = e.replace(/&exists;/g, "∃"), + e = e.replace(/∅/g, "∅"), e = e.replace(/∇/g, "∇"), e = e.replace(/∈/g, "∈"), + e = e.replace(/∉/g, "∉"), e = e.replace(/∋/g, "∋"), e = e.replace(/∏/g, "∏"), + e = e.replace(/∑/g, "∑"), e = e.replace(/−/g, "−"), e = e.replace(/∗/g, "∗"), + e = e.replace(/√/g, "√"), e = e.replace(/∝/g, "∝"), e = e.replace(/∞/g, "∞"), + e = e.replace(/∠/g, "∠"), e = e.replace(/∧/g, "∧"), e = e.replace(/∨/g, "∨"), + e = e.replace(/∩/g, "∩"), e = e.replace(/∩/g, "∪"), e = e.replace(/∫/g, "∫"), + e = e.replace(/∴/g, "∴"), e = e.replace(/∼/g, "∼"), e = e.replace(/≅/g, "≅"), + e = e.replace(/≈/g, "≈"), e = e.replace(/≠/g, "≠"), e = e.replace(/≤/g, "≤"), + e = e.replace(/≥/g, "≥"), e = e.replace(/⊂/g, "⊂"), e = e.replace(/⊃/g, "⊃"), + e = e.replace(/⊄/g, "⊄"), e = e.replace(/⊆/g, "⊆"), e = e.replace(/⊇/g, "⊇"), + e = e.replace(/⊕/g, "⊕"), e = e.replace(/⊗/g, "⊗"), e = e.replace(/⊥/g, "⊥"), + e = e.replace(/⋅/g, "⋅"); +} + +function a(e) { + return e = e.replace(/Α/g, "Α"), e = e.replace(/Β/g, "Β"), e = e.replace(/Γ/g, "Γ"), + e = e.replace(/Δ/g, "Δ"), e = e.replace(/Ε/g, "Ε"), e = e.replace(/Ζ/g, "Ζ"), + e = e.replace(/Η/g, "Η"), e = e.replace(/Θ/g, "Θ"), e = e.replace(/Ι/g, "Ι"), + e = e.replace(/Κ/g, "Κ"), e = e.replace(/Λ/g, "Λ"), e = e.replace(/Μ/g, "Μ"), + e = e.replace(/Ν/g, "Ν"), e = e.replace(/Ξ/g, "Ν"), e = e.replace(/Ο/g, "Ο"), + e = e.replace(/Π/g, "Π"), e = e.replace(/Ρ/g, "Ρ"), e = e.replace(/Σ/g, "Σ"), + e = e.replace(/Τ/g, "Τ"), e = e.replace(/Υ/g, "Υ"), e = e.replace(/Φ/g, "Φ"), + e = e.replace(/Χ/g, "Χ"), e = e.replace(/Ψ/g, "Ψ"), e = e.replace(/Ω/g, "Ω"), + e = e.replace(/α/g, "α"), e = e.replace(/β/g, "β"), e = e.replace(/γ/g, "γ"), + e = e.replace(/δ/g, "δ"), e = e.replace(/ε/g, "ε"), e = e.replace(/ζ/g, "ζ"), + e = e.replace(/η/g, "η"), e = e.replace(/θ/g, "θ"), e = e.replace(/ι/g, "ι"), + e = e.replace(/κ/g, "κ"), e = e.replace(/λ/g, "λ"), e = e.replace(/μ/g, "μ"), + e = e.replace(/ν/g, "ν"), e = e.replace(/ξ/g, "ξ"), e = e.replace(/ο/g, "ο"), + e = e.replace(/π/g, "π"), e = e.replace(/ρ/g, "ρ"), e = e.replace(/ς/g, "ς"), + e = e.replace(/σ/g, "σ"), e = e.replace(/τ/g, "τ"), e = e.replace(/υ/g, "υ"), + e = e.replace(/φ/g, "φ"), e = e.replace(/χ/g, "χ"), e = e.replace(/ψ/g, "ψ"), + e = e.replace(/ω/g, "ω"), e = e.replace(/ϑ/g, "ϑ"), e = e.replace(/ϒ/g, "ϒ"), + e = e.replace(/ϖ/g, "ϖ"), e = e.replace(/·/g, "·"); +} + +function r(e) { + return e = e.replace(/ /g, " "), e = e.replace(/"/g, "'"), e = e.replace(/&/g, "&"), + e = e.replace(/</g, "<"), e = e.replace(/>/g, ">"), e = e.replace(/•/g, "•"); +} + +function l(e) { + return e = e.replace(/Œ/g, "Œ"), e = e.replace(/œ/g, "œ"), e = e.replace(/Š/g, "Š"), + e = e.replace(/š/g, "š"), e = e.replace(/Ÿ/g, "Ÿ"), e = e.replace(/ƒ/g, "ƒ"), + e = e.replace(/ˆ/g, "ˆ"), e = e.replace(/˜/g, "˜"), e = e.replace(/ /g, ""), + e = e.replace(/ /g, ""), e = e.replace(/ /g, ""), e = e.replace(/‌/g, ""), + e = e.replace(/‍/g, ""), e = e.replace(/‎/g, ""), e = e.replace(/‏/g, ""), + e = e.replace(/–/g, "–"), e = e.replace(/—/g, "—"), e = e.replace(/‘/g, "‘"), + e = e.replace(/’/g, "’"), e = e.replace(/‚/g, "‚"), e = e.replace(/“/g, "“"), + e = e.replace(/”/g, "”"), e = e.replace(/„/g, "„"), e = e.replace(/†/g, "†"), + e = e.replace(/‡/g, "‡"), e = e.replace(/•/g, "•"), e = e.replace(/…/g, "…"), + e = e.replace(/‰/g, "‰"), e = e.replace(/′/g, "′"), e = e.replace(/″/g, "″"), + e = e.replace(/‹/g, "‹"), e = e.replace(/›/g, "›"), e = e.replace(/‾/g, "‾"), + e = e.replace(/€/g, "€"), e = e.replace(/™/g, "™"), e = e.replace(/←/g, "←"), + e = e.replace(/↑/g, "↑"), e = e.replace(/→/g, "→"), e = e.replace(/↓/g, "↓"), + e = e.replace(/↔/g, "↔"), e = e.replace(/↵/g, "↵"), e = e.replace(/⌈/g, "⌈"), + e = e.replace(/⌉/g, "⌉"), e = e.replace(/⌊/g, "⌊"), e = e.replace(/⌋/g, "⌋"), + e = e.replace(/◊/g, "◊"), e = e.replace(/♠/g, "♠"), e = e.replace(/♣/g, "♣"), + e = e.replace(/♥/g, "♥"), e = e.replace(/♦/g, "♦"), e = e.replace(/'/g, "'"); +} + +function p(e) { + return e = e.replace(/\r\n/g, ""), e = e.replace(/\n/g, ""), e = e.replace(/code/g, "wxxxcode-style"); +} + +module.exports = { + strDiscode: function(c) { + return c = e(c), c = a(c), c = r(c), c = l(c), c = p(c); + }, + urlToHttpUrl: function(e, a) { + return new RegExp("^//").test(e) && (e = a + ":" + e), e; + } +}; \ No newline at end of file diff --git a/utils/wxParse/wxParse.js b/utils/wxParse/wxParse.js new file mode 100644 index 0000000..d35ffaf --- /dev/null +++ b/utils/wxParse/wxParse.js @@ -0,0 +1,83 @@ +function e(e) { + return e && e.__esModule ? e : { + default: e + }; +} + +function t(e, t, a) { + return t in e ? Object.defineProperty(e, t, { + value: a, + enumerable: !0, + configurable: !0, + writable: !0 + }) : e[t] = a, e; +} + +function a(e) { + var t = this, a = e.target.dataset.src, i = e.target.dataset.from; + void 0 !== i && i.length > 0 && wx.previewImage({ + current: a, + urls: t.data[i].imageUrls + }); +} + +function i(e) { + var t = this, a = e.target.dataset.from, i = e.target.dataset.idx; + void 0 !== a && a.length > 0 && r(e, i, t, a); +} + +function r(e, a, i, r) { + var o, d = i.data[r]; + if (d && 0 != d.images.length) { + var s = d.images, l = n(e.detail.width, e.detail.height, i, r), g = s[a].index, h = "" + r, m = !0, u = !1, v = void 0; + try { + for (var f, w = g.split(".")[Symbol.iterator](); !(m = (f = w.next()).done); m = !0) h += ".nodes[" + f.value + "]"; + } catch (e) { + u = !0, v = e; + } finally { + try { + !m && w.return && w.return(); + } finally { + if (u) throw v; + } + } + var c = h + ".width", x = h + ".height"; + i.setData((o = {}, t(o, c, l.imageWidth), t(o, x, l.imageheight), o)); + } +} + +function n(e, t, a, i) { + var r = 0, n = 0, o = 0, d = {}, g = a.data[i].view.imagePadding; + return r = s - 2 * g, l, e > r ? (o = (n = r) * t / e, d.imageWidth = n, d.imageheight = o) : (d.imageWidth = e, + d.imageheight = t), d; +} + +var o = e(require("./showdown.js")), d = e(require("./html2json.js")), s = 0, l = 0; + +wx.getSystemInfo({ + success: function(e) { + s = e.windowWidth, l = e.windowHeight; + } +}), module.exports = { + wxParse: function() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "wxParseData", t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "html", r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : '
数据不能为空
', n = arguments[3], s = arguments[4], l = n, g = {}; + if ("html" == t) g = d.default.html2json(r, e), console.log(JSON.stringify(g, " ", " ")); else if ("md" == t || "markdown" == t) { + var h = new o.default.Converter().makeHtml(r); + g = d.default.html2json(h, e), console.log(JSON.stringify(g, " ", " ")); + } + g.view = {}, g.view.imagePadding = 0, void 0 !== s && (g.view.imagePadding = s); + var m = {}; + m[e] = g, l.setData(m), l.wxParseImgLoad = i, l.wxParseImgTap = a; + }, + wxParseTemArray: function(e, t, a, i) { + for (var r = [], n = i.data, o = null, d = 0; d < a; d++) { + var s = n[t + d].nodes; + r.push(s); + } + e = e || "wxParseTemArray", (o = JSON.parse('{"' + e + '":""}'))[e] = r, i.setData(o); + }, + emojisInit: function() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "", t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "/wxParse/emojis/", a = arguments[2]; + d.default.emojisInit(e, t, a); + } +}; \ No newline at end of file diff --git a/utils/wxParse/wxParse.wxml b/utils/wxParse/wxParse.wxml new file mode 100644 index 0000000..6a73bec --- /dev/null +++ b/utils/wxParse/wxParse.wxml @@ -0,0 +1,386 @@ + + + + + + + + + + + + + + + + + diff --git a/utils/wxParse/wxParse.wxss b/utils/wxParse/wxParse.wxss new file mode 100644 index 0000000..11f43ac --- /dev/null +++ b/utils/wxParse/wxParse.wxss @@ -0,0 +1,256 @@ +.wxParse { + margin: 0 5px; + font-family: Helvetica,sans-serif; + font-size: 28rpx; + color: #666; + line-height: 1.8; +} + +view.wxParse { + word-break: break-all; + overflow: auto; + margin-top: 20rpx; +} + +view.wxParse view{ + word-break: break-all; + overflow: auto; +} + +.wxParse-inline { + display: inline; + margin: 0; + padding: 0; +} + +.wxParse-div { + margin: 0; + padding: 0; +} + +.wxParse-h1 { + font-size: 2em; + margin: .67em 0; +} + +.wxParse-h2 { + font-size: 1.5em; + margin: .75em 0; +} + +.wxParse-h3 { + font-size: 1.17em; + margin: .83em 0; +} + +.wxParse-h4 { + margin: 1.12em 0; +} + +.wxParse-h5 { + font-size: .83em; + margin: 1.5em 0; +} + +.wxParse-h6 { + font-size: .75em; + margin: 1.67em 0; +} + +.wxParse-h1 { + font-size: 18px; + font-weight: 400; + margin-bottom: .9em; +} + +.wxParse-h2 { + font-size: 16px; + font-weight: 400; + margin-bottom: .34em; +} + +.wxParse-h3 { + font-weight: 400; + font-size: 15px; + margin-bottom: .34em; +} + +.wxParse-h4 { + font-weight: 400; + font-size: 14px; + margin-bottom: .24em; +} + +.wxParse-h5 { + font-weight: 400; + font-size: 13px; + margin-bottom: .14em; +} + +.wxParse-h6 { + font-weight: 400; + font-size: 12px; + margin-bottom: .04em; +} + +.wxParse-h1,.wxParse-h2,.wxParse-h3,.wxParse-h4,.wxParse-h5,.wxParse-h6,.wxParse-b,.wxParse-strong { + font-weight: bolder; +} + +.wxParse-i,.wxParse-cite,.wxParse-em,.wxParse-var,.wxParse-address { + font-style: italic; +} + +.wxParse-pre,.wxParse-tt,.wxParse-code,.wxParse-kbd,.wxParse-samp { + font-family: monospace; +} + +.wxParse-pre { + white-space: pre; +} + +.wxParse-big { + font-size: 1.17em; +} + +.wxParse-small,.wxParse-sub,.wxParse-sup { + font-size: .83em; +} + +.wxParse-sub { + vertical-align: sub; +} + +.wxParse-sup { + vertical-align: super; +} + +.wxParse-s,.wxParse-strike,.wxParse-del { + text-decoration: line-through; +} + +.wxParse-strong,.wxParse-s { + display: inline; +} + +.wxParse-a { + color: deepskyblue; + word-break: break-all; + overflow: auto; +} + +.wxParse-video { + text-align: center; + margin: 10px 0; +} + +.wxParse-video-video { + width: 100%; +} + +.wxParse-img { + overflow: hidden; +} + +.wxParse-blockquote { + margin: 0; + padding: 10px 0 10px 5px; + font-family: Courier,Calibri,"宋体"; + background: #f5f5f5; + border-left: 3px solid #dbdbdb; +} + +.wxParse-code,.wxParse-wxxxcode-style { + display: inline; + background: #f5f5f5; +} + +.wxParse-ul { + margin: 20rpx 10rpx; +} + +.wxParse-li,.wxParse-li-inner { + display: flex; + align-items: baseline; + margin: 10rpx 0; +} + +.wxParse-li-text { + align-items: center; + line-height: 20px; +} + +.wxParse-li-circle { + display: inline-flex; + width: 5px; + height: 5px; + background-color: #333; + margin-right: 5px; +} + +.wxParse-li-square { + display: inline-flex; + width: 10rpx; + height: 10rpx; + background-color: #333; + margin-right: 5px; +} + +.wxParse-li-ring { + display: inline-flex; + width: 10rpx; + height: 10rpx; + border: 2rpx solid #333; + border-radius: 50%; + background-color: #fff; + margin-right: 5px; +} + +.wxParse-u { + text-decoration: underline; +} + +.wxParse-hide { + display: none; +} + +.WxEmojiView { + align-items: center; +} + +.wxEmoji { + width: 16px; + height: 16px; +} + +.wxParse-tr { + display: flex; + border-right: 1px solid #e0e0e0; + border-bottom: 1px solid #e0e0e0; + border-top: 1px solid #e0e0e0; +} + +.wxParse-th,.wxParse-td { + flex: 1; + padding: 5px; + font-size: 28rpx; + border-left: 1px solid #e0e0e0; + word-break: break-all; +} + +.wxParse-td:last { + border-top: 1px solid #e0e0e0; +} + +.wxParse-th { + background: #f0f0f0; + border-top: 1px solid #e0e0e0; +} + +.wxParse-del { + display: inline; +} + +.wxParse-figure { + overflow: hidden; +} \ No newline at end of file