diff --git a/packageG/pages/user_template/index.js b/packageG/pages/user_template/index.js new file mode 100644 index 0000000..c96df0b --- /dev/null +++ b/packageG/pages/user_template/index.js @@ -0,0 +1,199 @@ + +var t = getApp(), + a = t.request, + os = t.globalData.setting, + ut = require("../../utils/util.js"), + com = require("../../utils/common.js"); + var regeneratorRuntime = require('../../utils/runtime.js'); + var api = require('../../api/api.js'); + var appd = getApp().globalData; + +Page({ + data: { + url: os.imghost, + temp_id:0, + goodsGroupArr:[] + }, + + onLoad: function(e) { + var th = this; + this.data.temp_id=e.scene; + if(!this.data.temp_id) + this.data.temp_id=e.sence; + if(!this.data.temp_id) wx.showModal({ title:"未读取到模板ID" ,}) + + var first_leader = e.first_leader; + if (first_leader) { + //-- user_id代过来免登录 -- + getApp().globalData.first_leader = first_leader; + //调用接口判断是不是会员 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { + if (res.data.code == 0) { + getApp().globalData.guide_id = res.data.data.id; + getApp().globalData.guide_pick_id= res.data.data.pickup_id + } + }) + } + + + + }, + + async onShow() { + getApp().check_can_share(); + var th = this; + await this.init_load(); + //如果是自定义模板 + if (this.data.isTemplate) { + + } + }, + //获取商品模块实例 + newGoodsGroup(){ + let arr=[] + if (this.data.template_arr.length == 0) { + return + } + this.data.template_arr.map((item,index)=>{ + if (item.ename == 'goodsGroup') { + arr.push(`goodsGroup${index}`) + } + }) + if (arr.length > 0) { + this.setData({ + goodsGroupArr : arr + }) + arr.map(item=>{ + let a = '.'+item + this[item] = this.selectComponent(a); + }) + } + }, + //当隐藏的时候就关闭计时器 + onHide: function() { + + }, + //同步初始加载 + async init_load() { + var th = this; + //因为营销版本的功能包含了自定义模板的功能,是同时的 + //读取全局是否有弄自定义模板 + await getApp().request.promiseGet("/api/weshop/store_module/get/"+th.data.temp_id+"/8",{1:1} ).then(res => { + var data = res.data.data; + if (data) { + var temp_data = data; + wx.setNavigationBarTitle({ + title: temp_data.page_title, + }); + var t_arr = JSON.parse(temp_data.json_str); + th.setData({ + share_title:temp_data.page_title, + template_arr: t_arr, + isTemplate: 1, + bgcolor_t: temp_data.bkcolor + }); + setTimeout(()=>{ + th.newGoodsGroup() + },1000) + + //---如果有设定顶部的颜色的时候-- + if(temp_data.top_color && temp_data.top_color!='null' ){ + + var top_w_color="#ffffff"; + if(temp_data.top_word_color && temp_data.top_word_color=='black'){ + top_w_color="#000000"; + } + + wx.setNavigationBarColor({ + frontColor: top_w_color, // 必写项 + backgroundColor: temp_data.top_color, // 必写项 + }) + } + + } + }) + + + + }, + + onPullDownRefresh: function(e) { + + }, + + + onShareAppMessage:async function(e) { + var th=this; + getApp().globalData.no_clear=1; + getApp().getConfig(await function(e){ + th.setData({ + store_config:e + }) + }.bind(this)) + + var url= `pages/template/index?sence=`+this.data.temp_id; + var userInfo = getApp().globalData.userInfo; + //是分销商才带 + if (userInfo) { + url += "&first_leader=" + userInfo.user_id; + } + + var ob = { + title: this.data.share_title, + path: url, + //imageUrl:this.data.url+this.data.store_config.store_logo, + }; + return ob; + }, + + /** + * 用户分享朋友圈 + */ + async onShareTimeline(){ + + var th=this; + getApp().globalData.no_clear=1; + getApp().getConfig(await function(e){ + th.setData({ + store_config:e + }) + }.bind(this)) + var {share_title,temp_id,store_config} = this.data; + var url= `sence=${temp_id}`; + + var userInfo = getApp().globalData.userInfo; + //是分销商才带 + if (userInfo) { + url += "&first_leader=" + userInfo.user_id; + } + + var ob = { + title:share_title, + query:url, + //imageUrl:this.data.url+store_config.store_logo, + }; + console.log(ob); + return ob; +}, + //---加载更多是靠这个函数---- + onReachBottom: function() { + if(getApp().globalData.func_list) + { + for(let i in getApp().globalData.func_list){ + let item=getApp().globalData.func_list[i]; + item.re_show(); + } + } + + //自定义时商品自动加载更多 + let goodsGroupArr = this.data.goodsGroupArr + if (this.data.isTemplate && goodsGroupArr.length >0) { + goodsGroupArr.map(item=>{ + this[item].automore() + }) + } + }, + + + +}); \ No newline at end of file diff --git a/packageG/pages/user_template/index.json b/packageG/pages/user_template/index.json new file mode 100644 index 0000000..aef6091 --- /dev/null +++ b/packageG/pages/user_template/index.json @@ -0,0 +1,14 @@ +{ + "navigationBarBackgroundColor": "#ff7295", + "navigationBarTextStyle": "white", + "usingComponents": { + "advertising":"/components/diy_advertising/diy_advertising", + "assist":"/components/diy_assist/diy_assist", + "diy_user_info":"/components/diy_user_info/diy_user_info", + "diy_user_order":"/components/diy_user_order/diy_user_order", + "diy_user_my_rights":"/components/diy_user_my_rights/diy_user_my_rights", + "diy_user_tools_services":"/components/diy_user_my_rights/diy_user_tools_services" + }, + "enablePullDownRefresh": false, + "onReachBottomDistance":300 +} \ No newline at end of file diff --git a/packageG/pages/user_template/index.wxml b/packageG/pages/user_template/index.wxml new file mode 100644 index 0000000..16cfded --- /dev/null +++ b/packageG/pages/user_template/index.wxml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packageG/pages/user_template/index.wxss b/packageG/pages/user_template/index.wxss new file mode 100644 index 0000000..96bcff4 --- /dev/null +++ b/packageG/pages/user_template/index.wxss @@ -0,0 +1,912 @@ +.pink-b { + background: #ff7295; +} + +.search-box { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 88rpx; + z-index: 10; +} + +.classify-img { + width: 50rpx; + height: 45rpx; +} + +.logo { + width: 48rpx; + height: 48rpx; + margin: 0 18rpx; + border-radius: 50%; + overflow: hidden; +} + +.search-inner { + display: flex; + align-items: center; + margin: 20rpx 25rpx; + width: 566rpx; + height: 58rpx; + border-radius: 29rpx; + background-color: #fff; + justify-content: center; +} + +.search-img { + width: 30rpx; + height: 30rpx; + margin-left: 36rpx; + display: flex; + align-items: center; + position: absolute; + left: 10%; +} + +.search-cont { + height: 58rpx; + width: 530rpx; + padding-left: 12rpx; + line-height: 58rpx; + font-size: 24rpx; + color: #666; + margin-left: 56rpx; +} + +.search-fixed { + background: #ff7295; +} + +.swiper_box { + width: 100%; + height: auto; +} + +.s_prom { + width: 100%; + height: 340rpx; +} + +.s_proms { + width: 100%; + height: 590rpx; +} + +.slide-image { + width: 100%; + display: inline-block; + overflow: hidden; + border-radius: 14rpx; + height: auto; +} + +.venues_box { + background-color: #fff; + padding: 20rpx 10rpx; +} + +.venues_item { + display: block; + float: left; + width: 20%; + text-align: center; + margin: 25rpx 0; +} + +.venues_item image { + vertical-align: middle; + width: 90rpx; + height: 90rpx; + border: 0; +} + +.venues_item view { + font-size: 26rpx; + margin-top: 10rpx; +} + +.choice_box { + font-size: 14px; +} + +.choice_box .choice_list .choice_item { + width: 368rpx; + float: left; + margin: 2rpx; + background-color: #fff; +} + +.choice_box .choice_list image { + width: 100%; + height: auto; +} + +.title-img { + margin-top: 110rpx; + margin-bottom: 15rpx; + height: auto; +} + +.choice_box .choice_list .title { + height: 36rpx; + line-height: 36rpx; + /* font-weight: bold; */ + text-align: left; + color: #333; + margin-left: 20rpx; + font-size: 30rpx; +} + +.choice_box .choice_list .choice_footer { + display: block; + margin-top: 20rpx; + margin-left: 15rpx; + position: relative; + height: 74rpx; + line-height: 17rpx; +} + +.choice_box .choice_list .choice_footer .price { + color: #f23030; + height: 10px; +} + +.choice_box .choice_list .choice_footer .similer { + position: absolute; + bottom: 0; + right: 0; + text-align: center; + color: #686868; + width: fit-content; + line-height: 30rpx; + border: 1rpx solid #bfbfbf; + padding: 1rpx 6rpx; + border-radius: 5rpx; +} + +.section { + margin-top: 20rpx; + background-color: #fff; +} + +.section-title { + padding-top: 30rpx; + height: 54rpx; + line-height: 54rpx; + font-size: 36rpx; + font-weight: 700; + color: #333; + text-align: center; + letter-spacing: 3rpx; +} + +.section-subtitle { + line-height: 0; + width: 340rpx; + height: 16rpx; + padding-bottom: 20rpx; + margin: 0 auto; +} + +.seckill { + margin-top: 20rpx; + background-color: #fff; + padding-bottom: 30rpx; +} + +.seckill-time { + display: flex; + justify-content: space-between; + padding: 0 30rpx; + align-items: center; + height: 72rpx; + color: #333; + margin-bottom: 20rpx; +} + +.sk-tips { + font-size: 36rpx; + font-weight: bold; + margin-right: 20rpx; +} + +.sk-time { + position: relative; + display: inline-block; + font-size: 24rpx; + width: 36rpx; + line-height: 36rpx; + background-color: #333; + margin-right: 20rpx; + color: #fff; + text-align: center; +} + +.sk-time::before { + content: ':'; + position: absolute; + right: -13rpx; + top: 0; + color: #333; + font-weight: bold; +} + +.sk-time:last-child::before { + content: ''; +} + +.seckill-time>navigator { + font-size: 28rpx; +} + +.sk-pic { + width: 28rpx; + height: 28rpx; + vertical-align: top; +} + +.seckill-list { + overflow: hidden; +} + +/* .seckill-list navigator { + width: 236rpx; margin-right: 10rpx; position: relative; +} */ + +.seckill-list view { + height: 62rpx; + padding: 0 10rpx; + line-height: 33rpx; + overflow: hidden; + font-size: 28rpx; + width: 203rpx; +} + +.seckill-list view.imgview { + width: 203rpx; + height: 210rpx; + position: relative; + overflow: hidden; +} + +.imgview image { + width: 203rpx; + height: 203rpx; + border-radius: 10rpx; +} + +.seckill-list view.djs_view { + background: rgba(9, 9, 9, 0.5); + color: #fff; + font-size: 20rpx; + width: 216rpx; + height: 36rpx; + line-height: 36rpx; + position: absolute; + bottom: 0; + left: 10rpx; + z-index: 5; + text-align-last: center; +} + +.seckill-list image.status_img { + width: 100rpx; + height: 35rpx; + position: absolute; + top: 0rpx; + left: 10rpx; + z-index: 5; +} + +.seckill-list view.status_view { + width: 60rpx; + height: 60rpx; + text-align: center; + line-height: 60rpx; + position: absolute; + background: #e9030d; + color: #fff; + font-size: 18rpx; + top: 5rpx; + right: 10rpx; + z-index: 5; + border-radius: 50%; + padding: 0; +} + +.xiafa { + text-decoration: line-through; + font-size: 10px; + color: #999; + margin-left: 10rpx; +} + +.shelue { + /* text-overflow: -o-ellipsis-lastline; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; */ + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} + +.meiz { + padding: 0 10rpx; + background: #c4182e; + color: #fff; + height: 18px; + line-height: 18px; + margin-top: -10rpx; + border-radius: 10rpx; +} + +.dengj { + padding: 0 10rpx; + background: #ffd700; + color: #fff; + height: 18px; + line-height: 18px; + margin-top: -10rpx; + border-radius: 10rpx; +} + +.kongge { + width: 20rpx; +} + +.choice_footer .ys { + color: #999; + margin-top: 20rpx; + font-size: 11px; + margin-left: 5rpx; +} + +.p_swiper { + display: flex; +} + +.p_swiper .un_line { + text-decoration: line-through; + font-size: 22rpx; + color: #b2a2c2; +} + +.seckill-list view.co-red2 { + font-size: 22rpx; + color: #c2aebb; + margin-top: -8rpx; +} + +.seckill-list view.cantuan { + width: 72rpx; + height: 36rpx; + text-align: center; + line-height: 36rpx; + position: absolute; + background: #e9030d; + color: #fff; + font-size: 18rpx; + bottom: 30rpx; + right: 10rpx; + z-index: 5; + border-radius: 5rpx; + padding: 0; +} + +.arrow-right { + width: 24rpx; + height: 24rpx; +} + +.pd-view { + height: 80rpx; +} + +.xc-grow-ups { + margin-left: 8rpx; + margin-top: 6rpx; +} + +.xc-top-img { + width: 100%; + top: -1rpx; + height: 315rpx; +} + +.classify-frame { + line-height: 25rpx; +} + +.slide-image-frame { + width: 95%; + margin: auto; + border-radius: 10rpx; +} + +.xc-hook { + width: 52rpx; + height: 52rpx; +} + +.margin-left { + margin-left: 10rpx; +} + +.xc-class-img { + width: 83rpx; + height: 83rpx; +} + +.xc-class-frame { + line-height: 40rpx; + margin-top: 40rpx; + margin-bottom: 20rpx; +} + +.xc-title-img { + height: 220rpx; + width: 100%; + border-radius: 15rpx; +} + +.title-img-frame { + width: 94%; + margin: auto; + margin-top: 30rpx; + padding-bottom: 10rpx; +} + +.seckill-list { + line-height: 24rpx; +} + +.seckill-lists { + line-height: 30rpx; +} + +.xc-marfin-right { + margin-right: 8rpx; +} + +.classname .clock-img { + width: 36rpx; + height: 36rpx; + margin-right: 10rpx; +} + +.classname .seckill-ttitle-img { + width: 150rpx; + height: 40rpx; +} + +.seckill-ttitle-img.height { + height: 35rpx; +} + +.split-line { + width: 100%; + height: 10rpx; + background: #eee; +} + +.mar-top10 { + margin-top: 10rpx; +} + +.classname .user-img { + width: 30rpx; + height: 30rpx; + margin-left: 20rpx; + margin-right: 10rpx; +} + +.user-frame { + /* border-left: 5rpx solid #eee; */ + height: 35rpx; + line-height: 35rpx; + margin-left: 10rpx; +} + +.user-name { + width: 66rpx; + border-left: 5rpx solid #eee; +} + +/* 团购列表 */ + +.kill-item { + display: flex; + justify-content: space-between; + background-color: #fff; + padding: 10rpx 10rpx; + margin-bottom: 10rpx; + border-radius: 10rpx; + height: 249rpx; + align-items: center; +} + +.kill-pic { + width: 215rpx; + height: 215rpx; + position: relative; +} + +.teamheight { + height: 289rpx; + border-bottom: 6rpx solid #eee; +} + +.kill-cont { + width: 440rpx; + height: 215rpx; + margin-left: 16rpx; +} + +.goods-name { + max-height: 60rpx; + font-size: 24rpx; + color: #555; + line-height: 55rpx; +} + +.xc-team-img { + width: 38rpx; + height: 45rpx; + left: -1rpx; + top: -16rpx; +} + +.tneirong { + color: #fff; + font-size: 20rpx; + border-radius: 20rpx; + padding-left: 32rpx; + padding-right: 15rpx; + padding-bottom: 2rpx; + height: 28rpx; + line-height: 28rpx; + white-space: nowrap; +} + +.xc-people-val-frame { + border: 3rpx solid #d60021; + border-radius: 8rpx; + white-space: nowrap; + height: 28rpx; +} + +.xc-people-val-frame .val-img { + width: 33rpx; + height: 28rpx; + border-radius: 8rpx; + margin-left: -2rpx; +} + +.people-img { + width: 20rpx; + height: 20rpx; +} + +.goods-num { + height: 50rpx; + display: flex; + justify-content: space-between; + margin-top: 10rpx; + font-size: 24rpx; + color: #999; +} + +.xc-top15 { + padding-top: 15rpx; + margin-top: 25rpx; +} + +.underline { + text-decoration: line-through; + color: #999; + font-size: 20rpx; + margin-left: 5rpx; + margin-top: 5rpx; +} + +.navigator.navwidth { + width: 100%;; +} + +.view.left { + padding: 0 5rpx; +} + +/* 热门好物 */ + +.title .China { + width: 100%; + margin-top: 10rpx; + margin-bottom: 10rpx; + line-height: 0rpx; +} + +.title .China .line view { + width: 2rpx; +} + +.title .China .line { + height: 40rpx; + color: rgb(51, 51, 51); +} + +.title .China .line view { + border-left: 3rpx solid #000; + margin-left: 5rpx; +} + +.title .China .line .one { + height: 23rpx; +} + +.title .China .line .two { + height: 15rpx; +} + +.title .China .line .three { + height: 18rpx; +} + +.title .China .Recommend { + margin: 0rpx 20rpx; + font-size: 28rpx; + line-height: 39rpx; + font-weight: bold; +} + +.title .english .silk { + width: 214rpx; + height: 2rpx; + background-color: #000; +} + +.title .english .esh { + margin: 0rpx 15rpx; +} + +.collects { + margin-top: 40rpx; +} + +.hang { + width: 100%; + margin: auto; + padding-left: 21rpx; +} + +.hang .collect { + width: 347rpx; + height: 571rpx; + border-radius: 25rpx; + border: 1rpx solid rgb(214, 214, 214); + overflow: hidden; + margin-right: 14rpx; + margin-bottom: 5rpx; +} + +.collect .bottom { + padding: 0rpx 20rpx; +} + +.collect .sp { + width: 100%; + height: 326rpx; +} + +.collect .money { + margin-top: 60rpx; + margin-bottom: 18rpx; + line-height: 28rpx; + align-items: baseline; +} + +.collect .money view { + line-height: 28rpx; +} + +.collect .money .flex { + font-weight: bold; +} + +.collect .money .flex .fs24 { + padding-top: 5rpx; +} + +.collect .Discount { + width: 156rpx; + height: 28rpx; + border-radius: 20rpx; + background-color: rgb(56, 56, 56); + font-size: 18rpx; + color: rgb(255, 255, 255); +} + +.collect .Discount image { + height: 18rpx; + width: 18rpx; + line-height: 28rpx; + margin-right: 3rpx; +} + +.collect.ml20 { + margin-left: 13rpx; +} + +.fs24.dollar { + padding: 0rpx; +} + +.money .price { + margin-left: 12rpx; + text-decoration: line-through; + line-height: 23rpx; +} + +.province { + line-height: 26rpx; +} + +.nothing { + height: 75rpx; + width: 100%; +} + +.nothing .no_content { + margin: 0rpx 11rpx; + color: rgb(138, 138, 138); +} + +.nothing .Foil { + width: 80rpx; + height: 2rpx; + background-color: rgb(138, 138, 138); +} + +.goods_name { + height: 70rpx; + margin-top: 6rpx; +} + +.seckill-list view.translation { + width: 108rpx; + height: 20rpx; + border-radius: 20rpx; + background: #dfdfdf; + margin: auto; + line-height: 20rpx; +} + +.seckill-list view.spot { + width: 10rpx; + height: 10rpx; + padding: 0rpx; +} + +.spot { + width: 10rpx; + height: 10rpx; + padding: 0rpx; +} + +.translation { + width: 108rpx; + height: 20rpx; + border-radius: 20rpx; + background: #e0e0e0; + line-height: 20rpx; + bottom: 45rpx; + left: 43%; +} + +.translation { + width: 108rpx; + height: 20rpx; + border-radius: 20rpx; + background: #b8d1d6; + line-height: 20rpx; + bottom: 12rpx; + left: 43%; +} + +.translations { + width: 108rpx; + height: 20rpx; + border-radius: 20rpx; + background: #dfdfdf; + line-height: 20rpx; + bottom: 25rpx; + left: 43%; +} + +.mar-top { + margin-top: 20rpx; +} + +.mar-tops { + margin-top: 10rpx; +} + +.pt_active { + animation: sport 0.5s; +} + +@keyframes sport { + 0% { + transform: translateY(80rpx); + opacity: 0; + } + + 100% { + transform: translateY(0rpx); + opacity: 1; + } +} + +.m-left { + margin-left: 18rpx; +} + +.martop4 { + margin-top: 4rpx; +} + +.time-blue { + margin-left: 10rpx; +} + +.is_seckill_height { + height: 40rpx; + line-height: 32rpx; +} + +.assemble-top-border { + border-top: 10rpx solid #eee; + padding-top: 20rpx; + margin-top: 0rpx; +} + +.gonju { + max-width: 120rpx; +} + +.disgraceful { + position: fixed; + width: 100%; + height: 100%; + left: 0rpx; + bottom: 0rpx; + background-color: rgba(182, 174, 174, 0.753); + z-index: 10; +} + +.newreceive { + position: fixed; + width: 100%; + height: 100%; + z-index: 11; +} + +.receive { + width: 570rpx; + height: 750rpx; +} +.close{ + width: 70rpx; + height: 70rpx; + margin-top: 30rpx; +} +.swiper{ + height: 250rpx; + padding-bottom:30rpx; +} +.container{ overflow: hidden;} \ No newline at end of file