| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935 |
- <template>
- <view>
- <!-- <view :class="'top-fixed' + (skinNotColor ? ' not-color' : '')" :style="'height: '+ systems.barHeight + 'rpx;'">
- <block v-if="about.CONFIG_PROJECT_TITLE_BG || about.CONFIG_PROJECT_TITLE_PIC">
- <image :src="about.CONFIG_PROJECT_TITLE_BG" class="topbg" v-if="about.CONFIG_PROJECT_TITLE_BG"></image>
- <view class="top-title" :style="'height: '+ systems.navigationHeight + 'rpx;top:' + systems.ktxStatusHeight + 'rpx;'" v-if="about.CONFIG_PROJECT_TITLE_PIC">
- <image :src="about.CONFIG_PROJECT_TITLE_PIC" mode="heightFix"></image>
- </view>
- </block>
- <view class="top-title" :style="'line-height: '+ systems.navigationHeight + 'rpx;top:' + systems.ktxStatusHeight + 'rpx;'" v-else>
- {{about.CONFIG_PROJECT_TITLE?about.CONFIG_PROJECT_TITLE:''}}
- </view>
- </view>
- <view :style="'height: '+ systems.barHeight + 'rpx;'"></view> -->
- <!-- <view @click="saoma()" style="z-index: 999;position: relative;">扫码</view> -->
- <view class="bg">
- <image :src="about.INDEX_PIC"></image>
- </view>
- <view class="service-person" :style="'top:' + systems.ktxStatusHeight + 'rpx;'" v-if="recommendCard">
- <view class="ddflex" @click="jumpUrl('/card/index/index?cardId='+recommendCard.id)">
- <image class="service-person-header" :src="recommendCard.avatar?recommendCard.avatar:'../../static/pages/images/userimg.png'"></image>
- <view>
- <view class="service-person-name ddflex">
- <view>{{recommendCard.realName}}的微页</view>
- <image src="/static/images/rico2.png" class="rico"></image>
- </view>
- <view class="service-person-number">(工号:{{recommendCard.jobNumber}}) 欢迎您来到我的微页</view>
- </view>
- </view>
- <view style="margin: 20rpx 30rpx 0;justify-content: space-between;" class="ddflex">
- <view>
- <view class="ddflex">
- <view class="service-person-tag">{{recommendCard.companyName}}</view>
- <view class="service-person-tag">{{recommendCard.jobName}}</view>
- </view>
- <view class="service-person-options ddflex">
- <view class="service-person-option ddflex">
- <image src="/static/pages/images/dz.png"></image>
- <view>{{recommendCard.favorableComment}}%</view>
- </view>
- <view class="service-person-option ddflex">
- <image src="/static/pages/images/cy.png"></image>
- <view>入司{{recommendCard.inDate?getAge(recommendCard.inDate):1}}年</view>
- </view>
- <view class="service-person-option ddflex">
- <image src="/static/pages/images/fw.png"></image>
- <view>为{{recommendCard.cntCust?recommendCard.cntCust:0}}人服务</view>
- </view>
- </view>
- </view>
- <view class="ddflex">
- <view class="service-person-phone" v-if="recommendCard.phone" @click="callPhone(recommendCard.phone)">
- <image src="../../static/pages/images/dh.png"></image>
- <view>电话</view>
- </view>
- <view class="service-person-phone" v-if="recommendCard.wechat" @click="isShowCodePop=true">
- <image src="../../static/pages/images/wx.png"></image>
- <view>微信</view>
- </view>
- </view>
- </view>
- </view>
- <view style="height: 610rpx;"></view>
- <view v-for="(item, index) in contact" :key="index">
- <!-- 弹窗广告 -->
- <view style="position: absolute;top:290rpx;left: 0;right: 0;">
- <banner v-if="item == 'ad' && bannerShow" :bannerList="bannerList" :url="site" :web="url" :config="about" :couponList="couponList" :officeList="officeList" :districtTemplate="districtTemplate"></banner>
- </view>
- <district v-if="item == 'king_kong_district' && districtShow" :url="site" :web="url" :districtTemplate="districtTemplate"></district>
-
- </view>
-
- <view class="index-box" style="margin-top: 10rpx;" v-if="hotActivityList.length>0">
- <view class="index-box-title">热门活动</view>
- <view class="ddflex" style="margin-top: 20rpx;">
- <view style="margin-right: 20rpx;">
- <image class="pic230" :src="hotActivityList[0].pic"></image>
- <image class="pic230" style="margin-top: 20rpx;" :src="hotActivityList[1].pic"></image>
- </view>
- <image class="pic480" :src="hotActivityList[2].pic"></image>
- </view>
- </view>
-
- <!-- 参与活动 -->
- <view class="index-box" style="margin-top: 50rpx;" v-if="matchList.length>0">
- <view class="index-box-title">更多活动</view>
- <view class="map-ac">
- <scroll-view scroll-x="true" class="map-acs" >
- <view class="li" v-for="(item,index) in matchList" :key="index" @click="jumpUrl('/match/activityDetail/activityDetail?id='+item.id)">
- <view style="position: relative;border-radius: 20rpx;overflow: hidden;">
- <image :src="item.pic ? item.pic : '/static/images/def_zw1.png'" mode="aspectFill"></image>
- <view class="ac-type" v-if="item.categoryName">{{ item.categoryName }}</view>
- </view>
- <view class="ac-title tovers">{{ item.title }}</view>
- </view>
- </scroll-view>
- </view>
- </view>
-
- <!-- 投保案例 -->
- <view class="index-box" style="margin:0;padding: 30rpx;background-color: #f5f5f5;" v-if="tbalList.length>0">
- <view class="index-box-title">投保案例</view>
- <view>
- <view class="tbal-nav ddflex">
- <view :class="'tbal-nav-item '+(tbalIndex==index?'tbal-nav-item-active':'' )" v-for="item,index in tbalList" @click="changeTbalTab(index)">
- <view>{{item.name}}</view>
- <view class="tbal-nav-label">20~30岁</view>
- </view>
- <!-- <view class="tbal-nav-item">
- <view>形成期</view>
- <view class="tbal-nav-label">20~30岁</view>
- </view>
- <view class="tbal-nav-item">
- <view>成长期</view>
- <view class="tbal-nav-label">20~30岁</view>
- </view>
- <view class="tbal-nav-item">
- <view>成熟期</view>
- <view class="tbal-nav-label">20~30岁</view>
- </view> -->
- </view>
-
- <block v-if="tbalList[tbalIndex].contentList">
- <view class="tbal-item ddflex" v-for="it in tbalList[tbalIndex].contentList" @click="jumpUrl('/topic/alContent/alContent?id='+it.id)">
- <image class="tbal-pic" :src="it.pic?it.pic:'/static/images/lj_img.png'"></image>
- <view class="flex">
- <view class="tbal-title">{{it.title}}</view>
- <view class="ddflex">
- <view class="ddflex flex">
- <view class="tbal-price" >{{it.fieldValues&&it.fieldValues.yearMoney?it.fieldValues.yearMoney:'0'}}</view>
- <view class="tbal-price-text">年缴费</view>
- </view>
- <view class="tbal-line"></view>
- <view class="ddflex flex">
- <view class="tbal-price" >{{it.fieldValues&&it.fieldValues.allMoney?it.fieldValues.allMoney:'0'}}</view>
- <view class="tbal-price-text">总保额 </view>
- </view>
- </view>
- <view class="tbal-btn">去看看</view>
- </view>
- <view class="tbal-tag" v-if="it.fieldValues&&it.fieldValues.version">{{it.fieldValues.version}}</view>
- </view>
- </block>
- </view>
- </view>
-
- <!-- 真实理赔故事 -->
- <view class="index-box" v-if="lpalList.length>0">
- <view class="index-box-title ddflex">
- <text class="fflex">真实理赔故事</text>
- <view class="fx-header-more ddflex" @click="jumpUrl('/topic/contentList/contentList?code='+lpalCode+'&title=理赔案例')">
- 更多
- <image src="/static/pages/images/more.png"></image>
- </view>
- </view>
- <view class="map-ac">
- <scroll-view scroll-x="true" class="map-acs ddflex" style="height: 430rpx;">
- <view class="lpgs-item" v-for="items,indexs in lpalList ">
- <image class="lpgs-icon" src="../../static/images/lpgs_icon.png"></image>
- <view :class="'lpgs-header '+(indexs%2==0?'lpgs-header-c':'')">
- <view>{{items.name}}</view>
- </view>
- <view class="lpgs-content">
- <view class="lpgs-item-content ddflex" v-for="item in items.contentList" @click="jumpUrl('/topic/content/content?id='+item.id)">
- <view class="flex" style="min-width: 0;">
- <view class="lpgs-item-content-title tovers">{{item.title}}</view>
- <view class="lpgs-item-content-look ddflex">
- <image src="/static/images/eyes.png"></image>
- <view>{{unitFormat(item.browse)}}</view>
- </view>
- </view>
- <image class="lpgs-item-content-pic" :src="item.pic?item.pic:'/static/images/lj_img.png'"></image>
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
- </view>
-
- <!-- 发现 -->
- <view class="index-box" style="margin:0;padding: 30rpx;background-color: #f5f5f5;" v-if="fxList.length>0">
- <view class="map-ac">
- <scroll-view scroll-x="true" class="map-acs ddflex" style="height: 70rpx;">
- <view :class="'fx-nav '+(fxIndex==index?'fx-nav-active':'')" v-for="item,index in fxList" @click="changeFxTab(index)">{{item.name}}</view>
- </scroll-view>
- </view>
- <view class="fx-bar">
- <view class="fx-header ddflex">
- <view class="ddflex">
- <view class="fx-header-title">{{fxList[fxIndex].name}}</view>
- <view class="fx-header-more">2.2万人转发</view>
- </view>
- <view class="fx-header-more ddflex" @click="jumpUrl('/topic/contentList/contentList?code='+fxList[fxIndex].code+'&title='+fxList[fxIndex].name)">
- 更多
- <image src="/static/pages/images/more.png"></image>
- </view>
- </view>
- <view>
- <view class="fx-item ddflex" v-for="item in fxContentList" @click="jumpUrl('/topic/content/content?id='+item.id)">
- <view class="flex" style="min-width: 0;">
- <view class="fx-item-title tovers">{{item.title}}</view>
- <view class="ddflex" style="margin-top: 24rpx;">
- <view class="fx-item-time">{{formatTime(item.createDate)}}</view>
- <view class="fx-item-look ddflex">
- <image src="/static/images/eyes.png"></image>
- <view>{{unitFormat(item.browse)}}</view>
- </view>
- </view>
- </view>
- <image class="fx-item-pic" :src="item.pic?item.pic:'../../static/images/lj_img.png'"></image>
- </view>
- </view>
- </view>
- </view>
-
- <!-- <component v-for="(item,index) in contact" ></component> -->
- <!-- <ad></ad> -->
- <block v-if="contactShow">
- <view class="spinner">
- <view class="spinner-container container1">
- <view class="circle1"></view>
- <view class="circle2"></view>
- <view class="circle3"></view>
- <view class="circle4"></view>
- </view>
- <view class="spinner-container container2">
- <view class="circle1"></view>
- <view class="circle2"></view>
- <view class="circle3"></view>
- <view class="circle4"></view>
- </view>
- <view class="spinner-container container3">
- <view class="circle1"></view>
- <view class="circle2"></view>
- <view class="circle3"></view>
- <view class="circle4"></view>
- </view>
- </view>
- <view class="lond">加载中···</view>
- </block>
- <view class="foot-logo">
- <image src="/static/images/zgrs_logo.png"></image>
- </view>
- <!-- <footer-copyright v-if="logo"></footer-copyright> -->
- <!-- <contact-button img-url="/static/pages/images/kfico1_1.png" class-name="contact_index" button-text="客服"></contact-button> -->
- <view class="guide" @tap="hideGuide" v-if="first"><image src="/static/pages/images/guide.png" mode="widthFix"></image></view>
- <!-- <view class="placeholder-view" :style="'height:' + (bottomBlankHeight + 115) + 'rpx'"></view> -->
- <foot channel="home" :isUpdate="isUpdate"></foot>
-
-
- <view class="ceng2" v-if="isShowCodePop" @click="isShowCodePop = false" @touchmove.stop.prevent="moveHandle"></view>
- <view class="code-pop" v-if="isShowCodePop">
- <view class="code-content" v-if="recommendCard.wechatCode">
- <image :src="recommendCard.wechatCode?recommendCard.wechatCode:'/static/images/wxCode.jpg'" show-menu-by-longpress="true"></image>
- <view style="text-align: center;font-size: 24rpx;color: #999;margin-bottom: 50rpx;">长按识别微信二维码</view>
- </view>
- <view class="code-text" v-else>
- <view>微信号</view>
- <view>{{recommendCard.wechat}}</view>
- </view>
- <view class="code-btn" @click="copy(recommendCard.wechat)">
- 复制微信号
- </view>
- </view>
- <msgNumber></msgNumber>
-
- <view class="chat-fixed">
- <view class="chat-box ddflex">
- <image :src="recommendCard.avatar?recommendCard.avatar:'../../static/pages/images/userimg.png'"></image>
- <view class="chat-lyl">聊一聊</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- //index.js
- //获取应用实例
- const app = getApp();
- const req = require('../../utils/request.js');
- const api = require('../../utils/api.js');
- const utils = require('../../utils/util.js');
- const mes = require('../../utils/requestmessage.js');
- const route = require('../../utils/route');
- const QQMapWX = require("../../utils/qqmap.js");
- import foot from '../../components/nav-bar/index';
- import footerCopyright from '../../components/footer-copyright/footer-copyright';
- import banner from '../../template/banner/banner';
- import district from '../../template/king_kong_district/king_kong_district';
- import msgNumber from '../../components/msg-number/index.vue';
- export default {
- data() {
- return {
- skinNotColor: req.public.skinNotColor,
- systems: {},
- header: req.header,
- bottomBlankHeight: app.globalData.isIPhoneX ? 68 : 0,
- bannerList: [],
- //产品分类列表
- page: 1,
- //产品列表
- merchant: {},
- activityGroup: {
- products: []
- },
- couponList: {},//优惠券,
- isUpdate: false,
- // 是否更新消息
- first: true,
- //是否显示提示加入我的小程序
- isLayerAd: true,
- //广告
- homeTemplate: [],
- //首页栏目配置
- storeShow: true,
- templateType: {
- module_ad: 'ad',
- //广告
- module_type_district: 'type_district',
- //分类导航
- module_king_kong_district: 'king_kong_district', //金刚区
- },
- isNotice: false,
- joingroupList: {
- products: []
- },
- //拼团
- bargainList: {
- products: []
- },
- //砍价
- customersList: {
- products: []
- },
- //新客
- freshen: true,
- url: '',
- web: '',
- site: '',
- districtTemplate: {},
- contact: [],
- seckillList: {
- products: []
- },
- about: {},
- Is_Store_Price_Stock: '',
- guarantee: [],
- animationData: '',
- content: '',
- popAdList: {},
- iscouponAd: false,
- logo: false,
- top: Boolean,
- top_type: Boolean,
- switchStoreShow: Boolean,
- contactShow: true,
- districtShow: false,
- bannerShow: false,
- officeList: [],//互动
- hotActivityList:[],//热门活动
- matchList:[],//活动列表
-
- tbalList:[],//投保案例
- tbalIndex:0,//投保案例tab
-
- lpalList:[],//理赔案例
-
- fxList:[],//发现
- fxIndex:0,
- fxContentList:[],
-
- recommendCard:{},//销售
-
- isShowCodePop:false,
-
- lpalCode:req.public.lpalCode
- };
- },
- components: {
- foot,
- footerCopyright,
- banner,
- district,
- msgNumber
- },
- props: {},
- onLoad: async function(options) {
- // console.log("扫码进去参数===" + JSON.stringify(options));
- // if (options.scene) {
- // // this.scene = options.scene || '1290926887903780865';
- // this.scene = options.scene;
- // await this.loadCodeParams();
- // }
- // wx.setNavigationBarColor({
- // frontColor: '#ffffff',
- // backgroundColor: req.public.titleTopBgColor,
- // })
- // this.getPopAd()
- this.query = options;
- req.silenceLogin(options.userId, '');
- if (options.custom_params) {
- let obj = decodeURIComponent(opt.custom_params);
- obj = JSON.parse(obj);
- // console.log(obj)
- req.setStorage('pidCode', obj.userId);
- }
- if (options.isShare) {
- if (options.userId) {
- req.setStorage('pidCode', options.userId);
- }
- }
- setInterval(() => {
- this.setData({
- isNotice: true
- });
- }, 10000); // this.init();
-
- QQMapWX.initMap();
- req.getLocation(res => {
- const to = {
- latitude: res.latitude,
- longitude: res.longitude
- };
- QQMapWX.reverseGeocoder(to, resp => {
- });
- });
- },
- async onShow() {
- let _ts = this;
- await this.getConfig().then(res => {
- });
- await this.getHomeTemplateConfig();
- uni.setNavigationBarColor({
- frontColor: this.skinNotColor?'#000':'#ffffff',
- backgroundColor: req.public.titleTopBgColor
- });
- _ts.setData({
- isUpdate: !_ts.isUpdate
- });
-
- this.getHotActivity()
- this.getMatchList()
- this.getTbal()
- this.getLpal()
- this.getFx()
- this.getRecommendCard()
- // console.log('this.freshen=='+this.freshen)
- let first = req.getStorage('first');
- if (first !== false)
- _ts.setData({
- first: true
- });
- else
- _ts.setData({
- first: false
- });
- },
- onUnload() {
- // this.isShowTime = false;
- this.clearAllTimer(1);
- this.clearAllTimer(2);
- this.clearAllTimer(3);
- this.clearAllTimer(4);
- },
- onHide() {
- // this.isShowTime = false;
- this.clearAllTimer(1);
- this.clearAllTimer(2);
- this.clearAllTimer(3);
- this.clearAllTimer(4);
- },
- onShareAppMessage: function() {
-
- },
- onShareTimeline() {
-
- },
- onReachBottom() {},
- methods: {
- jumpUrl(url){
- if(req.isLogins(false)){
- uni.navigateTo({
- url:url
- })
- }
- },
- // 获取推荐销售
- getRecommendCard(){
- req.getRequest('/api/visiting/card/recommendCardInfo',{},res=>{
- this.recommendCard = res
- })
- },
- // 获取热门活动
- getHotActivity(){
- req.getRequest('/api/banner',{code:'index_hot_activity'},res=>{
- this.hotActivityList = res
- })
- },
- // 获取更多活动
- getMatchList(){
- req.getRequest('/api/match/list',{page:1,limit:10},res=>{
- this.matchList = res
- })
- },
- // 获取投保案例
- async getTbal(){
- this.tbalList = await this.getContentList(req.public.tbalCode)
- this.tbalList[this.tbalIndex].contentList = await this.getContentPageList(this.tbalList[this.tbalIndex].code)
- this.$forceUpdate()
- },
- // 获取理赔案例
- async getLpal(){
- this.lpalList = await this.getContentList(req.public.lpalCode)
- this.lpalList.map(async item=>{
- item.contentList = await this.getContentPageList(item.code)
- this.$forceUpdate()
- })
- },
- // 获取发现
- async getFx(){
- this.fxList = await this.getContentList('faxian')
- this.getFxContenteList(this.fxList[this.fxIndex].code)
- },
-
- // 获取文章栏目列表
- getContentList(code){
- return new Promise((r,j)=>{
- req.getRequest('/api/content/category/list',{parentCode:code},res=>{
- r(res?res:[])
- })
- })
- },
-
- // 获取文章列表
- getContentPageList(code){
- return new Promise((r,j)=>{
- req.getRequest('/api/content/list',{code:code,page:1,limit:2},res=>{
- r(res?res:[])
- })
- })
- },
-
- // 获取发现文章列表
- getFxContenteList(code){
- return new Promise((r,j)=>{
- req.getRequest('/api/content/list',{code:code,page:1,limit:10},res=>{
- this.fxContentList = res?res:[]
- r(res?res:[])
- })
- })
- },
- // 投保案例tab切换
- async changeTbalTab(index){
- if(this.tbalIndex==index) return false;
- this.tbalIndex = index
- this.tbalList[this.tbalIndex].contentList = await this.getContentPageList(this.tbalList[this.tbalIndex].code)
- },
- // 发现tab切换
- changeFxTab(index){
- if(this.fxIndex==index) return false;
- this.fxIndex = index
- this.getFxContenteList(this.fxList[this.fxIndex].code)
- },
-
- async getRqeDatas() {
- console.log('getRqeDatas');
- let that = this; //多门店
-
- // 金刚区
- let district = that.homeTemplate.filter(it => it.module == that.templateType.module_king_kong_district);
- if (district && district.length > 0 && district[0].state == 0) {
- let data = district[0];
- data.content = JSON.parse(district[0].content);
- that.districtTemplate = data;
- if (data.contentId == 2) {
- that.districtShow = true;
- }
- console.log(that.districtTemplate, '=============');
- }
- //顶部banner
- let ad = that.homeTemplate.filter(it => it.module == that.templateType.module_ad);
- if (ad && ad.length > 0 && ad[0].state == 0) {
- if (that.freshen) {
- await that.getBannerList(ad[0].module, ad[0].contentId);
- }
- }
- that.logo = true;
- },
- getUrl2(e) {
- // 2 普通产品详情 4社区团购产品详情 5优惠券列表 6直播列表 7社区团购列表 9分类列表 10直播间 11拼团列表 12秒杀列表 13砍价列表 14新客列表 15新客详情 16秒杀详情 17砍价详情 18 拼团详情
- var dt = e.currentTarget.dataset;
- var url = '';
- var id = '';
- var acid = '';
- if (dt.content != '') {
- let conunt = dt.content.split('_');
- id = conunt[1];
- acid = conunt[0];
- }
- if (dt.type * 1 == 2 && dt.content != '') {
- url = 'product/detail/detail?id=' + dt.content;
- } else if (dt.type * 1 == 4) {
- url = 'product/groupDetail/groupDetail?acid=' + acid + '&id=' + id;
- } else if (dt.type * 1 == 5) {
- url = 'product/coupon/coupon';
- } else if (dt.type * 1 == 6) {
- url = 'pages/live/live';
- } else if (dt.type * 1 == 7) {
- url = 'product/groupList/groupList' + dt.merchant;
- } else if (dt.type * 1 == 9 && dt.content != '') {
- url = 'product/list/list?id=' + dt.content;
- } else if (dt.type * 1 == 10) {
- url = 'plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=' + dt.content;
- // console.log(
- // url); // url=`plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${dt.content}`
- } else if (dt.type * 1 == 11) {
- url = 'activity/group/index/index' + dt.merchant;
- } else if (dt.type * 1 == 12) {
- url = 'activity/seckill/seckill' + dt.merchant;
- } else if (dt.type * 1 == 13) {
- url = 'activity/bargain/index/index' + dt.merchant;
- } else if (dt.type * 1 == 14) {
- url = 'activity/newbornZone/newbornZone' + dt.merchant;
- } else if (dt.type * 1 == 15 && dt.content != '') {
- url = 'activity/newbornDetails/newbornDetails?acid=' + acid + '&id=' + id;
- } else if (dt.type * 1 == 16 && dt.content != '') {
- url = 'activity/seckillDetails/seckillDetails?acid=' + acid + '&id=' + id;
- } else if (dt.type * 1 == 17 && dt.content != '') {
- url = 'activity/bargain/detail/detail?acid=' + acid + '&id=' + id;
- } else if (dt.type * 1 == 18 && dt.content != '') {
- url = 'activity/group/detail/detail?acid=' + acid + '&id=' + id;
- } else {
- url = '';
- }
- if (dt.type * 1 == 6) app.globalData.switchTab(url);
- else app.globalData.openPage(url);
- this.hideAd();
- },
- //获取首页模板配置
- getHomeTemplateConfig() {
- let _ts = this;
- let page = 'index';
- //荣康模板配置、小店产品==门店产品
- // if (this.merchant && this.merchant.type == 5 || this.shopId && this.merchantId) page = 'shopIndex'
- req.getRequest(
- '/api/template/getTemplate',
- {
- page: page
- },
- data => {
- let arr = [];
- data.forEach(it => {
- arr.push(it.module);
- });
- this.setData({
- contact: [...new Set(arr)],
- contactShow: false
- });
- if (this.contact.indexOf('sou') != -1 && this.contact.indexOf('store_options') != -1) {
- this.top = false;
- } else {
- this.top = true;
- }
- if (this.contact.indexOf('sou') != -1 && this.contact.indexOf('type_district') != -1) {
- this.top_type = false;
- } else {
- this.top_type = true;
- }
- console.log(this.contact.indexOf('sou') != -1, this.contact.indexOf('store_options') != -1, this.contact.indexOf('type_district') != -1, this.top);
- console.log(this.contact);
- this.setData({
- homeTemplate: data
- });
- this.getRqeDatas();
- }
- );
- },
- getConfig() {
- var _this = this;
- return new Promise((res, rej) => {
- req.g(
- '/api/other/config',
- data => {
- req.setStorage('configRes', JSON.stringify(data));
- this.about = data;
- if (!data.Index_Store_Confirm || data.Index_Store_Confirm == 0) {
- _this.setData({
- switchStoreShow: false,
- storeShow: false
- });
- } else {
- _this.setData({
- switchStoreShow: true
- });
- }
- // console.log(data.Index_Store_Confirm, "====", !data.Index_Store_Confirm, typeof(res
- // .Index_Store_Confirm))
- uni.setNavigationBarTitle({
- // title: res['CONFIG_PROJECT_TITLE'],
- title: data['CONFIG_PROJECT_TITLE']
- });
- // console.log(data.Is_Store_Price_Stock);
- if (data.Is_Store_Price_Stock) {
- this.Is_Store_Price_Stock = data.Is_Store_Price_Stock;
- }
- this.setData({
- Is_Store_Price_Stock: data.Is_Store_Price_Stock
- });
- if (data.b2c_service_guarantee && data.b2c_service_guarantee != null) {
- this.setData({
- guarantee: data.b2c_service_guarantee.split(';').filter(it => {
- return (it = it && it.trim());
- })
- });
- }
- req.setStorage('appName', data['CONFIG_PROJECT_TITLE']);
- req.setStorage('productDiy', data['Product_Foot-Diy']);
- res(data);
- },
- true
- );
- });
- },
- merchantFun() {
- app.globalData.openPage('pages/nearby/nearby');
- },
- saoma() {
- var _this = this; // 允许从相机和相册扫码
- uni.scanCode({
- success: res => {
- uni.navigateTo({
- url: '/' + res.path
- }); // this.scene = '1290926887903780865';
- this.loadCodeParams();
- }
- });
- },
- update(content) {
- var that = this;
- var animation = uni.createAnimation(); // 旧消息向上平移
- animation.translateY(-50).step({
- duration: 1000,
- timingFunction: 'ease-in'
- }); // 为了实现下一条新内容向上平移的效果,必须把内容很快平移到下方,并且不能被用户看见,这里其原理类似轮播图的思路。
- // 实现方法:动画时间设置为1ms,过渡效果设置为’动画第一帧就跳至结束状态直到结束‘
- animation
- .opacity(0)
- .translateY(50)
- .step({
- duration: 1000,
- timingFunction: 'step-start'
- }); // 新消息向上平移的同时恢复透明
- animation
- .opacity(1)
- .translateY(0)
- .step({
- duration: 1000,
- timingFunction: 'ease-out'
- });
- that.setData({
- animationData: animation.export()
- }); // 更新内容的延时必须大于第一步动画时间
- setTimeout(() => {
- that.setData({
- content: content
- });
- }, 500000);
- },
- loadCodeParams() {
- let _ts = this;
- return new Promise((resolve, reject) => {
- if (!_ts.scene) {
- resolve();
- return false;
- }
- req.getRequest(
- '/api/code/params',
- {
- scene: _ts.scene
- },
- data => {
- req.setStorage('pidCode', data.userId);
- resolve();
- }
- );
- });
- },
- getBannerList(module, contentId) {
- //banner图
- let that = this;
- return new Promise((resolve,reject)=>{
- req.getRequest(
- '/api/banner',
- {
- groupId: contentId
- },
- data => {
- if (module == that.templateType.module_ad) {
- that.setData({
- bannerList: data,
- bannerShow: true
- });
- } else {
- that.setData({
- popAdList: data[0]
- });
- }
- resolve();
- }
- );
- })
- },
-
- clearAllTimer(type) {
- // console.log(this.activityGroup, this.joingroupList, this.bargainList, this.customersList);
- if (type == 1) {
- this.activityGroup.products.forEach(it => clearInterval(it.timer));
- this.activityGroup.products.forEach(it => clearInterval(it.times));
- } else if (type == 2) {
- this.joingroupList.products.forEach(it => clearInterval(it.timer));
- this.joingroupList.products.forEach(it => clearInterval(it.times));
- } else if (type == 3) {
- this.bargainList.products.forEach(it => clearInterval(it.timer));
- this.bargainList.products.forEach(it => clearInterval(it.times));
- } else if (type == 4) {
- this.customersList.products.forEach(it => clearInterval(it.timer));
- this.customersList.products.forEach(it => clearInterval(it.times));
- } else if (type == 5) {
- this.seckillList.products.forEach(it => clearInterval(it.timer));
- this.seckillList.products.forEach(it => clearInterval(it.times));
- }
- },
- hideGuide() {
- //关闭提示加入我的小程序
- this.setData({
- first: false
- });
- req.setStorage('first', false);
- },
- hideAd() {
- //关闭广告
- // if(this.data.first==false){
- this.setData({
- isLayerAd: false
- }); // }
- app.globalData.isLayerAd = false;
- },
- click(e) {
- // console.log(e)
- this.storeShow = e;
- },
- goUrl(event) {
- //跳转链接
- let url = event.currentTarget.dataset.url;
- app.globalData.openPage(url);
- },
- // 拨打电话
- callPhone(val) {
- if(!val) return false
- uni.makePhoneCall({
- phoneNumber: val
- });
- },
- copy(val){
- this.isShowCodePop = false
- uni.setClipboardData({
- data: val,
- complete() {
- req.msg('复制成功')
- }
- })
- },
- unitFormat(data){
- return req.unitConverter(data).text
- },
- formatTime(date){
- date = new Date(date.replace(/-/g, '/'))
- return utils.formatTime(date).t3
- },
- getAge(date){
- return utils.getAge(date)
- }
- },
- mounted() {
- const systemInfo = uni.getSystemInfoSync();
- // px转换到rpx的比例
- let pxToRpxScale = 750 / systemInfo.windowWidth;
- let systems = {
- ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
- navigationHeight: 44 * pxToRpxScale // 导航栏的高度
- };
- systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
- this.systems = systems;
- }
- };
- </script>
- <style>
- @import './index.css';
- </style>
|