Commit 0c94d53d authored by 黄奎's avatar 黄奎

111

parent 19e7536e
...@@ -101,7 +101,6 @@ ...@@ -101,7 +101,6 @@
that.showDialog = true; that.showDialog = true;
wx.login({ wx.login({
success: (res) => { success: (res) => {
//console.log(res)
let obj = { let obj = {
Source: 1, Source: 1,
OpenId: "", OpenId: "",
......
...@@ -11,34 +11,30 @@ ...@@ -11,34 +11,30 @@
<Text>收货人</Text> <Text>收货人</Text>
<input class="uni-input inputM" v-model="msg.Name" /> <input class="uni-input inputM" v-model="msg.Name" />
</view> </view>
<view style="width: 100%;height: 1px;background: #f5f5f5;"/> <view style="width: 100%;height: 1px;background: #f5f5f5;" />
<view class="addcenter_item2"> <view class="addcenter_item2">
<Text>联系电话</Text> <Text>联系电话</Text>
<input class="uni-input inputM" v-model="msg.Mobile" /> <input class="uni-input inputM" v-model="msg.Mobile" />
</view> </view>
<view style="width: 100%;height: 1px;background: #f5f5f5;"/> <view style="width: 100%;height: 1px;background: #f5f5f5;" />
<!-- TODO 动态获取地址数据 --> <!-- TODO 动态获取地址数据 -->
<view class="addcenter_item"> <view class="addcenter_item">
<Text>所在地区</Text> <Text>所在地区</Text>
<view style="display: flex;flex-direction: row;align-items: center;" @click="addressShow = true"> <view style="display: flex;flex-direction: row;align-items: center;" @click="addressShow = true">
<Text :style="{'color':address!=''? '#303133':'#9D9C9B'}">{{address!=''? address :'请选择'}}</Text> <Text :style="{'color':address!=''? '#303133':'#9D9C9B'}">{{address!=''? address :'请选择'}}</Text>
<u-icon name="arrow" color="#B2B2B2" size="30" ></u-icon> <u-icon name="arrow" color="#B2B2B2" size="30"></u-icon>
<pickerAddress v-model="addressShow" @confirm="addresspick" /> <pickerAddress v-model="addressShow" @confirm="addresspick" />
</view> </view>
</view> </view>
<view style="width: 100%;height: 1px;background: #f5f5f5;"/> <view style="width: 100%;height: 1px;background: #f5f5f5;" />
<view class="addcenter_item2" style="align-items: flex-start;"> <view class="addcenter_item2" style="align-items: flex-start;">
<Text>详细地址</Text> <Text>详细地址</Text>
<textarea <textarea style="height: 50px;" class="inputM" v-model="msg.Address" />
style="height: 50px;" </view>
class="inputM"
v-model="msg.Address"
/>
</view>
</view> </view>
<!-- 智能识别 --> <!-- 智能识别 -->
<view class="smart"> <!-- <view class="smart">
<view> <view>
<span>智能识别</span> <span>智能识别</span>
<textarea <textarea
...@@ -55,7 +51,7 @@ ...@@ -55,7 +51,7 @@
</view> </view>
</view> </view>
</view> </view> -->
<view class="btn" @click="preserve" :style="{'background':mainColor}"> <view class="btn" @click="preserve" :style="{'background':mainColor}">
<Text>保存地址</Text> <Text>保存地址</Text>
</view> </view>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</view> </view>
<view class="height-line1"></view> <view class="height-line1"></view>
</view> </view>
<view class="column"> <view class="column" style="display: none;">
<view class="AirplanePassengerAddEditingC-text row-sb-n fz30"> <view class="AirplanePassengerAddEditingC-text row-sb-n fz30">
<text class="flexS AirplanePassengerAddEditingC-textL">联系电话</text> <text class="flexS AirplanePassengerAddEditingC-textL">联系电话</text>
<view class="flexG"> <view class="flexG">
...@@ -153,6 +153,9 @@ ...@@ -153,6 +153,9 @@
<text class="fz30 fontBold flexG">{{addMsg.result.birthday}}</text> <text class="fz30 fontBold flexG">{{addMsg.result.birthday}}</text>
</view> --> </view> -->
</view> </view>
<view>
</view>
<view class="showAddEditing-buttom fz32 fontBold textCenter row-sb-n"> <view class="showAddEditing-buttom fz32 fontBold textCenter row-sb-n">
<view class="border1 colorDEBF7B borderDEBF7B" @click="showAddEditingPreviwe=false">返回修改</view> <view class="border1 colorDEBF7B borderDEBF7B" @click="showAddEditingPreviwe=false">返回修改</view>
<view v-if="!loading" class="border1 borderDEBF7B" @click="submit">确认{{editorIndex||editorIndex==0?'编辑':'添加'}}</view> <view v-if="!loading" class="border1 borderDEBF7B" @click="submit">确认{{editorIndex||editorIndex==0?'编辑':'添加'}}</view>
......
<template> <template>
<view class="indexpage"> <view class="indexpage">
<view v-if="showStart == true" style="width: 100vw; height: 100vh"> <view v-if="showStart == true" style="width: 100vw; height: 100vh">
<image <image :src="startData.PicUrl" mode="aspectFit" style="width: 100%; height: 100%; position: relative">
:src="startData.PicUrl" <view class="Startbtn" :style="{ top: pagePaddingBottom }" @click="startb">
mode="aspectFit" 跳过
style="width: 100%; height: 100%; position: relative" </view>
> </image>
<view </view>
class="Startbtn" <view v-if="myPageData.home_pages" v-show="showStart == false" :style="[myPageData.home_pages.navs[active].templateBg]">
:style="{ top: pagePaddingBottom }" <view class="content" :style="{
@click="startb"
>
跳过
</view>
</image>
</view>
<view
v-if="myPageData.home_pages"
v-show="showStart == false"
:style="[myPageData.home_pages.navs[active].templateBg]"
>
<view
class="content"
:style="{
'padding-bottom':(pageId==0?'78px':'0px'), 'padding-bottom':(pageId==0?'78px':'0px'),
}" }">
> <!-- paddingTop: pagePaddingBottom, -->
<!-- paddingTop: pagePaddingBottom, --> <view v-if="pageId!=0" class="index-title" :class="{ MainTopLeft: pageTitleStr.length > 10 }" :style="[
<view
v-if="pageId!=0"
class="index-title"
:class="{ MainTopLeft: pageTitleStr.length > 10 }"
:style="[
myPageData.home_pages.navs[active].templateBg, myPageData.home_pages.navs[active].templateBg,
titleStyle, titleStyle,
{ {
...@@ -39,1353 +20,1186 @@ ...@@ -39,1353 +20,1186 @@
? myPageData.home_pages.navs[active].templateBg.titleColor ? myPageData.home_pages.navs[active].templateBg.titleColor
: '', : '',
}, },
]" ]">
> <text v-if="isNavPosition == 0">{{ pageTitleStr }}</text>
<text v-if="isNavPosition == 0">{{ pageTitleStr }}</text> <view v-if="isNavPosition == 1" style="width: 78%">
<view v-if="isNavPosition == 1" style="width: 78%"> <search :style-str="searchData"></search>
<search :style-str="searchData"></search> </view>
</view> <view class="back-arrow" v-if="showBack" @click="goback">
<view class="back-arrow" v-if="showBack" @click="goback"> <u-icon name="arrow-left" size="44"></u-icon>
<u-icon name="arrow-left" size="44"></u-icon> </view>
</view> </view>
</view> <!-- <view @click='yj' style="width: 200px;height: 50px;">活动</view> -->
<!-- <view @click='yj' style="width: 200px;height: 50px;">活动</view> --> <u-tabs v-if="myPageData.home_pages && myPageData.home_pages.navs.length > 1" name="name" :list="myPageData.home_pages.navs"
<u-tabs :is-scroll="true" :active-color="mainColor" :current="active" :bar-width="80" :font-size="32" :bold="false"
v-if="myPageData.home_pages && myPageData.home_pages.navs.length > 1" @change="changeHandler"></u-tabs>
name="name" <template v-for="(item, i) in myPageData.home_pages.navs">
:list="myPageData.home_pages.navs" <view :key="i" v-if="active == i">
:is-scroll="true" <template v-for="(d, di) in item.template.data">
:active-color="mainColor" <search v-if="d.id == 'search' && isNavPosition == 0" :style-str="d.data" :key="di"></search>
:current="active" <swiper v-if="d.id == 'banner'" :swipers="d.data" :key="di"></swiper>
:bar-width="80" <empty v-if="d.id == 'empty'" :block="d.data" :key="di"></empty>
:font-size="32" <rubik v-if="d.id == 'rubik'" :ad="d.data" :key="di"></rubik>
:bold="false" <goods v-if="d.id == 'goods'" :goods="d.data" :key="di"></goods>
@change="changeHandler" <notice v-if="d.id == 'notice'" :notice="d.data" :key="di"></notice>
></u-tabs> <gridnav v-if="d.id == 'nav'" :navs="d.data" :key="di"></gridnav>
<template v-for="(item, i) in myPageData.home_pages.navs"> <pagetitle v-if="d.id == 'link'" :ts="d.data" :key="di"></pagetitle>
<view :key="i" v-if="active == i"> <videopage v-if="d.id == 'video'" :video="d.data" :key="di"></videopage>
<template v-for="(d, di) in item.template.data"> <copyright v-if="d.id == 'copyright'" :cop="d.data" :key="di"></copyright>
<search <checkin v-if="d.id == 'check-in'" :check="d.data" :key="di"></checkin>
v-if="d.id == 'search' && isNavPosition == 0" <userbox v-if="d.id == 'user-info'" :ts="d.data" :key="di"></userbox>
:style-str="d.data" <view v-if="d.id == 'image-text'" class="imageText" :key="di">
:key="di" <view v-html="d.data.content"></view>
></search> </view>
<swiper <userorder v-if="d.id == 'user-order'" :uo="d.data" :key="di"></userorder>
v-if="d.id == 'banner'" <mapi v-if="d.id == 'map'" :mapi="d.data" :key="di"></mapi>
:swipers="d.data" <checkform v-if="d.id == 'form'" :forms="d.data" :key="di"></checkform>
:key="di" <addialog v-if="d.id == 'modal' && d.data.opened" :ads="d.data" :key="di"></addialog>
></swiper> <quicknav v-if="d.id == 'quick-nav' && d.data.navSwitch == 1" :navs="d.data" :key="di"></quicknav>
<empty v-if="d.id == 'empty'" :block="d.data" :key="di"></empty> <!-- <pingtuan
<rubik v-if="d.id == 'rubik'" :ad="d.data" :key="di"></rubik>
<goods v-if="d.id == 'goods'" :goods="d.data" :key="di"></goods>
<notice
v-if="d.id == 'notice'"
:notice="d.data"
:key="di"
></notice>
<gridnav v-if="d.id == 'nav'" :navs="d.data" :key="di"></gridnav>
<pagetitle
v-if="d.id == 'link'"
:ts="d.data"
:key="di"
></pagetitle>
<videopage
v-if="d.id == 'video'"
:video="d.data"
:key="di"
></videopage>
<copyright
v-if="d.id == 'copyright'"
:cop="d.data"
:key="di"
></copyright>
<checkin
v-if="d.id == 'check-in'"
:check="d.data"
:key="di"
></checkin>
<userbox
v-if="d.id == 'user-info'"
:ts="d.data"
:key="di"
></userbox>
<view v-if="d.id == 'image-text'" class="imageText" :key="di">
<view v-html="d.data.content"></view>
</view>
<userorder
v-if="d.id == 'user-order'"
:uo="d.data"
:key="di"
></userorder>
<mapi v-if="d.id == 'map'" :mapi="d.data" :key="di"></mapi>
<checkform
v-if="d.id == 'form'"
:forms="d.data"
:key="di"
></checkform>
<addialog
v-if="d.id == 'modal' && d.data.opened"
:ads="d.data"
:key="di"
></addialog>
<quicknav
v-if="d.id == 'quick-nav' && d.data.navSwitch == 1"
:navs="d.data"
:key="di"
></quicknav>
<!-- <pingtuan
v-if="d.id == 'pintuan'" v-if="d.id == 'pintuan'"
:goods="d.data" :goods="d.data"
:key="di" :key="di"
></pingtuan> --> ></pingtuan> -->
<shopinfo <shopinfo v-if="d.id == 'shop-info'" :ad="d.data" :key="di" ref="son"></shopinfo>
v-if="d.id == 'shop-info'" <guide v-if="d.id == 'drive-guide'" :info="d.data" ref="city"></guide>
:ad="d.data" <!-- 网课列表 -->
:key="di" <rgoods v-if="d.id == 'educationCustom'" :goods="d.data"></rgoods>
ref="son" <!-- 资讯 -->
></shopinfo> <argoods v-if="d.id == 'educationArticle'" :goods="d.data"></argoods>
<guide <!-- 最近学习组件 -->
v-if="d.id == 'drive-guide'" <rstudy v-if="d.id == 'education'" :goods="d.data" ref="study"></rstudy>
:info="d.data" <store v-if="d.id == 'reservestore'" :goods="d.data" :storeinfo="storeInfo"></store>
ref="city" <!-- 线下服务商品 -->
></guide> <sindex v-if="d.id == 'storeGoods'" :goods="d.data" :key="di"></sindex>
<!-- 网课列表 --> <!-- 老师列表 -->
<rgoods v-if="d.id == 'educationCustom'" :goods="d.data"></rgoods> <educationteacher v-if="d.id == 'educationteacher'" :goods="d.data" :key="di"></educationteacher>
<!-- 资讯 --> <!--导航栏-->
<argoods <navpage v-if="d.id == 'nav-page'" :navs="d.data" :key="di"></navpage>
v-if="d.id == 'educationArticle'" <!-- 相亲的人物模板 -->
:goods="d.data" <!-- <matchmaking v-if="d.id == 'miaiuser'" :navs="d.data" :key="di"></matchmaking> -->
></argoods> <!-- 相亲活动 -->
<!-- 最近学习组件 --> <miaiactivitytype v-if="d.id == 'miaiactivitytype'" :goods="d.data"></miaiactivitytype>
<rstudy <!-- 相亲活动自定义 -->
v-if="d.id == 'education'" <miaiactivityCustom v-if="d.id == 'miaiactivityCustom'" :goods="d.data"></miaiactivityCustom>
:goods="d.data" </template>
ref="study" </view>
></rstudy> </template>
<store <view v-if="showtabs">
v-if="d.id == 'reservestore'" <tabbar></tabbar>
:goods="d.data" </view>
:storeinfo="storeInfo"
></store>
<!-- 线下服务商品 -->
<sindex
v-if="d.id == 'storeGoods'"
:goods="d.data"
:key="di"
></sindex>
<!-- 老师列表 -->
<educationteacher
v-if="d.id == 'educationteacher'"
:goods="d.data"
:key="di"
></educationteacher>
<!--导航栏-->
<navpage
v-if="d.id == 'nav-page'"
:navs="d.data"
:key="di"
></navpage>
<!-- 相亲的人物模板 -->
<!-- <matchmaking v-if="d.id == 'miaiuser'" :navs="d.data" :key="di"></matchmaking> -->
<!-- 相亲活动 -->
<miaiactivitytype
v-if="d.id == 'miaiactivitytype'"
:goods="d.data"
></miaiactivitytype>
<!-- 相亲活动自定义 -->
<miaiactivityCustom
v-if="d.id == 'miaiactivityCustom'"
:goods="d.data"
></miaiactivityCustom>
</template>
</view>
</template>
<view v-if="showtabs">
<tabbar></tabbar>
</view>
<view <view class="tips_t" v-if="
class="tips_t"
v-if="
add_show == 1 && add_show == 1 &&
JSON.stringify(setting) != '{}' && JSON.stringify(setting) != '{}' &&
setting.add_app_text != null setting.add_app_text != null
" "
:style="{ :style="{
'border-radius': setting.add_app_bg_radius + 'rpx', 'border-radius': setting.add_app_bg_radius + 'rpx',
opacity: setting.add_app_bg_transparency / 100, opacity: setting.add_app_bg_transparency / 100,
top: pagePaddingBottom, top: pagePaddingBottom,
}" }">
> <u-icon name="cross" color="#fff" @click="close"></u-icon>
<u-icon name="cross" color="#fff" @click="close"></u-icon> <view style="width: 1px; height: 20px; margin: 0 10px; background: #fff"></view>
<view <Text style="color: #fff">{{ setting.add_app_text }}</Text>
style="width: 1px; height: 20px; margin: 0 10px; background: #fff" <view class="triangle-up" :style="{ top: pagePaddingBottom }"></view>
></view> </view>
<Text style="color: #fff">{{ setting.add_app_text }}</Text> <coupon v-if="showCoupons" :coupon-message="couponMessage" :cform="ComeFrom" @goLook="goLook" @closeBtn="closeBtn"></coupon>
<view class="triangle-up" :style="{ top: pagePaddingBottom }"></view> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</view> <!-- <official-account></official-account> -->
<coupon <orderPopup v-if="showorder" :orderPopupdata="orderPopupdata" @gosalesvolume="gosalesvolume" @closeBtn="closeBtn_order"></orderPopup>
v-if="showCoupons" </view>
:coupon-message="couponMessage" </view>
:cform="ComeFrom" </view>
@goLook="goLook"
@closeBtn="closeBtn"
></coupon>
<auth
v-if="showAuth"
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
<!-- <official-account></official-account> -->
<orderPopup
v-if="showorder"
:orderPopupdata="orderPopupdata"
@gosalesvolume="gosalesvolume"
@closeBtn="closeBtn_order"
></orderPopup>
</view>
</view>
</view>
</template> </template>
<script> <script>
import tabbar from "@/components/tabbar/index"; import tabbar from "@/components/tabbar/index";
import search from "@/components/search/index"; import search from "@/components/search/index";
import swiper from "@/components/swiper/index"; import swiper from "@/components/swiper/index";
import empty from "@/components/empty/index"; import empty from "@/components/empty/index";
import rubik from "@/components/rubik/index"; import rubik from "@/components/rubik/index";
import goods from "@/components/goods/index"; import goods from "@/components/goods/index";
import notice from "@/components/notice/index"; import notice from "@/components/notice/index";
import gridnav from "@/components/gridnav/index"; import gridnav from "@/components/gridnav/index";
import pagetitle from "@/components/pagetitle/index"; import pagetitle from "@/components/pagetitle/index";
import videopage from "@/components/videopage/index"; import videopage from "@/components/videopage/index";
import copyright from "@/components/copyright/index"; import copyright from "@/components/copyright/index";
import checkin from "@/components/checkin/index"; import checkin from "@/components/checkin/index";
import userbox from "@/components/userbox/index"; import userbox from "@/components/userbox/index";
import userorder from "@/components/userorder/index"; import userorder from "@/components/userorder/index";
import mapi from "@/components/mapi/index"; import mapi from "@/components/mapi/index";
import checkform from "@/components/checkform/index"; import checkform from "@/components/checkform/index";
import addialog from "@/components/addialog/index"; import addialog from "@/components/addialog/index";
import quicknav from "@/components/quicknav/index"; import quicknav from "@/components/quicknav/index";
import coupon from "@/components/coupons/coupons"; import coupon from "@/components/coupons/coupons";
// import pingtuan from "@/components/pingtuan/index"; import shopinfo from "@/components/shopinfo/shopinfo";
import shopinfo from "@/components/shopinfo/shopinfo"; import auth from "@/components/auth/index.vue";
import auth from "@/components/auth/index.vue"; import guide from "@/components/guidecar/index.vue";
import guide from "@/components/guidecar/index.vue"; import rstudy from "@/components/study/Rstudy.vue";
import rstudy from "@/components/study/Rstudy.vue"; import rgoods from "@/components/study/index.vue";
import rgoods from "@/components/study/index.vue"; import argoods from "@/components/studyArticle/index.vue";
import argoods from "@/components/studyArticle/index.vue"; import store from "@/components/store/store.vue";
import store from "@/components/store/store.vue"; import sindex from "@/components/store/index.vue";
import sindex from "@/components/store/index.vue"; import educationteacher from "@/components/educationteacher/index";
import educationteacher from "@/components/educationteacher/index"; import navpage from "@/components/navpage/index";
import navpage from "@/components/navpage/index"; import miaiactivitytype from "@/components/miaiactivitytype/index";
// import matchmaking from "@/components/matchmaking/index" import miaiactivityCustom from "@/components/miaiactivityCustom/index";
import miaiactivitytype from "@/components/miaiactivitytype/index"; import orderPopup from "@/components/coupons/orderPopup.vue"; //离线订单弹窗
import miaiactivityCustom from "@/components/miaiactivityCustom/index"; const innerAudioContext = uni.createInnerAudioContext();
import orderPopup from "@/components/coupons/orderPopup.vue"; //离线订单弹窗 export default {
const innerAudioContext = uni.createInnerAudioContext(); data() {
export default { return {
data() { title: "Hello",
return { myPageData: {},
title: "Hello", indexPageData: {},
myPageData: {}, mainColor: "",
indexPageData: {}, active: 0,
mainColor: "", contentHeight: 0,
active: 0, pageId: 0,
contentHeight: 0, setting: {},
pageId: 0, add_show: 1,
setting: {}, showtabs: true,
add_show: 1, showCoupons: false,
showtabs: true, couponMessage: "",
showCoupons: false, pageTitleStr: "",
couponMessage: "", titleStyle: "",
pageTitleStr: "", pagePaddingBottom: "0px",
titleStyle: "", showBack: false,
pagePaddingBottom: "0px", showAuth: false,
showBack: false, U: {},
showAuth: false, shopData: {},
U: {}, JumpType: 0,
shopData: {}, GoodsId: 29,
JumpType: 0, guidecar: {},
GoodsId: 29, searchData: {}, //传递给search data
guidecar: {}, isNavPosition: 0, //设置搜索框位置
searchData: {}, //传递给search data IsOpenSchool: 0,
isNavPosition: 0, //设置搜索框位置 OrderId: 0,
IsOpenSchool: 0, storePosition: "", //线下服务获取经纬度
OrderId: 0, storeInfo: {},
storePosition: "", //线下服务获取经纬度 fxstoreId: 0, //分享过来的门店id
storeInfo: {}, showStart: false, //是否显示启动页
fxstoreId: 0, //分享过来的门店id startData: {},
showStart: false, //是否显示启动页 ComeFrom: "",
startData: {}, cardsmoney: 0, //储值卡带过来的金额
ComeFrom: "", orderPopupdata: {}, //离线收益的弹窗
cardsmoney: 0, //储值卡带过来的金额 showorder: false, //显示弹出
orderPopupdata: {}, //离线收益的弹窗 carMsg: "", //景点专车分享带过来的字段
showorder: false, //显示弹出 id: 0, //酒店带过来字段
carMsg: "", //景点专车分享带过来的字段 dayObj: "", //酒店带过来字段
id: 0, //酒店带过来字段 searchObj: "", //酒店带过来字段
dayObj: "", //酒店带过来字段 tcid: 0, //线路带过来字段
searchObj: "", //酒店带过来字段 configId: 0, //线路带过来字段
tcid: 0, //线路带过来字段 cityId: 0, //线路带来字段
configId: 0, //线路带过来字段 };
cityId: 0, //线路带来字段 },
}; components: {
}, tabbar,
components: { search,
tabbar, swiper,
search, empty,
swiper, rubik,
empty, goods,
rubik, notice,
goods, gridnav,
notice, pagetitle,
gridnav, videopage,
pagetitle, copyright,
videopage, checkin,
copyright, userbox,
checkin, userorder,
userbox, mapi,
userorder, checkform,
mapi, addialog,
checkform, quicknav,
addialog, coupon,
quicknav, shopinfo,
coupon, auth,
// pingtuan, guide,
shopinfo, rstudy,
auth, rgoods,
guide, argoods,
rstudy, store,
rgoods, sindex,
argoods, educationteacher,
store, navpage,
sindex, miaiactivitytype,
educationteacher, miaiactivityCustom,
navpage, orderPopup,
// matchmaking, },
miaiactivitytype, onLoad(options) {
miaiactivityCustom, let that = this;
orderPopup, uni.getSystemInfo({
}, success(res) {
onLoad(options) { that.titleStyle = {
let that = this; height: "45px",
uni.getSystemInfo({ paddingTop: `${res.statusBarHeight}px`,
success(res) { };
that.titleStyle = { that.pagePaddingBottom = 45 + res.statusBarHeight + "px";
height: "45px", },
paddingTop: `${res.statusBarHeight}px`, });
}; let c = this.$uiConfig.is_bang ? 78 : 50;
that.pagePaddingBottom = 45 + res.statusBarHeight + "px"; this.contentHeight = this.$utils.calcContentHeight(c);
},
}); if(options&&options.lxyType&&options.lxyType==1)
let c = this.$uiConfig.is_bang ? 78 : 50; {
this.contentHeight = this.$utils.calcContentHeight(c); //跳转到视频详情
if (options && options.page_id) { uni.navigateTo({
this.pageId = options.page_id; url: "/pages/video/video?vId=" + options.vId,
let queryString = ""; });
for (var k in options) { }
queryString += `&${k}=${options[k]}`; if (options && options.page_id) {
} this.pageId = options.page_id;
if (queryString != "") { let queryString = "";
queryString = for (var k in options) {
"/pages/index/index?" + queryString.substring(1, queryString.length); queryString += `&${k}=${options[k]}`;
} }
let p = 0; if (queryString != "") {
if (uni.getStorageSync("navs")) { queryString =
uni.getStorageSync("navs").forEach((x) => { "/pages/index/index?" + queryString.substring(1, queryString.length);
if (x.url == queryString) { }
p = 1; let p = 0;
} if (uni.getStorageSync("navs")) {
}); uni.getStorageSync("navs").forEach((x) => {
} if (x.url == queryString) {
if (p == 0) { p = 1;
this.showtabs = false; }
this.contentHeight = this.$utils.calcContentHeight(); });
} }
} if (p == 0) {
let mall_UserInfo = uni.getStorageSync("mall_UserInfo"); this.showtabs = false;
if (options && options.Up) { this.contentHeight = this.$utils.calcContentHeight();
//校园id }
uni.setStorageSync("Up", { }
Up: options.Up, let mall_UserInfo = uni.getStorageSync("mall_UserInfo");
}); if (options && options.Up) {
this.IsOpenSchool = options.Up == 2 ? 1 : 0; //分享进来是否是校园模式 //校园id
} uni.setStorageSync("Up", {
if (options && options.custom_params) { Up: options.Up,
let custom_params = JSON.parse(decodeURIComponent(options.custom_params)); });
console.log(custom_params); this.IsOpenSchool = options.Up == 2 ? 1 : 0; //分享进来是否是校园模式
if (custom_params.user_id) { }
uni.setStorageSync("pid", { if (options && options.custom_params) {
pid: custom_params.user_id, let custom_params = JSON.parse(decodeURIComponent(options.custom_params));
}); if (custom_params.user_id) {
} uni.setStorageSync("pid", {
if (custom_params.Up) { pid: custom_params.user_id,
//校园id });
uni.setStorageSync("Up", { }
Up: custom_params.Up, if (custom_params.Up) {
}); //校园id
this.IsOpenSchool = custom_params.Up == 2 ? 1 : 0; //分享进来是否是校园模式 uni.setStorageSync("Up", {
} Up: custom_params.Up,
} });
if (mall_UserInfo && mall_UserInfo.UserPageType) { this.IsOpenSchool = custom_params.Up == 2 ? 1 : 0; //分享进来是否是校园模式
//进入页面时 判断登录缓存里是否是校园模式 }
this.IsOpenSchool = mall_UserInfo.UserPageType == 2 ? 1 : 0; }
} if (mall_UserInfo && mall_UserInfo.UserPageType) {
if (options && options.user_id) { //进入页面时 判断登录缓存里是否是校园模式
uni.setStorageSync("pid", { this.IsOpenSchool = mall_UserInfo.UserPageType == 2 ? 1 : 0;
pid: options.user_id, }
}); if (options && options.user_id) {
} uni.setStorageSync("pid", {
if (options && options.SmallShopId) { pid: options.user_id,
uni.setStorageSync("SmallShopId", { });
SmallShopId: options.SmallShopId, }
}); if (options && options.SmallShopId) {
} uni.setStorageSync("SmallShopId", {
//从其他小程序跳转过来 SmallShopId: options.SmallShopId,
if (options && options.CounponPassword) { });
//小程序的来自 }
uni.setStorageSync("CounponPassword", { //从其他小程序跳转过来
CounponPassword: options.CounponPassword, if (options && options.CounponPassword) {
}); //小程序的来自
} uni.setStorageSync("CounponPassword", {
CounponPassword: options.CounponPassword,
if (options && options.KeyWord) { });
//口令 }
uni.setStorageSync("KeyWord", {
KeyWord: options.KeyWord,
});
}
if (options && options.ComeFrom) {
//跳过来的文字描述
this.ComeFrom = options.ComeFrom;
uni.setStorageSync("ComeFrom", {
ComeFrom: options.ComeFrom,
});
}
if (options && options.scene) {
//兼容之前小程序的调转
this.getjump(options.scene);
}
if (options && options.storeId) {
this.fxstoreId = options.storeId;
}
if (options && options.carMsg) {
this.carMsg = options.carMsg;
}
// #ifdef MP-WEIXIN
wx.showShareMenu({
withShareTicket: true,
menus: ["shareAppMessage", "shareTimeline"],
});
if (options && options.JumpType) {
//跳转类型 1为详情2为直播列表3为司导
this.JumpType = options.JumpType;
if (options.JumpType == 3) {
this.guidecar.GoodsId = options.GoodsId;
this.guidecar.address = options.address
? JSON.parse(decodeURIComponent(options.address))
: "";
this.guidecar.Pickcar = options.Pickcar
? JSON.parse(decodeURIComponent(options.Pickcar))
: "";
this.guidecar.StartTime = options.StartTime ? options.StartTime : "";
this.guidecar.EndTime = options.EndTime ? options.EndTime : "";
}
}
if (options && options.J) {
//司导分享的的特殊处理
this.JumpType = options.J; if (options && options.KeyWord) {
if (options.J == 3) { //口令
this.guidecar.GoodsId = options.i; uni.setStorageSync("KeyWord", {
this.guidecar.address = options.address KeyWord: options.KeyWord,
? JSON.parse(decodeURIComponent(options.address)) });
: ""; }
this.guidecar.Pickcar = options.P if (options && options.ComeFrom) {
? JSON.parse(decodeURIComponent(options.P)) //跳过来的文字描述
: ""; this.ComeFrom = options.ComeFrom;
this.guidecar.StartTime = options.S ? options.S : ""; uni.setStorageSync("ComeFrom", {
this.guidecar.EndTime = options.E ? options.E : ""; ComeFrom: options.ComeFrom,
} });
if (options && options.u) { }
uni.setStorageSync("pid", { if (options && options.scene) {
pid: options.u, //兼容之前小程序的调转
}); this.getjump(options.scene);
} }
if (options && options.m) { if (options && options.storeId) {
uni.setStorageSync("SmallShopId", { this.fxstoreId = options.storeId;
SmallShopId: options.m, }
}); if (options && options.carMsg) {
} this.carMsg = options.carMsg;
} }
if (options && options.id) { // #ifdef MP-WEIXIN
//商品详情 wx.showShareMenu({
this.GoodsId = options.id; withShareTicket: true,
} else { menus: ["shareAppMessage", "shareTimeline"],
this.GoodsId = options.GoodsId ? options.GoodsId : 29; });
} if (options && options.JumpType) {
if (options && options.money) { //跳转类型 1为详情2为直播列表3为司导
//储值卡 this.JumpType = options.JumpType;
this.cardsmoney = options.money; if (options.JumpType == 3) {
} this.guidecar.GoodsId = options.GoodsId;
this.guidecar.address = options.address ?
JSON.parse(decodeURIComponent(options.address)) :
"";
this.guidecar.Pickcar = options.Pickcar ?
JSON.parse(decodeURIComponent(options.Pickcar)) :
"";
this.guidecar.StartTime = options.StartTime ? options.StartTime : "";
this.guidecar.EndTime = options.EndTime ? options.EndTime : "";
}
}
if (options && options.J) {
//司导分享的的特殊处理
this.JumpType = options.J;
if (options.J == 3) {
this.guidecar.GoodsId = options.i;
this.guidecar.address = options.address ?
JSON.parse(decodeURIComponent(options.address)) :
"";
this.guidecar.Pickcar = options.P ?
JSON.parse(decodeURIComponent(options.P)) :
"";
this.guidecar.StartTime = options.S ? options.S : "";
this.guidecar.EndTime = options.E ? options.E : "";
}
if (options && options.u) {
uni.setStorageSync("pid", {
pid: options.u,
});
}
if (options && options.m) {
uni.setStorageSync("SmallShopId", {
SmallShopId: options.m,
});
}
}
if (options && options.id) {
//商品详情
this.GoodsId = options.id;
} else {
this.GoodsId = options.GoodsId ? options.GoodsId : 29;
}
if (options && options.money) {
//储值卡
this.cardsmoney = options.money;
}
if (options && options.dayObj) { if (options && options.dayObj) {
this.dayObj = options.dayObj; this.dayObj = options.dayObj;
} }
if (options && options.searchObj) { if (options && options.searchObj) {
this.searchObj = options.searchObj; this.searchObj = options.searchObj;
} }
if (options && options.OrderId) { if (options && options.OrderId) {
//代付订单id //代付订单id
this.OrderId = options.OrderId; this.OrderId = options.OrderId;
} }
if (options && options.tcid) { if (options && options.tcid) {
this.tcid = options.tcid; this.tcid = options.tcid;
} }
if (options && options.configId) { if (options && options.configId) {
this.configId = options.configId; this.configId = options.configId;
} }
if (options && options.cityId) { if (options && options.cityId) {
this.cityId = options.cityId; this.cityId = options.cityId;
} }
that.u = uni.getStorageSync("mall_UserInfo"); that.u = uni.getStorageSync("mall_UserInfo");
if (!that.u) { if (!that.u) {
that.u = { that.u = {
nickName: "未登录", nickName: "未登录",
avatarUrl: "", avatarUrl: "",
}; };
that.showAuth = true; that.showAuth = true;
} else { } else {
that.sharejump(); //4-9新加 that.sharejump(); //4-9新加
} }
//4-11这里暂时不能使用
// wx.getUserInfo({//4-9修改 不使用getUserInfo 会造成获取回来的微信默认名称和头像 // #endif
// success: function(res) {//4-9之后的好像这里不能静默登录了需要弹出登录
// console.log(res,'getUserInfo')
// if (uni.getStorageSync("mall_UserInfo")) {
// let uid = uni.getStorageSync("mall_UserInfo").UserId;
// let msg = {
// Id: uid,
// AliasName: res.userInfo.nickName,
// Photo: res.userInfo.avatarUrl,
// };
// that.updateuserinfo(msg);
// that.getPageType()
// // 如果登录的情况下直接跳转商品详情或者直播列表
// // that.sharejump();
// //如果登录状态 并且是uni.getStorageSync("CounponPassword")
// if(uni.getStorageSync("CounponPassword")){
// that.getunilogin(res)
// }
// } else {
// that.getunilogin(res)
// }
// },
// fail: function(e) {
// uni.showToast({
// title: "微信登录授权失败",
// icon: "none"
// });
// }, let set = uni.getStorageSync("basedata") ?
// }); uni.getStorageSync("basedata").mall.setting : {};
if (!uni.getStorageSync("add_top_app")) {
uni.setStorageSync("add_top_app", {
add_top_app_show: 1,
});
}
this.add_show = uni.getStorageSync("add_top_app") ?
uni.getStorageSync("add_top_app").add_top_app_show :
1;
this.setting = set;
this.isShowBack();
// #endif let now = new Date();
let nowtime =
now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate();
if (!uni.getStorageSync("Startup_page")) {
//获取启动页信息1、没有记录日期
this.getstartModel(nowtime);
} else {
//记录日期和当天相差1天调取
let dayc = this.DateDiff(
uni.getStorageSync("Startup_page").time,
nowtime
);
if (dayc >= 1) {
this.getstartModel(nowtime);
}
}
uni.showNavigationBarLoading();
},
created() {},
// #ifdef MP-WEIXIN
onShareTimeline() {
setTimeout(() => {
// console.log("分享调用");
this.getReceive();
}, 2500);
let uid = uni.getStorageSync("mall_UserInfo") ?
uni.getStorageSync("mall_UserInfo").UserId :
0;
if (uid == 0) {
uid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
}
let SmallShopId = uni.getStorageSync("mall_UserInfo") ?
uni.getStorageSync("mall_UserInfo").SmallShopId :
0;
if (SmallShopId == 0) {
//如果微店id为0 去找所属微店id
SmallShopId = uni.getStorageSync("mall_UserInfo") ?
uni.getStorageSync("mall_UserInfo").UserSmallShopId :
0;
}
let title = this.setting.share_title ?
this.setting.share_title :
uni.getStorageSync("basedata").mall.name;
let set = uni.getStorageSync("basedata") let Up = uni.getStorageSync("mall_UserInfo") ?
? uni.getStorageSync("basedata").mall.setting uni.getStorageSync("mall_UserInfo").UserPageType :
: {}; 0;
if (!uni.getStorageSync("add_top_app")) { return {
uni.setStorageSync("add_top_app", { title: title,
add_top_app_show: 1, query: "user_id=" + uid + "&SmallShopId=" + SmallShopId + "&Up=" + Up,
}); imageUrl: "",
} };
this.add_show = uni.getStorageSync("add_top_app") },
? uni.getStorageSync("add_top_app").add_top_app_show onShareAppMessage(res) {
: 1; setTimeout(() => {
this.setting = set; // console.log("分享调用");
this.isShowBack(); this.getReceive();
}, 2500);
let uid = uni.getStorageSync("mall_UserInfo") ?
uni.getStorageSync("mall_UserInfo").UserId :
0;
if (uid == 0) {
uid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
}
let SmallShopId = uni.getStorageSync("mall_UserInfo") ?
uni.getStorageSync("mall_UserInfo").SmallShopId :
0;
if (SmallShopId == 0) {
//如果微店id为0 去找所属微店id
SmallShopId = uni.getStorageSync("mall_UserInfo") ?
uni.getStorageSync("mall_UserInfo").UserSmallShopId :
0;
}
let title = this.setting.share_title ?
this.setting.share_title :
uni.getStorageSync("basedata").mall.name;
// this.init(); let Up = uni.getStorageSync("mall_UserInfo") ?
let now = new Date(); uni.getStorageSync("mall_UserInfo").UserPageType :
let nowtime = 0;
now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate(); return {
// this.getIsOpenReserve();//4-11注释 title: title,
if (!uni.getStorageSync("Startup_page")) { path: "/pages/index/index?user_id=" +
//获取启动页信息1、没有记录日期 uid +
this.getstartModel(nowtime); "&SmallShopId=" +
} else { SmallShopId +
//记录日期和当天相差1天调取 "&Up=" +
let dayc = this.DateDiff( Up,
uni.getStorageSync("Startup_page").time, imageUrl: "",
nowtime };
); },
if (dayc >= 1) { // #endif
this.getstartModel(nowtime); onShow() {
} setTimeout(() => {
} uni.hideNavigationBarLoading();
uni.showNavigationBarLoading(); }, 500);
}, this.mainColor = this.$uiConfig.mainColor;
created() {}, this.getIsOpenReserve();
// #ifdef MP-WEIXIN },
onShareTimeline() {
setTimeout(() => {
// console.log("分享调用");
this.getReceive();
}, 2500);
let uid = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").UserId
: 0;
if (uid == 0) {
uid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
}
let SmallShopId = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").SmallShopId
: 0;
if (SmallShopId == 0) {
//如果微店id为0 去找所属微店id
SmallShopId = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").UserSmallShopId
: 0;
}
let title = this.setting.share_title
? this.setting.share_title
: uni.getStorageSync("basedata").mall.name;
// if (SmallShopId != 0) {
// title = this.shopData.Name
// }
let Up = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").UserPageType
: 0;
return {
title: title,
query: "user_id=" + uid + "&SmallShopId=" + SmallShopId + "&Up=" + Up,
imageUrl: "",
};
},
onShareAppMessage(res) {
setTimeout(() => {
// console.log("分享调用");
this.getReceive();
}, 2500);
let uid = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").UserId
: 0;
if (uid == 0) {
uid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
}
let SmallShopId = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").SmallShopId
: 0;
if (SmallShopId == 0) {
//如果微店id为0 去找所属微店id
SmallShopId = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").UserSmallShopId
: 0;
}
let title = this.setting.share_title
? this.setting.share_title
: uni.getStorageSync("basedata").mall.name;
// if (SmallShopId != 0) {
// title = this.shopData.Name
// }
let Up = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").UserPageType
: 0;
return {
title: title,
path:
"/pages/index/index?user_id=" +
uid +
"&SmallShopId=" +
SmallShopId +
"&Up=" +
Up,
imageUrl: "",
};
},
// #endif
onShow() {
setTimeout(() => {
uni.hideNavigationBarLoading();
}, 500);
this.mainColor = this.$uiConfig.mainColor;
this.getIsOpenReserve();
},
methods: { methods: {
// goOrderDetails(){ getunilogin(res) {
// uni.navigateTo({ let that = this;
// url:"/pages/jiuzhai/jz_SureOrder?orderId=42389" //静默登录操作
// }) uni.login({
// }, provider: "weixin",
getunilogin(res) { success: (info) => {
let that = this; let obj = {
//静默登录操作 Name: res.userInfo.nickName,
uni.login({ Photo: res.userInfo.avatarUrl,
provider: "weixin", code: info.code,
success: (info) => { };
let obj = { that.getCode(obj);
Name: res.userInfo.nickName, },
Photo: res.userInfo.avatarUrl, fail: () => {
code: info.code, uni.showToast({
}; title: "微信登录授权失败",
that.getCode(obj); icon: "none",
}, });
fail: () => { if (!that.u) {
uni.showToast({ that.u = {
title: "微信登录授权失败", nickName: "未登录",
icon: "none", avatarUrl: "",
}); };
if (!that.u) { that.showAuth = true;
that.u = { }
nickName: "未登录", },
avatarUrl: "", });
}; },
that.showAuth = true; //获取IsOpenReserve
} getIsOpenReserve() {
}, this.request2({
}); url: "/api/Mall/GetAppConfig",
}, data: {},
//获取IsOpenReserve },
getIsOpenReserve() { (res) => {
this.request2( uni.setStorageSync("GetAppConfig", res.data); //方便在分类判断
{ if (res.resultCode == 1) {
url: "/api/Mall/GetAppConfig", if (res.data.IsOpenReserve == 1) {
data: {}, this.getstore();
}, } else {
(res) => { this.init();
uni.setStorageSync("GetAppConfig", res.data); //方便在分类判断 }
if (res.resultCode == 1) { } else {
if (res.data.IsOpenReserve == 1) { this.init();
this.getstore(); }
} else { }
this.init(); );
} },
} else { DateDiff(sDate1, sDate2) {
this.init(); var aDate, oDate1, oDate2, iDays;
} aDate = sDate1.split("-");
} oDate1 = new Date(aDate[1] + "-" + aDate[2] + "-" + aDate[0]); //转换为9-25-2017格式
); aDate = sDate2.split("-");
}, oDate2 = new Date(aDate[1] + "-" + aDate[2] + "-" + aDate[0]);
DateDiff(sDate1, sDate2) { iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24); //把相差的毫秒数转换为天数
var aDate, oDate1, oDate2, iDays; return iDays;
aDate = sDate1.split("-"); },
oDate1 = new Date(aDate[1] + "-" + aDate[2] + "-" + aDate[0]); //转换为9-25-2017格式 getstartModel(time) {
aDate = sDate2.split("-"); this.request2({
oDate2 = new Date(aDate[1] + "-" + aDate[2] + "-" + aDate[0]); url: "/api/AppletSchool/GetEducationStartUpModel",
iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24); //把相差的毫秒数转换为天数 data: {},
return iDays; },
}, (res) => {
getstartModel(time) { uni.setStorageSync("Startup_page", {
this.request2( time: time
{ }); //方便在分类判断
url: "/api/AppletSchool/GetEducationStartUpModel", if (res.resultCode == 1) {
data: {}, if (res.data.IsShow == 1) {
}, this.showStart = true;
(res) => { this.startData = res.data;
uni.setStorageSync("Startup_page", { time: time }); //方便在分类判断 innerAudioContext.src = res.data.MusicUrl;
if (res.resultCode == 1) { innerAudioContext.play();
if (res.data.IsShow == 1) { setTimeout(() => {
this.showStart = true; this.showStart = false;
this.startData = res.data; if (innerAudioContext != undefined) {
innerAudioContext.src = res.data.MusicUrl; //判断下不是无法暂停
innerAudioContext.play(); innerAudioContext.stop();
setTimeout(() => { }
this.showStart = false; }, res.data.Seconds * 1000);
if (innerAudioContext != undefined) { }
//判断下不是无法暂停 } else {}
innerAudioContext.stop(); }
} );
}, res.data.Seconds * 1000); },
} startb() {
} else { //跳过启动页
} this.showStart = false;
} if (innerAudioContext != undefined) {
); //判断下不是无法暂停
}, innerAudioContext.stop();
startb() { }
//跳过启动页 },
this.showStart = false; getphonenumber(e) {
if (innerAudioContext != undefined) { console.log(e);
//判断下不是无法暂停 uni.checkSession({
innerAudioContext.stop(); //检查登录状态是否过期
} success: (x) => {
}, if (x.errMsg == "checkSession:ok") {
getphonenumber(e) { //没有过期
console.log(e); console.log("没过期");
uni.checkSession({ }
//检查登录状态是否过期 },
fail: (err) => {
//检测失败重新登录
console.log(err);
},
});
},
//调用获取code
getCode(obj) {
var that = this;
//这里请求接口
that.request2({
url: "/api/mall/GetWeChatOpenId",
data: {
Code: obj.code,
},
},
(res) => {
if (res.resultCode == 1) {
obj.OpenId = res.data;
that.getLogin(obj);
}
}
);
},
getLogin(obj) {
var that = this;
let pid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
let Up = uni.getStorageSync("Up") ? uni.getStorageSync("Up").Up : 0;
let SmallShopId = uni.getStorageSync("SmallShopId") ?
uni.getStorageSync("SmallShopId").SmallShopId :
0;
let CounponPassword = uni.getStorageSync("CounponPassword") ?
uni.getStorageSync("CounponPassword").CounponPassword :
0;
let KeyWord = uni.getStorageSync("KeyWord") ?
uni.getStorageSync("KeyWord").KeyWord :
"";
success: (x) => { that.request2({
if (x.errMsg == "checkSession:ok") { url: "/api/AppletLogin/Login",
//没有过期 data: {
console.log("没过期"); Source: 1,
} OpenId: obj.OpenId,
}, Name: obj.Name,
fail: (err) => { Photo: obj.Photo,
//检测失败重新登录 Moblie: "",
console.log(err); SuperiorId: pid,
}, SmallShopId: SmallShopId,
}); UserPageType: Up,
}, CounponPassword: CounponPassword,
//调用获取code KeyWord: KeyWord,
getCode(obj) { },
var that = this; },
//这里请求接口 (res) => {
that.request2( if (res.resultCode == 1) {
{ uni.setStorageSync("mall_UserInfo", res.data);
url: "/api/mall/GetWeChatOpenId", if (res.couponResultCode == 1) {
data: { that.showCoupons = true;
Code: obj.code, that.couponMessage = res.couponMessage;
}, }
}, that.u = res.data;
(res) => { uni.removeStorageSync("pid");
if (res.resultCode == 1) { uni.removeStorageSync("SmallShopId");
obj.OpenId = res.data; uni.removeStorageSync("Up");
that.getLogin(obj); uni.removeStorageSync("CounponPassword");
} uni.removeStorageSync("KeyWord");
} that.getPageType();
); if (res.data.IsOpenSchool == 1) {
}, //校园开启
getLogin(obj) { that.init();
var that = this; }
let pid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0; // 如果登录的情况下直接跳转商品详情或者直播列表
let Up = uni.getStorageSync("Up") ? uni.getStorageSync("Up").Up : 0; that.sharejump();
let SmallShopId = uni.getStorageSync("SmallShopId") } else {
? uni.getStorageSync("SmallShopId").SmallShopId if (!that.u) {
: 0; that.u = {
let CounponPassword = uni.getStorageSync("CounponPassword") nickName: "未登录",
? uni.getStorageSync("CounponPassword").CounponPassword avatarUrl: "",
: 0; };
let KeyWord = uni.getStorageSync("KeyWord") that.showAuth = true;
? uni.getStorageSync("KeyWord").KeyWord }
: ""; }
}
);
},
getorderPupop() {
let now = new Date();
let Month =
now.getMonth() + 1 < 10 ?
"0" + (now.getMonth() + 1) :
now.getMonth() + 1;
let day = now.getDate() < 10 ? "0" + now.getDate() : now.getDate();
let nowtime =
now.getFullYear() +
"-" +
Month +
"-" +
day +
" " +
now.getHours() +
":" +
now.getMinutes() +
":" +
now.getSeconds();
if (uni.getStorageSync("order_old_time")) {
let oldtime = uni.getStorageSync("order_old_time").time;
if (new Date(nowtime).getTime() != new Date(oldtime).getTime()) {
this.getUserOffline(nowtime, oldtime);
}
}
uni.setStorageSync("order_old_time", {
time: nowtime
}); //吧当前时间存起来
},
getUserOffline(now, old) {
this.request2({
url: "/api/AppletUser/GetUserOfflineEarningsInfo",
data: {
StartTime: old,
EndTime: now,
},
},
(res) => {
this.orderPopupdata = res.data;
if (this.orderPopupdata.State == 1) {
if (this.orderPopupdata.OrderNum > 0) {
this.showorder = true;
}
}
}
);
},
closeBtn_order() {
this.showorder = false;
},
gosalesvolume() {
this.showorder = false;
setTimeout(() => {
let UserId = uni.getStorageSync("mall_UserInfo") ?
uni.getStorageSync("mall_UserInfo").UserId :
0;
uni.navigateTo({
url: "/pages/share-order/share-order",
});
}, 10);
},
sharejump() {
//分享的总跳转
let that = this;
setTimeout(() => {
if (that.JumpType == 1) {
//商品详情
uni.navigateTo({
url: "/pages/goods/goods?GoodsId=" + that.GoodsId,
});
} else if (that.JumpType == 2) {
//直播列表
uni.navigateTo({
url: "/pages/live/index",
});
} else if (that.JumpType == 3) {
//司导详情
that.goguidecar();
} else if (that.JumpType == 4) {
//代付页面
uni.navigateTo({
url: "/pages/order/payment-order?GoodsId=" + that.OrderId,
});
} else if (that.JumpType == 5) {
//课程详情
uni.navigateTo({
url: "/pages/school/courseInfo?GoodsId=" + that.GoodsId,
});
} else if (that.JumpType == 6) {
//课程代付页面
uni.navigateTo({
url: "/pages/school/personal/payment-order?OrderId=" + that.OrderId,
});
} else if (that.JumpType == 7) {
//线下服务门店详情
that.request2( uni.navigateTo({
{ url: "/pages/reserve/storeDetails?id=" + that.GoodsId,
url: "/api/AppletLogin/Login", });
data: { } else if (that.JumpType == 8) {
Source: 1, //服务人员详情
OpenId: obj.OpenId, uni.navigateTo({
Name: obj.Name, url: "/pages/reserve/designerDetail?ID=" +
Photo: obj.Photo, that.GoodsId +
Moblie: "", "&storeId=" +
SuperiorId: pid, that.fxstoreId,
SmallShopId: SmallShopId, });
UserPageType: Up, } else if (that.JumpType == 9) {
CounponPassword: CounponPassword, //线下服务商品
KeyWord: KeyWord, try {
}, uni.setStorageSync("storeId", {
}, storeId: that.fxstoreId
(res) => { });
if (res.resultCode == 1) { } catch (e) {
uni.setStorageSync("mall_UserInfo", res.data); console.log(e);
if (res.couponResultCode == 1) { }
that.showCoupons = true; uni.navigateTo({
that.couponMessage = res.couponMessage; url: "/pages/reserve/goodsDetails?GoodsId=" + that.GoodsId,
} });
that.u = res.data; } else if (that.JumpType == 10) {
uni.removeStorageSync("pid"); //拼拼push活动详情
uni.removeStorageSync("SmallShopId"); uni.navigateTo({
uni.removeStorageSync("Up"); url: "/pages/blindDate/postDetails?Id=" + that.GoodsId,
uni.removeStorageSync("CounponPassword"); });
uni.removeStorageSync("KeyWord"); } else if (that.JumpType == 11) {
that.getPageType(); //用户详情
if (res.data.IsOpenSchool == 1) { uni.navigateTo({
//校园开启 url: "/pages/blindDate/persondetails?UserId=" + that.GoodsId,
that.init(); });
} } else if (that.JumpType == 12) {
// 如果登录的情况下直接跳转商品详情或者直播列表 //储值卡的领取
that.sharejump(); uni.navigateTo({
} else { url: "/pages/coupon/cards/cardsreceive?Id=" +
if (!that.u) { that.GoodsId +
that.u = { "&cardsmoney=" +
nickName: "未登录", that.cardsmoney,
avatarUrl: "", });
}; } else if (that.JumpType == 13) {
that.showAuth = true; //用户资料
} uni.navigateTo({
} url: "/pages/blindDate/persondetails?UserId=" + that.GoodsId,
} });
); } else if (that.JumpType == 14) {
}, //用户资料填写
getorderPupop() { uni.navigateTo({
let now = new Date(); url: "/pages/blindDate/editData"
let Month = });
now.getMonth() + 1 < 10 } else if (that.JumpType == 15) {
? "0" + (now.getMonth() + 1) //门票详情
: now.getMonth() + 1; uni.navigateTo({
let day = now.getDate() < 10 ? "0" + now.getDate() : now.getDate(); url: "/pages/ticketCoupons/detail?id=" + that.GoodsId,
let nowtime = });
now.getFullYear() + } else if (that.JumpType == 16) {
"-" + //餐食详情
Month + uni.navigateTo({
"-" + url: "/pages/restaurant/detail?id=" + that.GoodsId,
day + });
" " + } else if (that.JumpType == 17) {
now.getHours() + //景点专车
":" + uni.navigateTo({
now.getMinutes() + url: "/pages/guidecar/bookaCarList?carMsg=" + that.carMsg,
":" + });
now.getSeconds(); } else if (that.JumpType == 18) {
if (uni.getStorageSync("order_old_time")) { //酒店详情
let oldtime = uni.getStorageSync("order_old_time").time; uni.navigateTo({
if (new Date(nowtime).getTime() != new Date(oldtime).getTime()) { url: "/pages/hotel/detail?id=" +
this.getUserOffline(nowtime, oldtime); that.GoodsId +
} "&dayObj=" +
} that.dayObj +
uni.setStorageSync("order_old_time", { time: nowtime }); //吧当前时间存起来 "&searchObj=" +
}, that.searchObj,
getUserOffline(now, old) { });
this.request2( } else if (that.JumpType == 19) {
{ //线路详情
url: "/api/AppletUser/GetUserOfflineEarningsInfo", uni.navigateTo({
data: { url: "/pages/jiuzhai/jz_LineDetail?tcid=" +
StartTime: old, that.tcid +
EndTime: now, "&configId=" +
}, that.configId +
}, "&cityId=" +
(res) => { that.cityId,
this.orderPopupdata = res.data; });
if (this.orderPopupdata.State == 1) { }
if (this.orderPopupdata.OrderNum > 0) { }, 500);
this.showorder = true; },
} updateuserinfo(msg) {
} this.request2({
} url: "/api/MemberUser/SetMemberPhoto",
); data: msg,
}, },
closeBtn_order() { (res) => {
this.showorder = false; //静默处理不做任何提示
}, },
gosalesvolume() { (error) => {}
this.showorder = false; );
setTimeout(() => { },
let UserId = uni.getStorageSync("mall_UserInfo") goback() {
? uni.getStorageSync("mall_UserInfo").UserId uni.navigateBack({
: 0; delta: 1,
uni.navigateTo({ });
// url: "/pages/share/salesvolume?UserId="+UserId, },
url: "/pages/share-order/share-order", isShowBack() {
}); let navs = uni.getStorageSync("navs") ? uni.getStorageSync("navs") : [];
}, 10); if (navs) {
}, let t = getCurrentPages();
sharejump() { let query = t[t.length - 1].__displayReporter.query;
//分享的总跳转 let queryString = "";
let that = this; for (var k in query) {
setTimeout(() => { queryString += `&${k}=${query[k]}`;
if (that.JumpType == 1) { }
//商品详情 if (queryString != "") {
uni.navigateTo({ queryString = "?" + queryString.substring(1, queryString.length);
url: "/pages/goods/goods?GoodsId=" + that.GoodsId, }
}); let crtPath = "/" + t[t.length - 1].route + queryString;
} else if (that.JumpType == 2) {
//直播列表
uni.navigateTo({
url: "/pages/live/index",
});
} else if (that.JumpType == 3) {
//司导详情
that.goguidecar();
} else if (that.JumpType == 4) {
//代付页面
uni.navigateTo({
url: "/pages/order/payment-order?GoodsId=" + that.OrderId,
});
} else if (that.JumpType == 5) {
//课程详情
uni.navigateTo({
url: "/pages/school/courseInfo?GoodsId=" + that.GoodsId,
});
} else if (that.JumpType == 6) {
//课程代付页面
uni.navigateTo({
url: "/pages/school/personal/payment-order?OrderId=" + that.OrderId,
});
} else if (that.JumpType == 7) {
//线下服务门店详情
uni.navigateTo({ let isExsit = false;
url: "/pages/reserve/storeDetails?id=" + that.GoodsId, navs.forEach((x, i) => {
}); if (x.url == crtPath) {
} else if (that.JumpType == 8) { isExsit = true;
//服务人员详情 }
uni.navigateTo({ });
url: this.showBack = !isExsit;
"/pages/reserve/designerDetail?ID=" + }
that.GoodsId + },
"&storeId=" + getjump(scene) {
that.fxstoreId, let a = "YZnsGuRojCKBkb1siP3VwkhkPFvh-D"; //测试数据
}); this.request({
} else if (that.JumpType == 9) { url: "",
//线下服务商品 data: {
try { r: "api/default/qr-code-parameter",
uni.setStorageSync("storeId", { storeId: that.fxstoreId }); token: scene,
} catch (e) { },
console.log(e); },
} (res) => {
uni.navigateTo({ console.log(res.data.detail.path);
url: "/pages/reserve/goodsDetails?GoodsId=" + that.GoodsId, uni.setStorageSync("pid", {
}); pid: res.data.detail.user_id ? res.data.detail.user_id : 0,
} else if (that.JumpType == 10) { }); //存储上级的id
//拼拼push活动详情 let objurl = this.ObjectToUrl(res.data.detail.data);
uni.navigateTo({ uni.navigateTo({
url: "/pages/blindDate/postDetails?Id=" + that.GoodsId, url: "/" + res.data.detail.path + "?" + objurl,
}); });
} else if (that.JumpType == 11) { }
//用户详情 );
uni.navigateTo({ },
url: "/pages/blindDate/persondetails?UserId=" + that.GoodsId, ObjectToUrl(e, t) {
}); var n = "";
} else if (that.JumpType == 12) { for (var i in e)
//储值卡的领取 n += "&" + i + "=" + (t ? encodeURIComponent(e[i]) : e[i]);
uni.navigateTo({ return n.substr(1);
url: },
"/pages/coupon/cards/cardsreceive?Id=" + init() {
that.GoodsId + let mall_IsOpenSchool = uni.getStorageSync("mall_UserInfo") ?
"&cardsmoney=" + uni.getStorageSync("mall_UserInfo").IsOpenSchool :
that.cardsmoney, 0;
}); let open_school = 0;
} else if (that.JumpType == 13) {
//用户资料
uni.navigateTo({
url: "/pages/blindDate/persondetails?UserId=" + that.GoodsId,
});
} else if (that.JumpType == 14) {
//用户资料填写
uni.navigateTo({ url: "/pages/blindDate/editData" });
} else if (that.JumpType == 15) {
//门票详情
uni.navigateTo({
url: "/pages/ticketCoupons/detail?id=" + that.GoodsId,
});
} else if (that.JumpType == 16) {
//餐食详情
uni.navigateTo({
url: "/pages/restaurant/detail?id=" + that.GoodsId,
});
} else if (that.JumpType == 17) {
//景点专车
uni.navigateTo({
url: "/pages/guidecar/bookaCarList?carMsg=" + that.carMsg,
});
} else if (that.JumpType == 18) {
//酒店详情
uni.navigateTo({
url:
"/pages/hotel/detail?id=" +
that.GoodsId +
"&dayObj=" +
that.dayObj +
"&searchObj=" +
that.searchObj,
});
} else if (that.JumpType == 19) {
//线路详情
uni.navigateTo({
url:
"/pages/jiuzhai/jz_LineDetail?tcid=" +
that.tcid +
"&configId=" +
that.configId +
"&cityId=" +
that.cityId,
});
}
}, 500);
},
updateuserinfo(msg) {
this.request2(
{
url: "/api/MemberUser/SetMemberPhoto",
data: msg,
},
(res) => {
//静默处理不做任何提示
},
(error) => {}
);
},
goback() {
uni.navigateBack({
delta: 1,
});
},
isShowBack() {
let navs = uni.getStorageSync("navs") ? uni.getStorageSync("navs") : [];
if (navs) {
let t = getCurrentPages();
let query = t[t.length - 1].__displayReporter.query; if (this.IsOpenSchool == 1 && mall_IsOpenSchool == 1) {
let queryString = ""; //this.IsOpenSchool 通过分享进来的 是否是校园 1 是0不是 mall_IsOpenSchool缓存获取校园模式开启没有
for (var k in query) { open_school = 1;
queryString += `&${k}=${query[k]}`; } else {
} open_school = 0;
if (queryString != "") { }
queryString = "?" + queryString.substring(1, queryString.length); let storeId =
} uni.getStorageSync("storeId") && uni.getStorageSync("storeId").storeId ?
let crtPath = "/" + t[t.length - 1].route + queryString; uni.getStorageSync("storeId").storeId :
0;
this.request2({
url: "/api/Mall/GetHome",
data: {
page_id: this.pageId,
open_school: open_school,
StoreId: storeId,
},
},
(res) => {
// this.$uiConfig.mainColor = res.data.mall.setting.mallStyle.main
// this.$uiConfig.secondary = res.data.mall.setting.mallStyle.secondary
if (res.data.mall.setting.mallStyle.pricecolor) {
this.$uiConfig.pricecolor =
res.data.mall.setting.mallStyle.pricecolor;
}
this.indexPageData = res.data.home_pages.navs[0].template.data;
this.myPageData = res.data;
if (res.data.navbar.navs) {
uni.setStorageSync("navs", res.data.navbar.navs);
}
uni.setStorageSync("basedata", res.data);
let isExsit = false; if (Object.keys(this.$refs).length > 0 && this.$refs.study) {
navs.forEach((x, i) => { //判断
if (x.url == crtPath) { this.$refs.study[0].getData(); //调取最近学习组件的方法
isExsit = true; }
} if (
}); this.myPageData.home_pages.navs.length > 0 &&
this.showBack = !isExsit; this.myPageData.home_pages.navs[0].template.data.length > 0
} ) {
}, this.myPageData.home_pages.navs[0].template.data.forEach((x) => {
getjump(scene) { if (x.id == "search") {
let a = "YZnsGuRojCKBkb1siP3VwkhkPFvh-D"; //测试数据 this.searchData = x.data;
this.request( this.isNavPosition = x.data.searchPosition;
{ if (this.isNavPosition == 1) {
url: "", this.searchData.top = -5;
data: { this.searchData.left = 10;
r: "api/default/qr-code-parameter", }
token: scene, } else if (x.id == "shop-info") {
}, this.getSmallShopById();
}, } else if (x.id == "miaiuser") {
(res) => { //4-29新加 相亲模式随机的时候调用接口
console.log(res.data.detail.path); if (x.data.addUserType == 4) {
uni.setStorageSync("pid", { this.request2({
pid: res.data.detail.user_id ? res.data.detail.user_id : 0, url: "/api/AppletMiai/GetDailyRandomList",
}); //存储上级的id data: {
let objurl = this.ObjectToUrl(res.data.detail.data); pageIndex: 1,
uni.navigateTo({ pageSize: x.data.goodsLength,
url: "/" + res.data.detail.path + "?" + objurl, Sex: 0,
}); },
} },
); (Daily) => {
}, if (Daily.resultCode == 1) {
ObjectToUrl(e, t) { x.data.list = Daily.data.pageData;
var n = ""; }
for (var i in e) }
n += "&" + i + "=" + (t ? encodeURIComponent(e[i]) : e[i]); );
return n.substr(1); }
}, }
init() { });
let mall_IsOpenSchool = uni.getStorageSync("mall_UserInfo") }
? uni.getStorageSync("mall_UserInfo").IsOpenSchool
: 0;
let open_school = 0;
if (this.IsOpenSchool == 1 && mall_IsOpenSchool == 1) { if (res.data.home_pages.title != "") {
//this.IsOpenSchool 通过分享进来的 是否是校园 1 是0不是 mall_IsOpenSchool缓存获取校园模式开启没有 if (this.pageId == 0) {
open_school = 1; uni.setNavigationBarTitle({
} else { title: res.data.home_pages.title,
open_school = 0; });
} if (!this.shopData.Name || this.shopData.Name == "") {
let storeId = this.pageTitleStr = res.data.home_pages.title;
uni.getStorageSync("storeId") && uni.getStorageSync("storeId").storeId }
? uni.getStorageSync("storeId").storeId } else {
: 0; uni.setNavigationBarTitle({
this.request2( title: res.data.home_pages.navs[0].name,
{ });
url: "/api/Mall/GetHome", if (!this.shopData.Name || this.shopData.Name == "") {
data: { this.pageTitleStr = res.data.home_pages.navs[0].name;
page_id: this.pageId, }
open_school: open_school, }
StoreId: storeId,
},
},
(res) => {
// this.$uiConfig.mainColor = res.data.mall.setting.mallStyle.main
// this.$uiConfig.secondary = res.data.mall.setting.mallStyle.secondary
if (res.data.mall.setting.mallStyle.pricecolor) {
this.$uiConfig.pricecolor =
res.data.mall.setting.mallStyle.pricecolor;
}
this.indexPageData = res.data.home_pages.navs[0].template.data;
this.myPageData = res.data;
if (res.data.navbar.navs) {
uni.setStorageSync("navs", res.data.navbar.navs);
}
uni.setStorageSync("basedata", res.data);
if (Object.keys(this.$refs).length > 0 && this.$refs.study) { // uni.setNavigationBarColor({
//判断 // //字体颜色
this.$refs.study[0].getData(); //调取最近学习组件的方法 // frontColor: res.data.navbar.top_text_color,
} // //背景颜色
if ( // backgroundColor: res.data.navbar.top_background_color,
this.myPageData.home_pages.navs.length > 0 && // });
this.myPageData.home_pages.navs[0].template.data.length > 0 this.titleStyle.color = res.data.navbar.top_text_color;
) { this.titleStyle.backgroundColor =
this.myPageData.home_pages.navs[0].template.data.forEach((x) => { res.data.navbar.top_background_color;
if (x.id == "search") {
this.searchData = x.data;
this.isNavPosition = x.data.searchPosition;
if (this.isNavPosition == 1) {
this.searchData.top = -5;
this.searchData.left = 10;
}
} else if (x.id == "shop-info") {
this.getSmallShopById();
} else if (x.id == "miaiuser") {
//4-29新加 相亲模式随机的时候调用接口
if (x.data.addUserType == 4) {
this.request2(
{
url: "/api/AppletMiai/GetDailyRandomList",
data: {
pageIndex: 1,
pageSize: x.data.goodsLength,
Sex: 0,
},
},
(Daily) => {
if (Daily.resultCode == 1) {
x.data.list = Daily.data.pageData;
}
}
);
}
}
});
}
if (res.data.home_pages.title != "") { this.isShowBack();
if (this.pageId == 0) { }
uni.setNavigationBarTitle({ this.formatBg();
title: res.data.home_pages.title, if (
}); this.u &&
if (!this.shopData.Name || this.shopData.Name == "") { res.data.user_info &&
this.pageTitleStr = res.data.home_pages.title; res.data.user_info.openOfflineEarnings == 1
} ) {
} else { //判断是否登录 是否开启 进行离线收益的弹出
uni.setNavigationBarTitle({ this.getorderPupop(); //4-9号新加
title: res.data.home_pages.navs[0].name, }
}); },
if (!this.shopData.Name || this.shopData.Name == "") { (error) => {}
this.pageTitleStr = res.data.home_pages.navs[0].name; );
} },
} getstore() {
let that = this;
uni.getLocation({
type: "wgs84",
success: function(res) {
let position = res.latitude + "," + res.longitude;
uni.setStorageSync("position", {
position: position,
});
that.getCurrentStore();
},
fail: function(err) {
that.getCurrentStore();
},
});
},
getCurrentStore() {
let storeId =
uni.getStorageSync("storeId") && uni.getStorageSync("storeId").storeId ?
uni.getStorageSync("storeId").storeId :
0;
let position =
uni.getStorageSync("position") &&
uni.getStorageSync("position").position ?
uni.getStorageSync("position").position :
"";
// uni.setNavigationBarColor({ this.request2({
// //字体颜色 url: "/api/AppletStores/GetCurrentStore",
// frontColor: res.data.navbar.top_text_color, data: {
// //背景颜色 storeId: storeId,
// backgroundColor: res.data.navbar.top_background_color, position: position,
// }); },
this.titleStyle.color = res.data.navbar.top_text_color; },
this.titleStyle.backgroundColor = (res) => {
res.data.navbar.top_background_color; if (res.data && res.data.storeInfo) {
this.storeInfo = res.data.storeInfo;
this.isShowBack(); uni.setStorageSync("storeId", {
} storeId: res.data.storeInfo.storeId,
this.formatBg(); });
if ( if (res.data.storeInfo.storeId && res.data.storeInfo.storeId > 0) {
this.u && setTimeout((x) => {
res.data.user_info && this.init();
res.data.user_info.openOfflineEarnings == 1 }, 1000);
) { }
//判断是否登录 是否开启 进行离线收益的弹出 }
this.getorderPupop(); //4-9号新加 }
} );
}, },
(error) => {} getSmallShopById() {
); let Id = uni.getStorageSync("mall_UserInfo") ?
}, uni.getStorageSync("mall_UserInfo").SmallShopId :
getstore() { 0;
let that = this; if (Id == 0) {
uni.getLocation({ Id = uni.getStorageSync("mall_UserInfo") ?
type: "wgs84", uni.getStorageSync("mall_UserInfo").UserSmallShopId :
success: function (res) { 0;
let position = res.latitude + "," + res.longitude; }
uni.setStorageSync("position", { this.request2({
position: position, url: "/api/AppletUser/GetSmallShopById",
}); data: {
that.getCurrentStore(); Id: Id,
}, },
fail: function (err) { },
that.getCurrentStore(); (res) => {
}, if (res.resultCode == 1) {
}); this.shopData = res.data;
}, if (this.shopData.Name && this.shopData.Name != "") {
getCurrentStore() { this.pageTitleStr = this.shopData.Name;
let storeId = }
uni.getStorageSync("storeId") && uni.getStorageSync("storeId").storeId }
? uni.getStorageSync("storeId").storeId }
: 0; );
let position = },
uni.getStorageSync("position") && close() {
uni.getStorageSync("position").position this.add_show = 2;
? uni.getStorageSync("position").position uni.setStorageSync("add_top_app", {
: ""; add_top_app_show: 2,
});
this.request2( },
{ changeHandler(i) {
url: "/api/AppletStores/GetCurrentStore", this.active = i;
data: { },
storeId: storeId, formatBg() {
position: position, this.myPageData.home_pages.navs.forEach((y) => {
}, y.template.data.forEach((x) => {
}, if (x.id == "background") {
(res) => { let t = "";
if (res.data && res.data.storeInfo) { y.templateBg = {};
this.storeInfo = res.data.storeInfo; if (x.data.showImg) {
uni.setStorageSync("storeId", { y.templateBg.backgroundColor = x.data.backgroundColor;
storeId: res.data.storeInfo.storeId, y.templateBg.backgroundImage = `url('${x.data.backgroundPicUrl}')`;
}); y.templateBg.backgroundPosition = x.data.positionText;
if (res.data.storeInfo.storeId && res.data.storeInfo.storeId > 0) { y.templateBg.backgroundRepeat = x.data.repeatText ?
setTimeout((x) => { x.data.repeatText :
this.init(); "no-repeat";
}, 1000); y.templateBg.backgroundSize =
} `${
}
}
);
},
getSmallShopById() {
let Id = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").SmallShopId
: 0;
if (Id == 0) {
Id = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").UserSmallShopId
: 0;
}
this.request2(
{
url: "/api/AppletUser/GetSmallShopById",
data: {
Id: Id,
},
},
(res) => {
if (res.resultCode == 1) {
this.shopData = res.data;
if (this.shopData.Name && this.shopData.Name != "") {
this.pageTitleStr = this.shopData.Name;
}
}
}
);
},
close() {
this.add_show = 2;
uni.setStorageSync("add_top_app", {
add_top_app_show: 2,
});
},
changeHandler(i) {
this.active = i;
},
formatBg() {
this.myPageData.home_pages.navs.forEach((y) => {
y.template.data.forEach((x) => {
if (x.id == "background") {
let t = "";
y.templateBg = {};
if (x.data.showImg) {
y.templateBg.backgroundColor = x.data.backgroundColor;
y.templateBg.backgroundImage = `url('${x.data.backgroundPicUrl}')`;
y.templateBg.backgroundPosition = x.data.positionText;
y.templateBg.backgroundRepeat = x.data.repeatText
? x.data.repeatText
: "no-repeat";
y.templateBg.backgroundSize = `${
x.data.backgroundWidth == 0 x.data.backgroundWidth == 0
? "auto" ? "auto"
: x.data.backgroundWidth + "%" : x.data.backgroundWidth + "%"
...@@ -1394,265 +1208,205 @@ export default { ...@@ -1394,265 +1208,205 @@ export default {
? "auto" ? "auto"
: x.data.backgroundHeight + "%" : x.data.backgroundHeight + "%"
}`; }`;
} else { } else {
y.templateBg.background = x.data.backgroundColor; y.templateBg.background = x.data.backgroundColor;
y.templateBg.titleColor = "#000 !important"; y.templateBg.titleColor = "#000 !important";
} }
if (this.myPageData.home_pages.navs.length > 1) { if (this.myPageData.home_pages.navs.length > 1) {
y.templateBg.overflowY = "auto"; y.templateBg.overflowY = "auto";
y.templateBg.height = this.contentHeight + "px"; y.templateBg.height = this.contentHeight + "px";
} else { } else {
y.templateBg.overflowY = "auto"; y.templateBg.overflowY = "auto";
y.templateBg.height = this.contentHeight + 40 + "px"; y.templateBg.height = this.contentHeight + 40 + "px";
} }
if (x.data.titleColor) { if (x.data.titleColor) {
y.templateBg.titleColor = x.data.titleColor + " !important"; y.templateBg.titleColor = x.data.titleColor + " !important";
} }
// y.templateBg +="padding-bottom:"+(this.$uiConfig.is_bang ? '88px' : '60px')+";box-sizing: border-box;"; }
} });
}); if (!y.templateBg) {
if (!y.templateBg) { y.templateBg = {
y.templateBg = { titleColor: "#000",
titleColor: "#000", };
}; }
} });
}); },
// this.myPageData.home_pages.navs[0].template.data.push({ getReceive() {
// id: "pintuan", //分享进入调取领券接口
// permission_key: "pintuan", // 1-分享,2-购买并付款
// data: { this.request2({
// buttonColor: "#ff4544", url: "/api/AppletUser/ShareCoupon",
// list: [ data: {
// { TriggerType: 1,
// id: 179402, },
// name: },
// "日本POLA宝丽黑BA限定小礼盒(黑ba水20ml +黑ba乳液15ml +黑ba面霜5g +黑ba唇颊膏2g)", (res) => {
// picUrl: console.log(res, "res");
// "https://cdnimg.iotweixin.com/uploads/mall1285/20200506/904171cab7db2201f6f35c0ca5bb0a93.png", if (res.couponResultCode == 1) {
// price: "388.00", this.couponMessage = res.couponMessage;
// peopleNum: 2, this.showCoupons = true;
// pintuanPrice: "348.00", }
// }, }
// { );
// id: 178355, },
// name: goLook() {
// "日本珂润(Curel)润浸保湿 滋养乳霜 40g 敏感肌专用 神经酰胺护理 抵抗外部刺激", this.showCoupons = false;
// picUrl: },
// "https://cdnimg.iotweixin.com/uploads/mall1285/20200503/979653726a7bc1df0e24464f94b404bd.jpg", closeBtn() {
// price: "180.00", this.showCoupons = false;
// peopleNum: 2, },
// pintuanPrice: "180.00", reloadUserinfo() {
// }, this.u = uni.getStorageSync("mall_UserInfo");
// { if (this.$refs.son) {
// id: 178352, this.$refs.son[0].getSmallShopById(2); //第一次登陆成功后去调取微店的信息
// name: "500g 干羊肚菌 干货 煲汤菌 菌中之王 包邮", }
// picUrl: this.getPageType(); //获取用户类型(校园)
// "https://cdnimg.iotweixin.com/uploads/mall1285/20200311/358dd9acf5dafd3cab2c05be3354400c.png", let IsOpenMiAi = uni.getStorageSync("basedata") ?
// price: "780.00", uni.getStorageSync("basedata").mall.setting.is_show_miai :
// peopleNum: 3, 0; //是否开启相亲模式 5-13新加
// pintuanPrice: "680.00", if (this.u.IsOpenSchool == 1 || IsOpenMiAi == 1) {
// }, this.init();
// ], }
// listStyle: 1, // 如果登录的情况下直接跳转商品详情或者直播列表
// textStyle: 1, this.sharejump();
// fill: 1, },
// goodsCoverProportion: "1-1", getPageType() {
// goodsStyle: 1, this.request2({
// showGoodsName: true, url: "/api/AppletUser/GetAppletUserPageType",
// showBuyBtn: true, data: {},
// buyBtnStyle: 1, },
// buyBtnText: "去拼团", (res) => {
// showGoodsTag: false, let mall_UserInfo = uni.getStorageSync("mall_UserInfo") ?
// customizeGoodsTag: false, uni.getStorageSync("mall_UserInfo") : {};
// goodsTagPicUrl: "", mall_UserInfo.IsOpenSchool = res.data.IsOpenSchool;
// showImg: false, mall_UserInfo.UserPageType = res.data.UserPageType;
// backgroundColor: "#fff", uni.setStorageSync("mall_UserInfo", mall_UserInfo);
// backgroundPicUrl: "", if (this.IsOpenSchool == 1 && res.data.UserPageType != 2) {
// position: 5, //这种情况是自己注册过 但是 通过分享进来的判断
// mode: 1, this.IsOpenSchool = 0;
// backgroundHeight: 100, this.init();
// backgroundWidth: 100, }
// borderBackground: "#ffffff", }
// }, );
// }); },
}, //关闭登录窗口
getReceive() { gbAuth() {
//分享进入调取领券接口 this.showAuth = false;
// 1-分享,2-购买并付款 },
this.request2( goguidecar() {
{ uni.navigateTo({
url: "/api/AppletUser/ShareCoupon", url: "/pages/guidecar/guidecarGoodsdetails?GoodsId=" +
data: { this.guidecar.GoodsId +
TriggerType: 1, "&address=" +
}, this.guidecar.address +
}, "&Pickcar=" +
(res) => { this.guidecar.Pickcar +
console.log(res, "res"); "&StartTime=" +
if (res.couponResultCode == 1) { this.guidecar.StartTime +
this.couponMessage = res.couponMessage; "&EndTime=" +
this.showCoupons = true; this.guidecar.EndTime,
} });
} },
); getPickcar(Name) {
}, //选择取消地址
goLook() { this.$refs.city[0].getPickcar(Name);
this.showCoupons = false; },
},
closeBtn() {
this.showCoupons = false;
},
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
if (this.$refs.son) {
this.$refs.son[0].getSmallShopById(2); //第一次登陆成功后去调取微店的信息
}
this.getPageType(); //获取用户类型(校园)
let IsOpenMiAi = uni.getStorageSync("basedata")
? uni.getStorageSync("basedata").mall.setting.is_show_miai
: 0; //是否开启相亲模式 5-13新加
if (this.u.IsOpenSchool == 1 || IsOpenMiAi == 1) {
this.init();
}
// 如果登录的情况下直接跳转商品详情或者直播列表
this.sharejump();
},
getPageType() {
this.request2(
{
url: "/api/AppletUser/GetAppletUserPageType",
data: {},
},
(res) => {
let mall_UserInfo = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo")
: {};
mall_UserInfo.IsOpenSchool = res.data.IsOpenSchool;
mall_UserInfo.UserPageType = res.data.UserPageType;
uni.setStorageSync("mall_UserInfo", mall_UserInfo);
if (this.IsOpenSchool == 1 && res.data.UserPageType != 2) {
//这种情况是自己注册过 但是 通过分享进来的判断
this.IsOpenSchool = 0;
this.init();
}
}
);
},
//关闭登录窗口
gbAuth() {
this.showAuth = false;
},
goguidecar() {
uni.navigateTo({
url:
"/pages/guidecar/guidecarGoodsdetails?GoodsId=" +
this.guidecar.GoodsId +
"&address=" +
this.guidecar.address +
"&Pickcar=" +
this.guidecar.Pickcar +
"&StartTime=" +
this.guidecar.StartTime +
"&EndTime=" +
this.guidecar.EndTime,
});
},
getPickcar(Name) {
//选择取消地址
this.$refs.city[0].getPickcar(Name);
},
yj() { yj() {
// let obj ={ArriveCityId: 7, // let obj ={ArriveCityId: 7,
// ArriveCityName: "九寨沟", // ArriveCityName: "九寨沟",
// ArriveCityType: 2, // ArriveCityType: 2,
// Q_Date: "2021-5-25", // Q_Date: "2021-5-25",
// StartCityId: 262, // StartCityId: 262,
// StartCityName: "成都", // StartCityName: "成都",
// StartCityType: 1} // StartCityType: 1}
// obj = encodeURIComponent(JSON.stringify(obj)) // obj = encodeURIComponent(JSON.stringify(obj))
// uni.navigateTo({ // uni.navigateTo({
// url: '/pages/guidecar/bookaCarList?carMsg='+obj // url: '/pages/guidecar/bookaCarList?carMsg='+obj
// }) // })
uni.navigateTo({ uni.navigateTo({
url: "/pages/jiuzhai/jz_Line", url: "/pages/jiuzhai/jz_Line",
// url: '/pages/blindDate/personal/IDidentification' // url: '/pages/blindDate/personal/IDidentification'
}); });
}, },
}, },
}; };
</script> </script>
<style> <style>
.content { .content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
overflow-x: hidden; overflow-x: hidden;
/* align-items: center; /* align-items: center;
justify-content: center; */ justify-content: center; */
} }
.content .tips_t { .content .tips_t {
position: fixed; position: fixed;
right: 6px; right: 6px;
height: 36px; height: 36px;
background: #000000; background: #000000;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
padding: 0 10px; padding: 0 10px;
font-size: 12px; font-size: 12px;
margin-top: 10px; margin-top: 10px;
z-index: 9999999; z-index: 9999999;
} }
.triangle-up { .triangle-up {
width: 0; width: 0;
height: 0; height: 0;
border-left: 10px solid transparent; border-left: 10px solid transparent;
border-right: 10px solid transparent; border-right: 10px solid transparent;
border-bottom: 12px solid black; border-bottom: 12px solid black;
position: fixed; position: fixed;
right: 65px; right: 65px;
} }
.index-title { .index-title {
line-height: 45px !important; line-height: 45px !important;
font-size: 16px; font-size: 16px;
text-align: center; text-align: center;
position: fixed; position: fixed;
left: 0; left: 0;
top: 0; top: 0;
width: 100%; width: 100%;
color: #fff; color: #fff;
box-sizing: content-box; box-sizing: content-box;
z-index: 5; z-index: 5;
} }
.back-arrow { .back-arrow {
position: absolute; position: absolute;
left: 5px; left: 5px;
bottom: 12.5px; bottom: 12.5px;
} }
.Startbtn {
position: absolute; .Startbtn {
top: 10px; position: absolute;
right: 15px; top: 10px;
width: 50px; right: 15px;
height: 20px; width: 50px;
background: rgba(45, 45, 45, 0.5); height: 20px;
border-radius: 4px; background: rgba(45, 45, 45, 0.5);
display: flex; border-radius: 4px;
align-items: center; display: flex;
justify-content: center; align-items: center;
color: #fff; justify-content: center;
} color: #fff;
.MainTopLeft { }
text-align: left !important;
padding-left: 10px; .MainTopLeft {
} text-align: left !important;
/* .logo { padding-left: 10px;
}
/* .logo {
height: 200rpx; height: 200rpx;
width: 200rpx; width: 200rpx;
margin-top: 200rpx; margin-top: 200rpx;
...@@ -1670,9 +1424,10 @@ export default { ...@@ -1670,9 +1424,10 @@ export default {
font-size: 36rpx; font-size: 36rpx;
color: #8f8f94; color: #8f8f94;
} */ } */
/* #ifdef MP-ALIPAY */ /* #ifdef MP-ALIPAY */
.indexpage{ .indexpage {
padding-bottom: 100rpx; padding-bottom: 100rpx;
} }
/* #endif */
/* #endif */
</style> </style>
<style> <style>
.nvideo_Page { .nvideo_Page {
width: 100%; width: 100%;
height: 100%; height: 98%;
} }
</style> </style>
<template> <template>
<view class="nvideo_Page"> <view class="nvideo_Page">
<view> <view class="container">
<playerVideo :videoUrl="videoUrl" :videoName="videoName" :videoCoverImg="videoCoverImg" :vWidth="vWidth" :vHeight="vHeight"></playerVideo> <!--播放按钮-->
<image v-if="!isPlay" class="play-img" @click="videoPlayed" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/v_pause.png"
mode=""></image>
<view class="videoTitle">{{videoName}}</view>
<video :show-center-play-btn="false" class="video-view" id="myVideo" ref="myVideo" :src="videoUrl" :poster="videoCoverImg"
:controls="controls" :show-loading="true" @timeupdate="handleTimeUpdate" @loadedmetadata="loadedmetadata"
@fullscreenchange="fullscreenchange" @play="playChange" @pause="pauseChange" @ended="ended" :autoplay="false">
<view class="videoControlsContainer flex justify-center">
<image v-if="!isPlay" class="play-icon" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/v_pause.png"
@click="videoPlayed" mode="aspectFill"></image>
<image v-else class="pause-icon" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/v_start.png"
@click="videoPause" mode="aspectFill"></image>
<view class="slideBox">
<!--slider自定义播放控件-->
<slider @changing="sliderDown" style="margin: 0;" :value="value" @change="sliderChange" activeColor="#FFFFFF"
backgroundColor="rgba(245, 245, 245, 0.45)" block-color="#F5F5F5" :block-size="14" />
</view>
<!--播放时间-->
<p class="custdownTime">{{computedTime(nowPlayTime)}}</p>
</view>
</video>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import playerVideo from "./components/player-video.vue"; //离线订单弹窗
export default { export default {
data() { data() {
return { return {
videoName: "", //视频名称 videoName: "", //视频名称
videoUrl: "", //视频地址 videoUrl: "", //视频地址
videoCoverImg: "", //封面图 videoCoverImg: "", //封面图
vid: "", //视频Id vid: "", //视频Id
vWidth: "", //视频宽 vWidth: "", //视频宽
vHeight: "", //视频高 vHeight: "", //视频高
videoPlay: 0,
videoContext: null,
videoDuration: 0, //总播放时长
isPlay: false, //判断是否播放
nowPlayTime: 0, //当前播放时间
value: 0, //当前滑块的值
controls: false, //是否隐藏默认控制器
isEnd: false, //播放是否结束
sliderAble: true,
isSliderIng: false
} }
}, },
components: { components: {
playerVideo
}, },
onReady() { onReady() {
}, },
onLoad(option) { onLoad(option) {
console.log("option", option); if (option && option.vId) {
if (option && option.vid) { this.vid = option.vId;
this.vid = option.vid;
this.getVideoInfo(); this.getVideoInfo();
} }
wx.showShareMenu({
withShareTicket: true,
menus: ["shareAppMessage", "shareTimeline"],
});
}, },
methods: { methods: {
getVideoInfo() { getVideoInfo() {
...@@ -83,8 +105,107 @@ ...@@ -83,8 +105,107 @@
url: "/pages/index/index" url: "/pages/index/index"
}); });
}, },
/**
* 播放
*/
videoPlayed() {
this.videoContext.play()
},
/**
* 暂停
*/
videoPause() {
this.videoContext.pause()
},
/**
* 滑块进行拖动进度播放
*/
sliderChange(e) {
this.isSliderIng = false
const t = e.detail.value / 100
this.videoContext.seek(t * this.videoDuration);
this.nowPlayTime = t * this.videoDuration
console.log(t * this.videoDuration);
},
/**
* 播放后触发方法,获得播放总时长
*/
handleTimeUpdate(e) {
// 设置滑块位置
if (!this.isEnd && !this.isSliderIng) {
this.value = this.nowPlayTime / this.videoDuration * 100
}
// 设置当前时间
this.nowPlayTime = e.detail.currentTime
// 首次获取到duration时存储它
if (this.videoDuration === 0 && e.detail.duration > 0) {
this.videoDuration = e.detail.duration;
}
},
/**
* 初始化获得视频总时长
*/
loadedmetadata(e) {
this.nowPlayTime = e.detail.duration
},
computedTime(minutesAndSeconds) {
let totalSeconds = Math.floor(minutesAndSeconds) * 60 + Math.round((minutesAndSeconds % 1) * 60);
let hours = Math.floor(totalSeconds / 3600);
let minutes = Math.floor((totalSeconds % 3600) / 60);
hours = hours.toString().padStart(2, '0');
minutes = minutes.toString().padStart(2, '0');
return `${hours}:${minutes}`;
},
/**
* 监听是否为全屏,默认控制器是否显示
*/
fullscreenchange(e) {
if (e.detail.fullScreen) {
this.controls = true
} else {
this.controls = false
}
},
/**
* 监听是否播放
*/
playChange() {
this.isPlay = true
this.isEnd = false
this.sliderAble = false
},
/**
* 监听是否暂停
*/
pauseChange() {
this.isPlay = false
this.sliderAble = true
},
/**
* 是否播放完毕
*/
ended(e) {
this.isEnd = true
this.isPlay = false
this.value = 0
this.videoContext.seek(0);
this.videoContext.pause();
},
/**
* 滑块滑动期间
*/
sliderDown(e) {
this.isSliderIng = true
const t = e.detail.value / 100
this.videoContext.seek(t * this.videoDuration);
this.nowPlayTime = t * this.videoDuration
}
},
mounted() {
this.videoContext = uni.createVideoContext('myVideo', this);
this.videoContext.stop();
}, },
mounted() {},
created() { created() {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "视频分享" title: "视频分享"
...@@ -92,3 +213,73 @@ ...@@ -92,3 +213,73 @@
}, },
} }
</script> </script>
<style>
.container {
position: absolute;
}
.videoTitle {
width: 100%;
height: 200rpx;
position: absolute;
top: 10rpx;
left: 20rpx;
font-size: 25rpx;
color: white;
z-index: 1;
}
.play-img {
width: 114rpx;
height: 114rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -62%);
z-index: 2;
}
.video-view {
width: 100vw;
height: 100vh;
}
.videoControlsContainer {
position: fixed;
left: 50%;
bottom: 60rpx;
transform: translateX(-50%);
display: flex;
justify-content: space-between;
align-items: center;
width: 704rpx;
height: 88rpx;
border-radius: 20rpx;
/* background: rgba(255, 255, 255, 0.5); */
/* backdrop-filter: blur(20rpx); */
padding: 0 31rpx;
box-sizing: border-box;
}
.play-icon {
padding-top: 4rpx;
width: 57rpx;
height: 57rpx;
}
.pause-icon {
padding-top: 4rpx;
width: 57rpx;
height: 57rpx;
}
.custdownTime {
font-size: 22rpx;
font-weight: normal;
color: white;
}
.slideBox {
width: 481rpx;
}
</style>
...@@ -27,8 +27,7 @@ export default { ...@@ -27,8 +27,7 @@ export default {
Vue.prototype.host3 = "http://192.168.5.46" Vue.prototype.host3 = "http://192.168.5.46"
Vue.prototype.host2 = "https://erpmallapi.oytour.com" Vue.prototype.host2 = "https://erpmallapi.oytour.com"
Vue.prototype.host3 = "https://reborn.oytour.com" Vue.prototype.host3 = "https://reborn.oytour.com"
Vue.prototype.request = function(param, success, failed) { Vue.prototype.request = function(param, success, failed) {
//网络请求 //网络请求
uni.request({ uni.request({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment