From 43fb56aa017812000676787d3433baab4eeff180 Mon Sep 17 00:00:00 2001 From: yvan.ni <765199919@qq.com> Date: Mon, 16 Mar 2020 15:07:02 +0800 Subject: [PATCH] 自定义模版的预览 --- pages/template/index.js | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/template/index.json | 22 ++++++++++++++++++++++ pages/template/index.wxml | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/template/index.wxss | 911 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1092 insertions(+), 0 deletions(-) create mode 100644 pages/template/index.js create mode 100644 pages/template/index.json create mode 100644 pages/template/index.wxml create mode 100644 pages/template/index.wxss diff --git a/pages/template/index.js b/pages/template/index.js new file mode 100644 index 0000000..e95639b --- /dev/null +++ b/pages/template/index.js @@ -0,0 +1,83 @@ + +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, + }, + + onLoad: function(e) { + var th = this; + this.data.temp_id=e.sence; + if(!this.data.temp_id) this.data.temp_id=743; + }, + + async onShow() { + var th = this; + await this.init_load(); + //如果是自定义模板 + if (this.data.isTemplate) { + + } + }, + + //当隐藏的时候就关闭计时器 + onHide: function() { + + }, + + //同步初始加载 + async init_load() { + var th = this; + //因为营销版本的功能包含了自定义模板的功能,是同时的 + //读取全局是否有弄自定义模板 + await getApp().request.promiseGet("/api/weshop/store_module/get/"+th.data.temp_id+"/4",{1:1} ).then(res => { + var data = res.data.data; + if (data) { + var temp_data = data; + var t_arr = JSON.parse(temp_data.json_str); + th.setData({ + template_arr: t_arr, + isTemplate: 1, + bgcolor_t: temp_data.bkcolor + }); + } + }) + + wx.setNavigationBarTitle({ + title: '模板预览', + }); + + }, + + + onPullDownRefresh: function(e) { + + }, + onUnload: function() { + + }, + setCountTime: function(e) { + + }, + + + onPageScroll: function(e) { + + }, + + onShareAppMessage: function(e) { + + }, + + + +}); \ No newline at end of file diff --git a/pages/template/index.json b/pages/template/index.json new file mode 100644 index 0000000..4fc1363 --- /dev/null +++ b/pages/template/index.json @@ -0,0 +1,22 @@ +{ + "navigationBarBackgroundColor": "#ff7295", + "navigationBarTextStyle": "white", + "usingComponents": { + "goods_recommend":"/components/goods_list/goods_list", + "nav": "/components/diy_nav/diy_nav", + "advertising":"/components/diy_advertising/diy_advertising", + "groupbuy": "/components/diy_groupbuy/diy_groupbuy", + "goodsGroup": "/components/diy_goodsGroup/diy_goodsGroup", + "seckill": "/components/diy_seckill/diy_seckill", + "searchbox":"/components/diy_searchbox/diy_searchbox", + "shopname": "/components/diy_shopname/diy_shopname", + "pingd_buy": "/components/diy_pingd_buy/diy_pingd_buy", + "title": "/components/diy_title/diy_title", + "notice": "/components/diy_notice/diy_notice", + "voice": "/components/diy_voice/diy_voice", + "richtext": "/components/diy_richtext/diy_richtext", + "assist":"/components/diy_assist/diy_assist", + "picMax": "/components/diy_picMax/diy_picMax", + "mvideo": "/components/diy_video/diy_video" + } +} \ No newline at end of file diff --git a/pages/template/index.wxml b/pages/template/index.wxml new file mode 100644 index 0000000..4238850 --- /dev/null +++ b/pages/template/index.wxml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/template/index.wxss b/pages/template/index.wxss new file mode 100644 index 0000000..8c7514a --- /dev/null +++ b/pages/template/index.wxss @@ -0,0 +1,911 @@ +.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; +} \ No newline at end of file -- libgit2 0.21.4