index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. <template>
  2. <view class="container">
  3. <!--header-->
  4. <!-- #ifdef MP-WEIXIN || APP-PLUS -->
  5. <view class="tui-header-box" :style="pagebase.base ? pagebase.base.titleBackground.bgstyle : ''">
  6. <view :style="{ height: height + 'px' }">
  7. <view class="tui-header"
  8. :style="{ 'color': pagebase.base ? pagebase.base.titleTextColor : '', paddingTop: top + 'px' }">
  9. <text v-if="config.sys_title">{{ config.sys_title }}</text>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="topheight" :style="{ height: height + 'px' }">.</view>
  14. <!-- #endif -->
  15. <!--header-->
  16. <Pengpai-FadeInOut v-if="config.is_broadcast == 1" :top="198" :loop="true" :info="item"
  17. v-for="(item, index) in list" :key="index">
  18. </Pengpai-FadeInOut>
  19. <view>
  20. <view class="diybox" :style="pagebase.base ? pagebase.base.bgstyle : ''">
  21. <view v-if="configtuanzhang.tuanzhang_open==1 && housingName"
  22. :style="pagebase.base ? pagebase.base.titleBackground.bgstyle : ''">
  23. <view @tap="onChangehousingestate" class="housingestate"
  24. :style="{ 'color': pagebase.base ? pagebase.base.titleTextColor : ''}">
  25. {{ housingName }} 站长:{{tuanzhangName}}
  26. <tui-icon name="arrowright" color="#fff" :size="30" unit="rpx">
  27. </tui-icon>
  28. </view>
  29. </view>
  30. <block v-for="(diyitem, itemindex) in modulelist" :key="itemindex">
  31. <!-- banner -->
  32. <block v-if="diyitem.type === 'banner'">
  33. <view class="bannerbox" :style="diyitem.base.bgstyle">
  34. <view class="tui-banner-bg"
  35. :style="{ height: bannerHeight[itemindex].swiperHeight + 'px' }">
  36. <!--banner-->
  37. <view class="tui-banner-box">
  38. <swiper :style="{ height: bannerHeight[itemindex].swiperHeight + 'px' }"
  39. :indicator-dots="true" :autoplay="true" :interval="5000" :duration="150"
  40. class="tui-banner-swiper" :circular="true"
  41. indicator-color="rgba(255, 255, 255, 0.8)" indicator-active-color="#fff">
  42. <swiper-item v-for="(banner, index) in diyitem.list" :key="index">
  43. <image @tap="navigateTo" :data-url="banner.link" :src="banner.img"
  44. class="tui-slide-image" mode="widthFix" :data-itemindex="itemindex"
  45. @load="setswiperHeight" />
  46. </swiper-item>
  47. </swiper>
  48. </view>
  49. </view>
  50. <view class="bannerbottom"></view>
  51. </view>
  52. </block>
  53. <search v-if="diyitem.type === 'search'" :diyitem="diyitem" :cityName="cityName" :opacity="opacity"
  54. @onChangePosition="onSelectoperatingcity" />
  55. <!-- 导航组 -->
  56. <navbar v-if="diyitem.type === 'navBar'" :diyitem="diyitem" />
  57. <!-- 单图组 -->
  58. <imagesingle v-if="diyitem.type === 'imageSingle'" :diyitem="diyitem" />
  59. <!-- 多图组 -->
  60. <duo v-if="diyitem.type === 'duo'" :diyitem="diyitem" />
  61. <!-- 图片橱窗 -->
  62. <window v-if="diyitem.type === 'window'" :diyitem="diyitem" />
  63. <!-- 图文组 -->
  64. <tuwen v-if="diyitem.type === 'tuwen'" :diyitem="diyitem" />
  65. <!-- 视频组 -->
  66. <diyvideo v-if="diyitem.type === 'video'" :diyitem="diyitem" />
  67. <!-- 公告组 -->
  68. <notice v-if="diyitem.type === 'notice'" :diyitem="diyitem" />
  69. <!-- 空白组 -->
  70. <blank v-if="diyitem.type === 'blank'" :diyitem="diyitem" />
  71. <!-- 辅助线 -->
  72. <guide v-if="diyitem.type === 'guide'" :diyitem="diyitem" />
  73. <!-- 富文本 -->
  74. <richtext v-if="diyitem.type === 'richText'" :diyitem="diyitem" />
  75. <!--秒杀-->
  76. <miaosha v-if="diyitem.type === 'miaosha'" :diyitem="diyitem" :pagestyleconfig="pagestyleconfig" />
  77. <!--购物卡-->
  78. <goodscard v-if="diyitem.type === 'goodscard'" :diyitem="diyitem"
  79. :pagestyleconfig="pagestyleconfig" />
  80. <!--超值拼团-->
  81. <tuan v-if="diyitem.type === 'tuan'" :diyitem="diyitem" :pagestyleconfig="pagestyleconfig" />
  82. <!-- 商品组 -->
  83. <goods v-if="diyitem.type === 'goods'" :diyitem="diyitem" :pagestyleconfig="pagestyleconfig" />
  84. <!-- 师傅组 -->
  85. <technical v-if="diyitem.type === 'technical'" :diyitem="diyitem" />
  86. <!-- 商家组 -->
  87. <store v-if="diyitem.type === 'store'" :diyitem="diyitem" />
  88. <!-- 优惠券组 -->
  89. <coupon v-if="diyitem.type === 'coupon'" :diyitem="diyitem" :itemindex="itemindex"
  90. @receiveTap="receiveTap" />
  91. <!--排行榜-->
  92. <block v-if="diyitem.type === 'ranking'">
  93. <view class="tui-product-box">
  94. <view class="tui-block__box" :style="diyitem.base.bgstyle">
  95. <view class="tui-group-name" @tap="more">
  96. <view>
  97. <text>排行榜</text>
  98. <text class="tui-sub__desc">大家都在买</text>
  99. </view>
  100. <view class="tui-more__box">
  101. <text>更多</text>
  102. <tui-icon name="arrowright" :size="36" unit="rpx" color="#999"></tui-icon>
  103. </view>
  104. </view>
  105. <view class="tui-new-box">
  106. <view class="tui-new-item" :class="[index != 0 && index != 1 ? 'tui-new-mtop' : '']"
  107. v-for="(item, index) in newProduct" :key="index" @tap="detail">
  108. <image
  109. :src="'/static/images/mall/new/' + (item.type == 1 ? 'new' : 'discount') + '.png'"
  110. class="tui-new-label" v-if="item.isLabel"></image>
  111. <view class="tui-title-box">
  112. <view class="tui-new-title">{{ item.name }}</view>
  113. <view class="tui-new-price">
  114. <text class="tui-new-present">¥{{ item.present }}</text>
  115. <text class="tui-new-original">¥{{ item.original }}</text>
  116. </view>
  117. </view>
  118. <image :src="'/static/images/mall/new/' + item.pic" class="tui-new-img"></image>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </block>
  124. </block>
  125. </view>
  126. </view>
  127. <!--加载loadding-->
  128. <tui-loadmore v-if="loadding" :index="3" type="red"></tui-loadmore>
  129. <!-- <tui-nomore v-if="!pullUpOn"></tui-nomore> -->
  130. <!--加载loadding-->
  131. <view @tap="tokefuTel">
  132. <view class="img-tel-style zindex100 yc"></view>
  133. <image class="img-tel-style" src="/static/images/kefutel.png"></image>
  134. </view>
  135. <view>
  136. <!-- #ifdef MP-WEIXIN -->
  137. <button v-if="configkefu.minionline == 1 || configkefu.minionline == 3" @click="toim"
  138. class="img-plus-style zindex100 yc aaa"></button>
  139. <button v-else-if="configkefu.minionline == 2" @click="toimwebview(configkefu.kefuurl)"
  140. class="img-plus-style zindex100 yc aaa"></button>
  141. <button v-else open-type="contact" class="img-plus-style zindex100 yc"></button>
  142. <!-- #endif -->
  143. <!-- #ifndef MP-WEIXIN -->
  144. <button v-if="configkefu.minionline == 1 || configkefu.minionline == 2 || configkefu.minionline == 3"
  145. @click="toim" class="img-plus-style zindex100 yc aaa"></button>
  146. <!-- #endif -->
  147. <image src="/static/images/kefulink.png" class="img-plus-style"></image>
  148. </view>
  149. <tui-modal custom :show="modalShow" backgroundColor="transparent" padding="0" @cancel="hideModal">
  150. <view class="tui-poster__box" :style="{ marginTop: height + 'px' }">
  151. <image src="/static/images/mall/icon_popup_closed.png" class="tui-close__img" @tap.stop="hideModal">
  152. </image>
  153. <image :show-menu-by-longpress="true" :src="config.kefuqrcode" class="tui-poster__img"></image>
  154. </view>
  155. </tui-modal>
  156. <tui-modal :show="selectOperatingcityShow" @cancel="hideOperatingcityModal" :custom="true" fadeIn>
  157. <image src="/static/images/mall/icon_popup_closed.png" class="tui-close__img"
  158. @tap.stop="hideOperatingcityModal">
  159. </image>
  160. <view class="tui-modal-custom">
  161. <view class="tui-prompt-title">您所在的城市还没开通运营</view>
  162. <view class="tui-modal__btn">
  163. <view class="tui-box">
  164. <button class="tui-btn-danger" @click="onSelectoperatingcity">选择附近的城市</button>
  165. </view>
  166. <view class="tui-box">
  167. <tui-button type="white" shape="circle" height="80rpx" :size="34"
  168. @click="onregoperatingcity">申请当地运营商</tui-button>
  169. </view>
  170. </view>
  171. </view>
  172. </tui-modal>
  173. <tui-modal :show="selecttuanzhangShow" @cancel="hidetuanzhangModal" :custom="true" fadeIn>
  174. <image src="/static/images/mall/icon_popup_closed.png" class="tui-close__img"
  175. @tap.stop="hidetuanzhangModal">
  176. </image>
  177. <view class="tui-modal-custom">
  178. <view class="tui-prompt-title">请选择社区服务点</view>
  179. <view class="tui-modal__btn">
  180. <view class="tui-box">
  181. <button class="tui-btn-danger" @click="onChangehousingestate">选择社区服务点</button>
  182. </view>
  183. </view>
  184. </view>
  185. </tui-modal>
  186. <view class="tui-safearea-bottom"></view>
  187. <tui-tabbar :current="current" :pageid="id">
  188. </tui-tabbar>
  189. </view>
  190. </template>
  191. <script>
  192. import uniNoticeBar from "@/components/uni-notice-bar/uni-notice-bar.vue"
  193. import PengpaiFadeInOut from "@/components/Pengpai-FadeInOut/Pengpai-FadeInOut.vue"
  194. import search from '@/components/views/diyitem/search.vue';
  195. import navbar from '@/components/views/diyitem/navbar.vue';
  196. import imagesingle from '@/components/views/diyitem/imagesingle.vue';
  197. import duo from '@/components/views/diyitem/duo.vue';
  198. import window from '@/components/views/diyitem/window.vue';
  199. import tuwen from '@/components/views/diyitem/tuwen.vue';
  200. import diyvideo from '@/components/views/diyitem/diyvideo.vue';
  201. import miaosha from '@/components/views/diyitem/miaosha.vue';
  202. import goodscard from '@/components/views/diyitem/goodscard.vue';
  203. import tuan from '@/components/views/diyitem/tuan.vue';
  204. import goods from '@/components/views/diyitem/goods.vue';
  205. import notice from '@/components/views/diyitem/notice.vue';
  206. import blank from '@/components/views/diyitem/blank.vue';
  207. import guide from '@/components/views/diyitem/guide.vue';
  208. import richtext from '@/components/views/diyitem/richtext.vue';
  209. import technical from '@/components/views/diyitem/technical.vue';
  210. import store from '@/components/views/diyitem/store.vue';
  211. import coupon from '@/components/views/diyitem/coupon.vue';
  212. export default {
  213. components: {
  214. uniNoticeBar,
  215. PengpaiFadeInOut,
  216. search,
  217. navbar,
  218. imagesingle,
  219. duo,
  220. window,
  221. tuwen,
  222. diyvideo,
  223. miaosha,
  224. goodscard,
  225. tuan,
  226. goods,
  227. notice,
  228. blank,
  229. guide,
  230. richtext,
  231. technical,
  232. store,
  233. coupon
  234. },
  235. data() {
  236. return {
  237. list: [],
  238. uid: '',
  239. config: {},
  240. configkefu: {},
  241. configtuanzhang: {},
  242. pagestyleconfig: {},
  243. is_submitaudit: 1,
  244. selecttuanzhangShow: false,
  245. selectOperatingcityShow: false,
  246. modalShow: false,
  247. height: 64, //header高度
  248. top: 26, //标题图标距离顶部距离
  249. scrollH: 0, //滚动总高度
  250. bannerHeight: [],
  251. windowWidth: 0,
  252. current: '',
  253. cityName: '',
  254. housingName: '',
  255. community_title: '',
  256. tuanzhangName: '',
  257. tuanzhangtouxiang: '',
  258. latitude: "",
  259. longitude: "",
  260. id: "0",
  261. //diy数据
  262. modulelist: [],
  263. pagebase: [],
  264. newProduct: [{
  265. name: '时尚舒适公主裙高街修身长裙',
  266. present: 198,
  267. original: 298,
  268. pic: '1.jpg',
  269. type: 1,
  270. isLabel: true
  271. }],
  272. pageIndex: 1,
  273. loadding: false,
  274. pullUpOn: true,
  275. opacity: 1,
  276. timer: null,
  277. num: 0,
  278. currentid: 0,
  279. cumulative: 0
  280. };
  281. },
  282. onLoad: function(e) {
  283. let _this = this
  284. let obj = {};
  285. // #ifdef MP-WEIXIN
  286. this.current = "/" + this.__route__;
  287. // #endif
  288. //#ifdef H5
  289. this.current = '/pages/index/index';
  290. //#endif
  291. uni.showLoading({
  292. title: '数据加载中'
  293. });
  294. if (uni.getStorageInfoSync().currentSize > 8000) {
  295. uni.clearStorageSync();
  296. console.log('清理本地数据缓存');
  297. }
  298. setTimeout(() => {
  299. uni.getSystemInfo({
  300. success: res => {
  301. //console.log(res);
  302. this.width = obj.left || res.windowWidth;
  303. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight +
  304. 44;
  305. this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res
  306. .statusBarHeight + 6;
  307. this.scrollH = res.windowWidth;
  308. this.windowWidth = res.windowWidth;
  309. }
  310. });
  311. }, 0);
  312. if (e.jump) {
  313. uni.reLaunch({
  314. url: e.jump
  315. });
  316. }
  317. _this.$request.post('config', {
  318. mo: 'pagestyle'
  319. }).then(res => {
  320. if (res.errno == 0) {
  321. _this.pagestyleconfig = res.data
  322. }
  323. });
  324. //console.log(e);
  325. setTimeout(function() {
  326. uni.hideLoading();
  327. }, 2000);
  328. if (e.id) {
  329. _this.id = e.id;
  330. }
  331. if (!e.reid) {
  332. if (e && e.scene) {
  333. e.reid = e.scene;
  334. }
  335. }
  336. if (e.reid) {
  337. uni.setStorageSync('reid', e.reid)
  338. }
  339. _this.getdiypage();
  340. _this.sam.login().then(res => {
  341. //console.log(res);
  342. //console.log(e);
  343. if (res.uid > 0) {
  344. _this.uid = res.uid;
  345. if (uni.getStorageSync('reid')) {
  346. _this.$request.get('member.bindpid', {
  347. samkey: (new Date()).valueOf(),
  348. pid: uni.getStorageSync('reid')
  349. }).then(res => {
  350. if (res.errno == 0) {
  351. console.log('pid绑定成功');
  352. }
  353. })
  354. }
  355. }
  356. });
  357. setTimeout(() => {
  358. uni.getSystemInfo({
  359. success: res => {
  360. //console.log(res);
  361. this.hieghtS = res.windowHeight;
  362. this.windowWidth = res.windowWidth;
  363. }
  364. });
  365. }, 0);
  366. if (_this.$siteInfo.design_method == 3) {
  367. _this.getNewMessage();
  368. _this.timer = setInterval(() => {
  369. setTimeout(() => {
  370. _this.getNewMessage()
  371. }, 0)
  372. }, 5000)
  373. }
  374. if (_this.id > 0) {
  375. this.current = this.current + '?id=' + _this.id;
  376. }
  377. uni.setStorageSync('gotopage', this.current);
  378. },
  379. onShow() {
  380. let _this = this;
  381. //#ifdef H5 || APP-PLUS
  382. uni.getLocation({
  383. type: 'wgs84',
  384. success: function(res) {
  385. console.log(res);
  386. },
  387. })
  388. //#endif
  389. //只在app实时定位
  390. // #ifdef APP-PLUS
  391. uni.startLocationUpdate({
  392. success: res => console.log('开启小程序接收位置消息成功', res),
  393. fail: err => console.error('开启小程序接收位置消息失败:', err),
  394. complete: msg => console.log('调用开启小程序接收位置消息 API 完成')
  395. });
  396. // #endif
  397. _this.$request.post('Config.audit', {
  398. samkey: (new Date()).valueOf()
  399. }).then(res => {
  400. if (res.data.is_submitaudit != 1) {
  401. if (_this.$siteInfo.multiid == 1) {
  402. uni.reLaunch({
  403. url: '/pagesA/my/admintechnical/index'
  404. });
  405. }
  406. }
  407. });
  408. uni.setStorageSync('NewMessage', '1')
  409. this.sam.onShowlogin();
  410. //获取地置位置
  411. _this.sam.getCityPosition({
  412. is_index: 1
  413. }).then(res => {
  414. _this.getdiypage();
  415. _this.cityName = res.cityName;
  416. _this.housingName = res.housingName;
  417. _this.community_title = res.community_title;
  418. _this.tuanzhangName = res.tuanzhangName;
  419. _this.tuanzhangtouxiang = res.tuanzhangtouxiang;
  420. _this.tuanzhangtouxiang = res.tuanzhangtouxiang;
  421. console.log(res);
  422. if (!res.ocid && res.operatingcityis_limit == 1) {
  423. _this.selectOperatingcityShow = true;
  424. } else {
  425. _this.selectOperatingcityShow = false;
  426. if (_this.configtuanzhang.tuanzhang_open == 1) {
  427. if (res.he_id) {
  428. _this.selecttuanzhangShow = false;
  429. } else {
  430. _this.selecttuanzhangShow = true;
  431. }
  432. }
  433. }
  434. });
  435. },
  436. destroyed() {
  437. clearInterval(this.timer)
  438. },
  439. methods: {
  440. toimwebview(url) {
  441. this.tui.href("/pages/webview/h5?url=" + url)
  442. },
  443. toim() {
  444. if (this.configkefu.minionline == 2 && this.configkefu.kefuurl) {
  445. this.tui.href(this.configkefu.kefuurl);
  446. } else if (this.configkefu.minionline == 3) {
  447. var telstr = this.configkefu.kefutel;
  448. uni.makePhoneCall({
  449. phoneNumber: telstr
  450. });
  451. } else {
  452. this.tui.href("/pages/im/h5");
  453. }
  454. },
  455. getNewMessage: function() {
  456. let _this = this;
  457. if (uni.getStorageSync('NewMessage') == '1') {
  458. _this.$request.post('broadcast.index', {
  459. cumulative: _this.cumulative,
  460. currentid: _this.currentid,
  461. }).then(res => {
  462. if (res.errno == 0) {
  463. if (res.data) {
  464. if (_this.num > 3) {
  465. _this.list = [];
  466. _this.num = 0;
  467. }
  468. _this.currentid = res.data.id;
  469. //追加一条数据
  470. _this.list = _this.list.concat(res.data);
  471. _this.num++;
  472. _this.cumulative++;
  473. } else {
  474. _this.currentid = 0;
  475. }
  476. }
  477. })
  478. }
  479. },
  480. setswiperHeight(e) {
  481. console.log(e);
  482. this.bannerHeight = this.modulelist;
  483. this.bannerHeight[e.currentTarget.dataset.itemindex].swiperHeight = e.detail.height * ((this.windowWidth -
  484. 20) / e.detail.width);
  485. },
  486. //获取后台数据
  487. getdiypage: function() {
  488. let _this = this;
  489. _this.$request.get('diypage.indexv2', {
  490. samkey: (new Date()).valueOf(),
  491. id: _this.id
  492. }).then(res => {
  493. if (res.errno == 0) {
  494. _this.config = res.data.config;
  495. if (res.data.config) {
  496. _this.configkefu = res.data.config.kefu || {};
  497. }
  498. if (res.data.config) {
  499. _this.configtuanzhang = res.data.config.tuanzhang || {};
  500. }
  501. if (_this.config.kefuqrcode && _this.is_submitaudit != 1) {
  502. _this.modalShow = true;
  503. }
  504. if (res.data.modulelist) {
  505. _this.modulelist = res.data.modulelist;
  506. _this.pagebase = res.data.pagebase;
  507. if (_this.bannerHeight.length == 0) {
  508. //console.log(_this.bannerHeight.length);
  509. _this.bannerHeight = _this.modulelist;
  510. }
  511. uni.setNavigationBarTitle({
  512. title: res.data.config.sys_title
  513. });
  514. /*
  515. uni.setNavigationBarColor({
  516. frontColor: res.data.pagebase.base.titleTextColor,
  517. backgroundColor: res.data.pagebase.base.titleBackgroundColor,
  518. animation: { //动画效果
  519. duration: 400,
  520. timingFunc: 'easeIn'
  521. }
  522. });*/
  523. }
  524. }
  525. })
  526. },
  527. /**
  528. * 领取优惠券
  529. */
  530. receiveTap: function(e) {
  531. let _this = this,
  532. dataset = e.currentTarget.dataset;
  533. if (!dataset.state) {
  534. return false;
  535. }
  536. _this.$request.post('Couponreceive.fetch', {
  537. id: dataset.couponId
  538. }).then(res => {
  539. wx.showToast({
  540. title: res.message,
  541. icon: 'none'
  542. })
  543. _this.modulelist[dataset.itemindex].list[dataset.index].state = {
  544. value: 0,
  545. text: '已领取'
  546. };
  547. })
  548. },
  549. navigateTo: function(e) {
  550. this.sam.diynavigateTo(e);
  551. },
  552. coupon() {
  553. this.sam.navigateTo('/pages/coupon/coupon');
  554. },
  555. category: function() {
  556. this.sam.navigateTo('../category/category');
  557. },
  558. selectCity: function() {
  559. this.sam.navigateTo('/pages/selectCity/selectCity');
  560. },
  561. onChangehousingestate: function(e) {
  562. this.sam.navigateTo("/pages/housingestate/list");
  563. },
  564. onSelectoperatingcity: function(e) {
  565. this.sam.navigateTo("/pages/operatingcity/list");
  566. },
  567. onregoperatingcity: function(e) {
  568. this.sam.navigateTo("/pages/login/reg?ptype=operatingcity");
  569. },
  570. onChangePosition: function() {
  571. const _this = this;
  572. uni.chooseLocation({
  573. success(res) {
  574. _this.$request.post('operatingcity.getcity', {
  575. samkey: (new Date()).valueOf(),
  576. address: res.address,
  577. latitude: res.latitude,
  578. longitude: res.longitude
  579. }).then(res => {
  580. if (res.data) {
  581. _this.cityName = res.data.cityName;
  582. _this.community_title = res.data.community_title;
  583. _this.housingName = res.data.housingName;
  584. _this.tuanzhangName = res.data.tuanzhangName;
  585. _this.tuanzhangtouxiang = res.data.tuanzhangtouxiang;
  586. }
  587. });
  588. }
  589. });
  590. },
  591. tokefuTel: function(e) {
  592. //客服电话
  593. const _this = this;
  594. var telstr = _this.config.TELEPHONE;
  595. uni.makePhoneCall({
  596. phoneNumber: telstr
  597. });
  598. },
  599. hideModal() {
  600. this.modalShow = false;
  601. },
  602. hidetuanzhangModal() {
  603. this.selecttuanzhangShow = false;
  604. },
  605. hideOperatingcityModal() {
  606. this.selectOperatingcityShow = false;
  607. }
  608. },
  609. onPullDownRefresh: function() {
  610. this.getdiypage()
  611. uni.stopPullDownRefresh();
  612. },
  613. onReachBottom: function() {
  614. },
  615. onPageScroll(e) {
  616. // #ifdef APP-PLUS
  617. let scrollTop = e.scrollTop;
  618. if (scrollTop < 0) {
  619. if (this.opacity > 0)
  620. this.opacity = 1 - Math.abs(scrollTop) / 30;
  621. } else {
  622. this.opacity = 1
  623. }
  624. // #endif
  625. },
  626. //发送给朋友
  627. onShareAppMessage: function() {
  628. let _this = this;
  629. //console.log(_this.uid);
  630. let path = "/pages/index/index?reid=" + _this.uid;
  631. if (_this.id > 0) {
  632. path = path + '&id=' + _this.id;
  633. }
  634. return {
  635. title: _this.pagebase.params.share_title || "",
  636. path: path,
  637. };
  638. },
  639. onShareTimeline(res) { //分享到朋友圈
  640. return {}
  641. },
  642. };
  643. </script>
  644. <style>
  645. @import '@/components/views/diyitem/diyapge.css';
  646. </style>