东风启辰小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 19KB

5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. //index.js
  2. //获取应用实例
  3. const app = getApp()
  4. Page({
  5. data: {
  6. imgUrl: app.globalData.urlStatic,//图片路径
  7. phoneInputShow:false,//是否显示电话输入框
  8. siteSelect: false,//是否显示位置选择框
  9. provinceArr:[],//省
  10. provinceValue: 0,//选中的省下标
  11. storeArr:[],//店铺
  12. storeValue:0,//选中的店铺下标
  13. swiperCurrent:0,//swiper选中的元素下标
  14. verificationCode: '获取验证码',//验证码文案
  15. sendCode: true,
  16. appointment:true,
  17. subscribeData: {
  18. realname:"",//姓名
  19. mobile:"",//手机号
  20. captcha:"",//验证码
  21. province:"",//省份
  22. agent_code: "",//经销商编码
  23. agentDetail: "",//经销商详细信息
  24. parentOpenid: app.globalData.parentOpenid,//好友openid
  25. },
  26. startAdvertisingUrl:'',//开屏广告路径
  27. isStartAdvertising: 1,//开屏广告透明度
  28. isStartAdvertisingShow: true,//是否显示开屏广告
  29. // isRegister:false,//查询是否已注册
  30. bannerList:[],//banner列表
  31. videoList:[],//视频列表
  32. videoVideoControls:false,//是否显示视频控件
  33. mainShow:false,
  34. isOnce:false,
  35. userData:null,
  36. kvurl: null,//顶部大图
  37. kvurlH:0,
  38. showAppointment:false,
  39. placing:false,//是否显示下定按钮
  40. buyState:false,//下订状态
  41. isStartAdvertisingFunState:false,
  42. playBtnDeg:0,
  43. videoShow: false,
  44. yuyueShow: false,
  45. swiperGroup:{
  46. one:{
  47. nums:4,
  48. current:0
  49. },
  50. two: {
  51. nums: 4,
  52. current: 0
  53. },
  54. three: {
  55. nums: 7,
  56. current: 0
  57. },
  58. four: {
  59. nums: 2,
  60. current: 0
  61. }
  62. },
  63. showMaskNum:0,//要显示的弹窗
  64. addressShow:false,
  65. isAddress:false,//是否有地址
  66. drawNum:0,//可用抽奖次数
  67. },
  68. onLoad: function (options) {
  69. if (app.globalData.isFirstLogin) {
  70. // console.log("第一次进入");
  71. wx.reportAnalytics('event_source_launch', {
  72. source: options.source ? options.source :0
  73. });
  74. }
  75. app.globalData.nowPage = 1;
  76. if (app.globalData.isFirstLogin) {
  77. this.getStartAdvertising();
  78. }else{
  79. if (app.globalData.openid) {
  80. this.loadFun();
  81. } else {
  82. app.globalData.openidSuccessFuc = this.loadFun;
  83. }
  84. }
  85. },
  86. loadFun: function () {
  87. if(app.globalData.luckyTokenList && app.globalData.luckyTokenList.length){
  88. this.setData({
  89. drawNum:app.globalData.luckyTokenList.length
  90. })
  91. }
  92. if (!app.globalData.addPageEnterState.index) {
  93. app.addPageEnter("2AF7D5B88BBFF4159C8079E963E72C9B");
  94. app.globalData.addPageEnterState.index = true;
  95. }
  96. this.setData({
  97. kvurl: app.globalData.kvurl,
  98. kvurlH: app.globalData.kvurlH
  99. })
  100. if (app.globalData.userInfoData) {
  101. this.setData({
  102. userData: app.globalData.userInfoData
  103. })
  104. }
  105. if (app.globalData.userMobile) {
  106. this.data.subscribeData.mobile = app.globalData.userMobile;
  107. this.setData({
  108. phoneInputShow: true,
  109. subscribeData: this.data.subscribeData
  110. })
  111. }
  112. if (app.globalData.isFirstLogin) {
  113. this.getHomeVideo();//获取视频
  114. } else {
  115. if (app.globalData.indexData.videoList) {
  116. this.setData({
  117. videoList: app.globalData.indexData.videoList
  118. })
  119. } else {
  120. this.getHomeVideo();//获取视频
  121. }
  122. }
  123. this.setData({
  124. mainShow: true,
  125. isStartAdvertisingShow: this.data.isOnce ? true : app.globalData.isFirstLogin,
  126. // isRegister: app.globalData.isRegister
  127. })
  128. this.getFirstMsg();
  129. },
  130. onShow:function () {
  131. if(app.globalData.luckyTokenList && app.globalData.luckyTokenList.length){
  132. this.setData({
  133. drawNum:app.globalData.luckyTokenList.length
  134. })
  135. }else{
  136. this.setData({
  137. drawNum: 0
  138. })
  139. }
  140. if (app.globalData.getBuyState) {
  141. this.getBuyStates();
  142. } else {
  143. app.globalData.buyStateSuccessFuc = this.getBuyStates;
  144. }
  145. this.setData({
  146. siteSelect: false
  147. })
  148. this.data.subscribeData.parentOpenid = app.globalData.parentOpenid;
  149. },
  150. getBuyStates:function(){
  151. this.setData({
  152. buyState: app.globalData.getBuyState.success
  153. })
  154. },
  155. provinceChane: function (e) {//选中省
  156. this.setData({
  157. provinceValue: e.detail.value,
  158. storeArr: this.data.provinceArr[e.detail.value].children,
  159. storeValue:0
  160. })
  161. this.data.subscribeData.province = this.data.provinceArr[this.data.provinceValue].province;
  162. this.data.subscribeData.agentDetail = this.data.storeArr[this.data.storeValue].agent_detail;
  163. this.data.subscribeData.agent_code = this.data.storeArr[this.data.storeValue].agent_code;
  164. },
  165. storeChane: function (e) {//选中店铺
  166. this.setData({
  167. storeValue: e.detail.value,
  168. })
  169. this.data.subscribeData.agentDetail = this.data.storeArr[this.data.storeValue].agent_detail;
  170. this.data.subscribeData.agent_code = this.data.storeArr[this.data.storeValue].agent_code;
  171. },
  172. getUserPhone:function(e){//获取用户手机号
  173. this.setData({
  174. phoneInputShow: true
  175. })
  176. // if (!app.globalData.indexData.provinceArr) {
  177. // this.getUserLocation();//获取用户当前位置
  178. // }
  179. if (e.detail.errMsg=='getPhoneNumber:ok'){
  180. app.getMobile(e.detail.encryptedData, e.detail.iv,res=>{
  181. if (res.code == 200) {
  182. if (res.data && res.data.decodeData){
  183. this.data.subscribeData.mobile = res.data.decodeData.phoneNumber;
  184. this.setData({
  185. subscribeData: this.data.subscribeData
  186. })
  187. }
  188. } else {
  189. wx.showToast({
  190. title: res.msg,
  191. icon: "none"
  192. })
  193. }
  194. },this);
  195. }
  196. },
  197. getUserLocation:function(e){
  198. wx.getLocation({
  199. type: 'gcj02', //
  200. success:(res)=>{
  201. // console.log(res);
  202. this.getDistributorList(res.longitude, res.latitude);
  203. },
  204. fail:(res)=>{
  205. this.getDistributorList("", "");
  206. },
  207. complete:(res)=>{
  208. this.setData({
  209. siteSelect: true,
  210. })
  211. }
  212. })
  213. },
  214. prevImg(){//上一张图片
  215. if (this.data.swiperCurrent>0) {
  216. this.setData({
  217. swiperCurrent: this.data.swiperCurrent-=1,
  218. })
  219. }
  220. },
  221. nextImg() {//下一张图片
  222. if (this.data.swiperCurrent < this.data.bannerList.length-1) {
  223. this.setData({
  224. swiperCurrent: this.data.swiperCurrent+=1,
  225. })
  226. }
  227. },
  228. // swiperChange(e){//通过鼠标滑动改变swiper时
  229. // this.setData({
  230. // swiperCurrent: e.detail.current,
  231. // })
  232. // },
  233. getDistributorList: function (longitude, latitude){//获取经销商列表
  234. app.wxRequest(app.globalData.urlRoot + "agent/getAgentList", { longitude: longitude, latitude: latitude}, res => {
  235. if (res.code == 200) {
  236. this.setData({
  237. provinceArr: res.data.list,
  238. storeArr: res.data.list[res.data.nearData.provinceIndex].children,
  239. provinceValue: res.data.nearData.provinceIndex,
  240. storeValue: res.data.nearData.cityIndex
  241. })
  242. this.data.subscribeData.province = this.data.provinceArr[this.data.provinceValue].province;
  243. this.data.subscribeData.agentDetail = this.data.storeArr[this.data.storeValue].agent_detail;
  244. this.data.subscribeData.agent_code = this.data.storeArr[this.data.storeValue].agent_code;
  245. app.globalData.indexData.provinceArr = res.data.list;
  246. app.globalData.indexData.storeArr = res.data.list[res.data.nearData.provinceIndex].children;
  247. app.globalData.indexData.provinceValue = res.data.nearData.provinceIndex;
  248. app.globalData.indexData.storeValue = res.data.nearData.cityIndex;
  249. } else {
  250. wx.showToast({
  251. title: res.msg,
  252. icon: "none"
  253. })
  254. }
  255. }, this);
  256. },
  257. getCode: function (e) {//获取验证码
  258. if (!app.mobileVerify(this.data.subscribeData.mobile)) {
  259. if (this.data.subscribeData.mobile){
  260. wx.showToast({
  261. title: '请输入正确的电话',
  262. icon: 'none'
  263. })
  264. }else{
  265. wx.showToast({
  266. title: '请输入电话',
  267. icon: 'none'
  268. })
  269. }
  270. return;
  271. }
  272. if (!this.data.sendCode){
  273. return;
  274. }
  275. this.data.sendCode = false;
  276. app.wxRequest(app.globalData.urlRoot + "captcha/sendCaptcha", { mobile: this.data.subscribeData.mobile }, res => {
  277. if (res.code == 200) {
  278. this.countDown();
  279. wx.showToast({
  280. title: '验证码获取成功',
  281. icon: "none"
  282. })
  283. this.setData({
  284. verificationCode:60
  285. })
  286. } else {
  287. this.data.sendCode = true;
  288. wx.showToast({
  289. title: res.msg,
  290. icon: "none"
  291. })
  292. }
  293. },this)
  294. },
  295. countDown: function () {//倒计时
  296. setTimeout(() => {
  297. this.setData({
  298. verificationCode: this.data.verificationCode - 1
  299. })
  300. if (this.data.verificationCode > 0) {
  301. this.countDown();
  302. } else {
  303. this.setData({
  304. verificationCode: "获取验证码"
  305. })
  306. this.data.sendCode = true;
  307. }
  308. }, 1000);
  309. },
  310. getRealname: function (e) {//获取用户输入的姓名
  311. this.data.subscribeData.realname = e.detail.value;
  312. },
  313. getMobile: function (e) {//获取用户输入的电话
  314. this.data.subscribeData.mobile = e.detail.value;
  315. },
  316. getCaptcha: function (e) {//获取用户输入的验证码
  317. this.data.subscribeData.captcha = e.detail.value;
  318. },
  319. subscribeFun: function (e) {//预约鉴赏
  320. if (!this.data.subscribeData.realname) {
  321. wx.showToast({
  322. title: '请输入姓名',
  323. icon: "none"
  324. })
  325. return;
  326. }
  327. if (!this.data.subscribeData.mobile) {
  328. wx.showToast({
  329. title: '请输入电话',
  330. icon: "none"
  331. })
  332. return;
  333. }
  334. if (!this.data.subscribeData.captcha) {
  335. wx.showToast({
  336. title: '请输入验证码',
  337. icon: "none"
  338. })
  339. return;
  340. }
  341. if (!this.data.appointment) {
  342. return;
  343. }
  344. this.data.appointment = false;
  345. app.wxRequest(app.globalData.urlRoot + "userInfo/submitOrderInfo", this.data.subscribeData, res => {
  346. this.data.appointment = true;
  347. if (res.code == 200) {
  348. wx.showToast({
  349. title: '预约成功'
  350. })
  351. this.data.subscribeData.realname = "";
  352. this.data.subscribeData.captcha = "";
  353. this.setData({
  354. subscribeData: this.data.subscribeData,
  355. verificationCode: '获取验证码',
  356. })
  357. this.setData({
  358. siteSelect: false
  359. })
  360. // this.setData({
  361. // isRegister:true
  362. // })
  363. // app.globalData.isRegister = true;
  364. app.globalData.userMobile = this.data.subscribeData.mobile;
  365. // wx.redirectTo({
  366. // url: "../myCenter/myCenter?sourcePage='home'"
  367. // })
  368. } else {
  369. wx.showToast({
  370. title: res.msg,
  371. icon: "none"
  372. })
  373. }
  374. }, this, "POST")
  375. },
  376. getStartAdvertising: function () {//获取开屏广告
  377. app.wxRequest(app.globalData.urlRoot + "home/getStartAdvertising", {}, res => {
  378. this.data.isOnce = true;
  379. if(res.code==200){
  380. this.setData({
  381. startAdvertisingUrl: res.data.picurl,
  382. mainShow:true,
  383. kvurl: res.data.kvurl
  384. })
  385. app.globalData.kvurl = res.data.kvurl;
  386. app.globalData.isFirstLogin = false;
  387. setTimeout(() => {
  388. this.isStartAdvertisingFun();
  389. }, 1000);
  390. }
  391. if (app.globalData.openid) {
  392. this.loadFun();
  393. } else {
  394. app.globalData.openidSuccessFuc = this.loadFun;
  395. }
  396. },this);
  397. },
  398. isStartAdvertisingFun:function(){
  399. if (this.data.isStartAdvertisingFunState){
  400. return;
  401. }
  402. this.data.isStartAdvertisingFunState = true;
  403. setTimeout(() => {
  404. const query = wx.createSelectorQuery()
  405. query.select('.kvurlImg').boundingClientRect()
  406. query.selectViewport().scrollOffset()
  407. query.exec((res) => {
  408. if (res.data && res.data[0]) {
  409. this.setData({
  410. kvurlH: res.data[0].height
  411. })
  412. app.globalData.kvurlH = res.data[0].height;
  413. }
  414. })
  415. }, 200)
  416. this.setData({
  417. isStartAdvertising: 0
  418. })
  419. setTimeout(() => {
  420. this.setData({
  421. isStartAdvertisingShow: false,
  422. })
  423. }, 1000);
  424. },
  425. getHomeBanner: function () {//获取banner
  426. app.wxRequest(app.globalData.urlRoot + "home/getHomeBanner", {}, res => {
  427. if (res.code == 200) {
  428. this.setData({
  429. bannerList:res.data
  430. })
  431. app.globalData.indexData.bannerList = res.data;
  432. }
  433. }, this);
  434. },
  435. getHomeVideo: function () {//获取视频
  436. app.wxRequest(app.globalData.urlRoot + "home/getHomeVideo", {}, res => {
  437. if (res.code == 200) {
  438. this.setData({
  439. videoList:res.data[0]
  440. })
  441. app.globalData.indexData.videoList = res.data[0];
  442. }
  443. }, this);
  444. },
  445. hideVideoControls: function () {//显示视频控件
  446. wx.createVideoContext("video").play();
  447. this.setData({
  448. videoVideoControls:true
  449. })
  450. },
  451. getOrderInfo: function () {//查询是否已注册
  452. app.wxRequest(app.globalData.urlRoot + "userInfo/getOrderInfo", {}, res => {
  453. if (res.code == 200) {
  454. if (res.data) {
  455. // this.setData({
  456. // isRegister: true
  457. // })
  458. // app.globalData.isRegister = true;
  459. app.globalData.userMobile = res.data.mobile;
  460. }else{
  461. if (app.globalData.userMobile) {
  462. this.data.subscribeData.mobile = app.globalData.userMobile;
  463. this.setData({
  464. phoneInputShow:true,
  465. subscribeData: this.data.subscribeData
  466. })
  467. }
  468. }
  469. } else {
  470. console.log(res.msg)
  471. }
  472. }, this);
  473. },
  474. /**
  475. * 用户点击右上角分享
  476. */
  477. onShareAppMessage: function () {
  478. return app.sharePack();
  479. },
  480. getUserWxMsg:function(e){
  481. if (e.detail.errMsg == "getUserInfo:ok") {
  482. this.setData({
  483. userData: e.detail.userInfo
  484. })
  485. app.submitUserMsg(e.detail.userInfo.avatarUrl, e.detail.userInfo.nickName);
  486. }
  487. },
  488. showSite: function () {//显示地址选择框
  489. if (!this.data.siteSelect) {
  490. if (!app.globalData.indexData.provinceArr) {
  491. this.getUserLocation();//获取用户当前位置
  492. }else{
  493. this.setData({
  494. siteSelect:true
  495. })
  496. }
  497. }
  498. },
  499. lookMore: function () {
  500. wx.navigateTo({
  501. url: '/pages/moreType/moreType',
  502. })
  503. },
  504. vrLookCar: function () {
  505. wx.navigateTo({
  506. url: '/pages/vrLookCar/vrLookCar',
  507. })
  508. },
  509. compute: function () {
  510. wx.navigateTo({
  511. url: '/pages/compute/compute',
  512. })
  513. },
  514. lookConfigure: function () {
  515. wx.navigateTo({
  516. url: '/pages/configure/configure',
  517. })
  518. },
  519. openAppointment:function(){//预约
  520. this.setData({
  521. showAppointment: !this.data.showAppointment
  522. })
  523. },
  524. placingControl:function(){
  525. // if (app.globalData.getBuyState.success != this.data.buyState){
  526. // this.setData({
  527. // buyState: app.globalData.getBuyState.success
  528. // })
  529. // }
  530. if (this.data.buyState && !this.data.placing){
  531. wx.navigateTo({
  532. url: '/pages/rotaryDraw/rotaryDraw',
  533. })
  534. }else{
  535. this.setData({
  536. placing: !this.data.placing
  537. })
  538. }
  539. },
  540. swiperChange:function(e){
  541. var num = e.currentTarget.dataset.num;
  542. if(num==1){
  543. this.data.swiperGroup.one.current = e.detail.current;
  544. } else if (num == 2) {
  545. this.data.swiperGroup.two.current = e.detail.current;
  546. } else if (num == 3) {
  547. this.data.swiperGroup.three.current = e.detail.current;
  548. } else if (num == 4) {
  549. this.data.swiperGroup.four.current = e.detail.current;
  550. }
  551. this.setData({
  552. swiperGroup: this.data.swiperGroup
  553. })
  554. },
  555. leftSlide:function(e){
  556. var num = e.currentTarget.dataset.num;
  557. if (num == 1 && this.data.swiperGroup.one.current>0) {
  558. this.data.swiperGroup.one.current-=1;
  559. } else if (num == 2 && this.data.swiperGroup.two.current > 0) {
  560. this.data.swiperGroup.two.current -= 1;
  561. } else if (num == 3 && this.data.swiperGroup.three.current > 0) {
  562. this.data.swiperGroup.three.current -= 1;
  563. } else if (num == 4 && this.data.swiperGroup.four.current > 0) {
  564. this.data.swiperGroup.four.current -= 1;
  565. }
  566. this.setData({
  567. swiperGroup: this.data.swiperGroup
  568. })
  569. },
  570. rightSlide: function (e) {
  571. var num = e.currentTarget.dataset.num;
  572. if (num == 1 && this.data.swiperGroup.one.current < this.data.swiperGroup.one.nums-1) {
  573. this.data.swiperGroup.one.current += 1;
  574. } else if (num == 2 && this.data.swiperGroup.two.current < this.data.swiperGroup.two.nums - 1) {
  575. this.data.swiperGroup.two.current += 1;
  576. } else if (num == 3 && this.data.swiperGroup.three.current < this.data.swiperGroup.three.nums - 1) {
  577. this.data.swiperGroup.three.current += 1;
  578. } else if (num == 4 && this.data.swiperGroup.four.current < this.data.swiperGroup.four.nums - 1) {
  579. this.data.swiperGroup.four.current += 1;
  580. }
  581. this.setData({
  582. swiperGroup: this.data.swiperGroup
  583. })
  584. },
  585. playVideo:function(){
  586. var animation = wx.createAnimation({
  587. duration: 300
  588. });
  589. animation.rotate(360).step();
  590. this.setData({
  591. playBtnDeg: animation.export()
  592. })
  593. setTimeout(()=>{
  594. this.setData({
  595. videoShow:true
  596. })
  597. var videoContext = wx.createVideoContext("myVideo");
  598. videoContext.requestFullScreen({ direction:0});
  599. videoContext.play();
  600. animation.rotate(0).step();
  601. this.setData({
  602. playBtnDeg: animation.export()
  603. })
  604. },300);
  605. },
  606. closeFull:function(e){
  607. if (!e.detail.fullScreen) {
  608. this.setData({
  609. videoShow: false
  610. })
  611. }
  612. },
  613. openYuyue: function () {//预约
  614. this.setData({
  615. yuyueShow: !this.data.yuyueShow
  616. })
  617. },
  618. getFirstMsg(){
  619. app.wxRequest(app.globalData.urlRoot + "msg/getFirstMsg", {}, res => {
  620. if(res.code == 200){
  621. if(res.data.msgId){
  622. this.getAddress();
  623. }
  624. this.setData({
  625. showMaskNum:res.data.msgId
  626. })
  627. }
  628. },this)
  629. },
  630. hiddenMask: function () {
  631. this.setData({
  632. showMaskNum: 0
  633. })
  634. },
  635. addressControl: function () {//跳转到地址管理
  636. this.setData({
  637. addressShow: !this.data.addressShow
  638. })
  639. this.hiddenMask();
  640. // if (this.data.addressShow) {
  641. // app.globalData.skipType = 'mycenter';
  642. // }
  643. },
  644. getAddress: function () {//获取地址
  645. app.wxRequest(app.globalData.urlRoot + "address/getAddressV2", {}, res => {
  646. if (res.code == 200) {
  647. if (res.data) {
  648. this.setData({
  649. isAddress:true
  650. })
  651. }
  652. }
  653. }, this)
  654. }
  655. })