circle.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854
  1. <template>
  2. <view id="moments" class="page">
  3. <view v-if="showVedio" class="showVedio" :style="{height:screenHeight+'px',width:'100%'}">
  4. <!-- <video :src="videoPath"
  5. style="height: 100%;width: 100%"
  6. id="myVideo"
  7. object-fit="fill"
  8. airplay="allow" /> -->
  9. <video autoplay="true" page-gesture="true" controls="false" @fullscreenchange="fullscreenchange"
  10. :style="{height:'100%',width:'100%'}" id="myVideo" class="showVedio-video" :src="videoPath">
  11. <cover-image @tap="showVedio = false" src="/static/theme/default/my/close.png" class="cloneBut">
  12. </cover-image>
  13. <!-- </cover-view> -->
  14. </video>
  15. </view>
  16. <view class="home-pic">
  17. <avatar selWidth="600upx" selHeight="600upx" @upload="upload" :avatarSrc="circleImg"
  18. avatarStyle="width: 750upx; height: 500upx; border-radius: 0upx;" />
  19. </avatar>
  20. <view class="home-pic-base">
  21. <view class="top-pic">
  22. <image class="header" :src="myPhoto" @tap.stop="goDetails(my_data.id)" :lazy-load="true" />
  23. </view>
  24. <view class="top-name" style="color: #FFFFFF;margin-bottom: 10px;">{{ my_data.nickname }}</view>
  25. </view>
  26. </view>
  27. <view class="new_msg" @tap="goCircleChat" v-if="no_reader_msg">你有新的消息</view>
  28. <view class="moments__post" v-for="(post,index) in posts" :key="index" :id="'post-'+index">
  29. <view class="post-left">
  30. <image class="post_header" :src="staticPhoto + post.header_image + '?_=' + imgRan"
  31. @tap="goDetails(post.uid)" :lazy-load="true" />
  32. </view>
  33. <view class="post_right">
  34. <text class="post-username" @tap="goDetails(post.uid)">{{post.username}}</text>
  35. <view>
  36. <view id="paragraph" class="paragraph" @tap="init_input()">{{post.content.text}}</view>
  37. <!-- 相册 -->
  38. <view class="thumbnails" v-if="post.type == 0" @tap="init_input()">
  39. <view :class="post.content.value.length === 1 ? 'my-gallery' : 'thumbnail' "
  40. v-for="(image, index_images) in post.content.value" :key="index_images">
  41. <image class="gallery_img" :lazy-load="true" mode="aspectFill"
  42. :src="staticPath + post.post_id +'/' + image" :data-src="image"
  43. @tap="previewImage(index,index_images)" />
  44. <image v-if="post.content.video_path" @tap="previewImage(index,index_images)"
  45. class="bofang-button"
  46. style="width: 30px;height: 30px;position: absolute;top: 315rpx;left:220rpx"
  47. mode="aspectFill" src="/static/theme/default/my/bofang.png"></image>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="pay_view" v-if="post.can_pay == 1"> <button :disabled="post.can_pay_times == 0"
  52. :style="{'background-color':post.can_pay_times == 1?'#4591ff':'#A9A9A9'}" size="mini"
  53. @tap="open(index)"
  54. type="primary">{{post.can_pay_times == 0 ? '已售出' : '¥'+post.pay_amount + '元'}}</button></view>
  55. <!-- 资料条 -->
  56. <view class="toolbar">
  57. <view class="timestamp">{{ post.timestamp }}
  58. <text class="del-icon" v-if="post.uid == my_data.id" @tap="delSay(post.post_id)">删除</text>
  59. </view>
  60. <view class="like" @tap="like(index)">
  61. <image
  62. :src="post.islike === 0 ? '../../static/theme/default/push/circle/islike.png' : '../../static/theme/default/push/circle/like.png'"
  63. :lazy-load="true" />
  64. </view>
  65. <view class="comment" @tap="comment(index)">
  66. <image src="../../static/theme/default/push/circle/comment.png" :lazy-load="true"></image>
  67. </view>
  68. </view>
  69. <!-- 赞/评论区 -->
  70. <view class="post-footer">
  71. <view class="footer_content" v-if="post.like.length">
  72. <image class="liked" src="../../static/theme/default/push/circle/liked.png" :lazy-load="true">
  73. </image>
  74. <text class="nickname" v-for="(user,index_like) in post.like" :key="index_like"
  75. @tap="goDetails(user.uid)">
  76. {{(index_like ? ',' : '' ) + user.username}}
  77. </text>
  78. </view>
  79. <view class="footer_content" v-for="(comment,comment_index) in post.comments" :key="comment_index"
  80. @tap="reply(index,comment_index)">
  81. <text class="comment-nickname" style="word-break:break-all;">
  82. {{comment.username + comment.reply + ': '}}
  83. <text class="comment-content">
  84. {{comment.content}}
  85. </text>
  86. </text>
  87. </view>
  88. </view>
  89. </view>
  90. <!-- 结束 post -->
  91. </view>
  92. <view class="foot" v-show="showInput">
  93. <chat-input @send-message="send_comment" @blur="blur" :focus="focus" :placeholder="input_placeholder">
  94. </chat-input>
  95. <!-- <chat-input @send-message="send_comment" @blur="blur" :placeholder="input_placeholder"></chat-input> -->
  96. </view>
  97. <view class="uni-loadmore" v-if="showLoadMore">{{loadMoreText}}</view>
  98. <view :class="['action_main animated faster',(action_menu ? 'bounceInDown' : 'bounceOutUp')]"
  99. v-show="showActionMenu" @tap="actionMain">
  100. <view class="action_base">
  101. <view class="sj"></view>
  102. <view class="action_item" @tap="goAction(0)">
  103. <text class="action_item_text">发送图文</text>
  104. </view>
  105. <view class="action_item" @tap="goAction(1)">
  106. <text class="action_item_text">发送视频</text>
  107. </view>
  108. </view>
  109. </view>
  110. <uni-popup ref="popup" type="address">
  111. <uni-popup-address :userAddress="userAddress" :amount="amount" :goods_name="goods_name"
  112. :small_pic="small_pic" @confirm="goBuy"></uni-popup-address>
  113. </uni-popup>
  114. <pay-keyboard :showCose="showCose" :set_info="set_info" :show_key="show_key" ref="payKeyboard"
  115. :set_msg="set_msg" @hideFun="hideFun" @getPassword="getPassword"></pay-keyboard>
  116. </view>
  117. </template>
  118. <script>
  119. import chatInput from './circle/chat_input.vue'; //输入消息框
  120. import _get from '../../common/_get';
  121. import _hook from '../../common/_hook';
  122. import avatar from "../../components/yq-avatar/yq-avatar.vue";
  123. import _data from '../../common/_data';
  124. import UniPopupAddress from "../../components/uni-popup/uni-popup-address";
  125. import UniPopup from "../../components/uni-popup/uni-popup";
  126. import payKeyboard from "../../components/uni-keyword/uni-keyword";
  127. export default {
  128. components: {
  129. UniPopup,
  130. UniPopupAddress,
  131. chatInput,
  132. avatar,
  133. payKeyboard
  134. },
  135. data() {
  136. return {
  137. showPage: true,
  138. my_data: {
  139. id: 0,
  140. nickname: '',
  141. photo: 'default_man/90.jpg',
  142. circle_img: 'default_circle_img.jpg',
  143. },
  144. showCose: true,
  145. set_info: '请输入交易密码,以确认身份',
  146. show_key: false,
  147. set_msg: '请输入交易密码',
  148. user_id: 0,
  149. action_menu: false,
  150. posts: [], // 模拟数据
  151. index: '',
  152. comment_index: '',
  153. input_placeholder: '评论', //占位内容
  154. focus: false, //是否自动聚焦输入框
  155. is_reply: false, //回复还是评论
  156. showInput: false, //评论输入框
  157. screenHeight: '', //屏幕高度(系统)
  158. platform: '',
  159. windowHeight: '', //可用窗口高度(不计入软键盘)
  160. loadMoreText: "加载中...",
  161. showLoadMore: false,
  162. is_more: false,
  163. no_reader_msg: 0,
  164. doubleClick: false,
  165. showVedio: false,
  166. videoPath: '',
  167. post_id: '',
  168. post_index_id: 0,
  169. userAddress: {
  170. regionStr: '',
  171. username: '',
  172. mobile: '',
  173. address: '',
  174. regionCode: '440113'
  175. },
  176. small_pic: '',
  177. amount: '',
  178. goods_name: '',
  179. }
  180. },
  181. computed: {
  182. regionName() {
  183. return this.region.map(item => item.name).join(' ')
  184. },
  185. showActionMenu() {
  186. return this.action_menu;
  187. },
  188. myPhoto() {
  189. return _data.staticPhoto() + this.my_data.photo + '?_=' + this.imgRan;
  190. },
  191. circleImg() {
  192. return _data.staticPhoto() + (this.my_data.circle_img?this.my_data.circle_img:'default_circle_img.jpg');
  193. },
  194. staticPath() {
  195. return _data.staticCircle();
  196. },
  197. staticPhoto() {
  198. return _data.staticPhoto();
  199. },
  200. imgRan() {
  201. return Math.random();
  202. },
  203. },
  204. onLoad(option) {
  205. let _this = this;
  206. uni.getSystemInfo({ //获取设备信息
  207. success: (res) => {
  208. _this.screenHeight = res.screenHeight;
  209. _this.platform = res.platform;
  210. }
  211. });
  212. this.setNavStyle();
  213. },
  214. onShow() {
  215. _hook.routeSonHook();
  216. let _this = this;
  217. let circle_data = _data.localData('circle_data');
  218. /** 加载本地缓存数据,让页面秒速渲染出来 */
  219. if (circle_data) {
  220. _this.posts = circle_data;
  221. if (_data.data('no_reader_circle') || _data.data('no_reader_circle_chat_num')) {
  222. this.posts = [];
  223. _data.data('circle_data', []);
  224. this.pullDownRefresh();
  225. }
  226. } else {
  227. _this.pullDownRefresh();
  228. }
  229. let userAddress = _data.localData('data_user_address');
  230. if (userAddress) _this.userAddress = userAddress;
  231. this.no_reader_msg = _data.data('no_reader_circle_chat_num') ? 1 : 0;
  232. _data.data('no_reader_circle', 0);
  233. // 监听窗口尺寸变化,窗口尺寸不包括底部导航栏
  234. uni.onWindowResize((res) => {
  235. if (this.platform === 'ios') {
  236. this.windowHeight = res.size.windowHeight;
  237. this.adjust();
  238. } else {
  239. if (this.screenHeight - res.size.windowHeight > 60 && this.windowHeight <= res.size
  240. .windowHeight) {
  241. this.windowHeight = res.size.windowHeight;
  242. this.adjust();
  243. }
  244. }
  245. });
  246. uni.$off('data_circle_data');
  247. /** 监听最新数据 */
  248. uni.$on('data_circle_data', function(data) {
  249. console.log('data_circle_data:', data)
  250. // 过滤重复数据
  251. let obj = {}
  252. data.forEach(item=>{
  253. obj[item.post_id] = item
  254. })
  255. // 去重
  256. let data_list = []
  257. for(let item in obj){
  258. data_list.push(obj[item])
  259. }
  260. console.log('朋友圈数据:', data)
  261. console.log('朋友圈数据:', data_list)
  262. _this.posts = data_list;
  263. });
  264. /** 监听新的个人数据 */
  265. uni.$on('data_user_info', function(data) {
  266. _this.my_data = data;
  267. });
  268. /** 监听朋友圈动态提示 */
  269. uni.$on('data_circle_tips', function(data) {
  270. if (!isNaN(data)) {
  271. _this.no_reader_msg = 1;
  272. };
  273. });
  274. _this.my_data = _data.data('user_info');
  275. },
  276. onNavigationBarButtonTap(e) {
  277. this.action_menu = !this.action_menu;
  278. },
  279. onUnload() {
  280. uni.$off('data_circle_tips');
  281. uni.$off('data_user_info');
  282. uni.$off('data_circle_data');
  283. uni.offWindowResize(() => {});
  284. this.max = 0,
  285. this.data = [],
  286. this.loadMoreText = "加载更多",
  287. this.showLoadMore = false;
  288. },
  289. onReachBottom() { //监听上拉触底事件
  290. let _this = this;
  291. _this.showLoadMore = true;
  292. if (_this.is_more) {
  293. return;
  294. }
  295. let time = 0,
  296. is_length = _this.posts.length;
  297. if (is_length) {
  298. time = _this.posts[is_length - 1].time;
  299. }
  300. _get.getCircleList({
  301. time: time,
  302. type: 1,
  303. user_id: 0
  304. }, (data) => {
  305. _this.my_data = data.user_info;
  306. if (data.data.length < 10) {
  307. this.loadMoreText = '没有更多数据了';
  308. this.is_more = true;
  309. }
  310. });
  311. },
  312. onPullDownRefresh() { //监听下拉刷新动作
  313. if (_data.data('no_reader_circle') || _data.data('no_reader_circle_chat_num')) {
  314. this.posts = [];
  315. _data.data('circle_data', []);
  316. }
  317. this.pullDownRefresh();
  318. },
  319. onNavigationBarButtonTap(e) { //监听标题栏点击事件
  320. let _this = this;
  321. if (e.index == 0) {
  322. // this.navigateTo('./circle/send');
  323. // this.action_menu = !this.action_menu
  324. let list = [{
  325. name: "图文",
  326. key: "image"
  327. }, {
  328. name: "短视频",
  329. key: "video"
  330. },
  331. // {
  332. // name: "取消",
  333. // key: "cancle"
  334. // },
  335. ]
  336. uni.showActionSheet({
  337. itemList: list.map(v => v.name),
  338. success: res => {
  339. if (res.tapIndex == 2) return false;
  340. uni.navigateTo({
  341. url: './circle/send?type=' + list[res.tapIndex].key + '&user_id=' + _this
  342. .user_id,
  343. });
  344. },
  345. });
  346. }
  347. },
  348. onPageScroll(e) {
  349. // console.log("e", e.scrollTop);
  350. if (e.scrollTop < 45) {
  351. let tran = e.scrollTop / 44;
  352. this.setNavStyle(tran);
  353. } else {
  354. this.setNavStyle(1);
  355. }
  356. },
  357. methods: {
  358. setNavStyle(tran) {
  359. // #ifdef H5
  360. // let btn = document.getElementsByClassName('uni-page-head-btn');
  361. // for (let i = 0; i < btn.length; i++) {
  362. // console.log("btn", btn);
  363. // btn[i].style.backgroundColor = 'rgba(0,0,0,0)!important';
  364. // }
  365. // console.log("tran", tran)
  366. if (tran > 0.5) {
  367. uni.setNavigationBarColor({
  368. backgroundColor: `rgba(255,255,255,${tran})`,
  369. animation: {
  370. duration: 300
  371. },
  372. frontColor: `#000000`,
  373. })
  374. uni.setNavigationBarTitle({
  375. title: '生活圈'
  376. })
  377. } else {
  378. uni.setNavigationBarColor({
  379. backgroundColor: `rgba(0,0,0,${tran})`,
  380. animation: {
  381. duration: 300
  382. },
  383. frontColor: `#ffffff`,
  384. })
  385. uni.setNavigationBarTitle({
  386. title: ''
  387. })
  388. }
  389. // #endif
  390. },
  391. delSay(id) {
  392. let _this = this;
  393. uni.showModal({
  394. title: '重要提示',
  395. content: '确定要删除吗?',
  396. confirmText: '删除',
  397. cancelText: '取消',
  398. confirmColor: 'red',
  399. cancelColor: '#353535',
  400. success: function(res) {
  401. if (res.confirm) {
  402. _this.$httpSend({
  403. path: '/im/circle/del',
  404. data: {
  405. id: id
  406. },
  407. success(data) {
  408. console.log(data)
  409. if (data.code == 0) {
  410. uni.showToast({
  411. icon: 'none',
  412. title: '删除成功'
  413. })
  414. _this.posts = [];
  415. _data.localData('circle_data', []);
  416. _this.pullDownRefresh();
  417. } else {
  418. uni.showToast({
  419. icon: 'none',
  420. title: data.msg
  421. })
  422. }
  423. }
  424. });
  425. }
  426. }
  427. });
  428. },
  429. goAction(index) {
  430. if (index === 0) {
  431. this.navigateTo('./circle/send?user_id=' + this.user_id);
  432. }
  433. },
  434. actionMain() {
  435. this.action_menu = !this.action_menu;
  436. },
  437. upload(e) {
  438. let _this = this;
  439. _this.$httpSendFile({
  440. local_url: e.path,
  441. type: 3,
  442. success(data) {
  443. _this.$httpSend({
  444. path: '/im/action/upCircleImg',
  445. success(data) {
  446. _get.base();
  447. uni.showToast({
  448. title: '更换成功',
  449. duration: 2000
  450. });
  451. }
  452. });
  453. },
  454. });
  455. },
  456. goCircleChat() {
  457. _data.data('no_reader_circle_chat_num', 0);
  458. // this.navigateTo('./circle_chat_details');
  459. this.no_reader_msg = 0;
  460. this.pullDownRefresh()
  461. },
  462. pullDownRefresh() {
  463. let _this = this;
  464. //初始化数据
  465. let time = 0;
  466. if (this.posts.length) {
  467. time = this.posts[0].time;
  468. }
  469. if(time == 0){
  470. _data.localData('circle_data',[])
  471. this.posts = [];
  472. }
  473. _get.getCircleList({
  474. time: time,
  475. type: 0,
  476. user_id: 0,
  477. }, (data) => {
  478. _this.my_data = data.user_info;
  479. });
  480. uni.stopPullDownRefresh(); //停止下拉刷新
  481. /** 取消好友动态提示 */
  482. _data.data('no_reader_circle', 0);
  483. },
  484. goDetails(user_id) {
  485. this.navigateTo('../details/index?user_id=' + user_id);
  486. },
  487. navigateTo(url) {
  488. uni.navigateTo({
  489. url: url
  490. });
  491. },
  492. like(index) {
  493. let _this = this,
  494. is_like = (_this.posts[index].islike ? 0 : 1);
  495. _this.$httpSend({
  496. path: '/im/circle/likeAction',
  497. data: {
  498. is_like: is_like,
  499. id: _this.posts[index].post_id,
  500. },
  501. success(data) {
  502. // _this.posts[index].islike = data.action;
  503. }
  504. });
  505. },
  506. comment(index) {
  507. if (this.showInput) {
  508. this.showInput = false;
  509. this.focus = false;
  510. this.index = '';
  511. } else {
  512. this.showInput = true; //调起input框
  513. this.focus = true;
  514. this.index = index;
  515. }
  516. },
  517. adjust() { //当弹出软键盘发生评论动作时,调整页面位置pageScrollTo
  518. uni.createSelectorQuery().selectViewport().scrollOffset(res => {
  519. var scrollTop = res.scrollTop;
  520. let view = uni.createSelectorQuery().select("#post-" + this.index);
  521. view.boundingClientRect(data => {
  522. // console.log("data:" + JSON.stringify(data));
  523. // console.log("手机屏幕高度:" + this.screenHeight);
  524. // console.log("竖直滚动位置" + scrollTop);
  525. // console.log("节点离页面顶部的距离为" + data.top);
  526. // console.log("节点高度为" + data.height);
  527. // console.log("窗口高度为" + this.windowHeight);
  528. // uni.pageScrollTo({
  529. // scrollTop: scrollTop - (this.windowHeight - (data.height + data.top + 45)), //一顿乱算
  530. // // scrollTop: 50,
  531. // duration: 300
  532. // });
  533. }).exec();
  534. }).exec();
  535. },
  536. reply(index, comment_index) {
  537. this.is_reply = true; //回复中
  538. this.showInput = true; //调起input框
  539. let replyTo = this.posts[index].comments[comment_index].username;
  540. this.input_placeholder = '回复' + replyTo;
  541. this.index = index; //post索引
  542. this.comment_index = comment_index; //评论索引
  543. this.focus = true;
  544. },
  545. blur: function() {
  546. //this.init_input();
  547. },
  548. send_comment: function(message) {
  549. let _this = this,
  550. is_posts_obj = this.posts[this.index],
  551. chat_user_id = is_posts_obj.uid,
  552. reply = '';
  553. if (this.is_reply) {
  554. let is_reply_obj = is_posts_obj.comments[this.comment_index];
  555. chat_user_id = is_reply_obj.uid;
  556. if (is_posts_obj.uid != chat_user_id) {
  557. reply = '回复' + is_reply_obj.username;
  558. }
  559. }
  560. _this.$httpSend({
  561. path: '/im/circle/comment',
  562. data: {
  563. message,
  564. id: is_posts_obj.post_id,
  565. chat_user_id,
  566. },
  567. success(data) {
  568. is_posts_obj.comments.push({
  569. "uid": _this.my_data.id,
  570. 'reply': reply,
  571. "username": _this.my_data.nickname,
  572. "content": message
  573. });
  574. _this.init_input();
  575. }
  576. });
  577. },
  578. init_input() {
  579. this.showInput = false;
  580. this.focus = false;
  581. this.input_placeholder = '评论';
  582. this.is_reply = false;
  583. },
  584. createVideoPlayer(video_path) {
  585. // #ifdef APP-PLUS
  586. let player = null;
  587. player = plus.video.createVideoPlayer('videoplayer', {
  588. src: 'rtmp://' + video_path,
  589. top: '50px',
  590. left: '0px',
  591. width: '100%',
  592. height: '100%',
  593. position: 'fix'
  594. });
  595. var pages = getCurrentPages();
  596. var page = pages[pages.length - 1];
  597. var currentWebview = page.$getAppWebview();
  598. currentWebview.append(player)
  599. // #endif
  600. },
  601. previewImage(index, image_index) {
  602. let data = this.posts[index],
  603. _this = this,
  604. images_all = [];
  605. console.log(111)
  606. if (data.content.video_path) {
  607. let video_path = this.staticPath + data.post_id + '/' + data.content.video_path;
  608. _this.videoPath = video_path;
  609. _this.showVedio = true;
  610. //设置屏幕高度
  611. return true;
  612. }
  613. for (let i = 0, j = data.content.value.length; i < j; i++) {
  614. images_all.push(this.staticPath + data.post_id + '/' + data.content.value[i].replace('_thumb', ''));
  615. }
  616. var current = images_all[image_index];
  617. uni.previewImage({
  618. current: current,
  619. urls: images_all
  620. });
  621. },
  622. goPublish() {
  623. uni.navigateTo({
  624. url: './circle/send',
  625. success: res => {},
  626. fail: () => {},
  627. complete: () => {}
  628. });
  629. },
  630. // 获取选择的地区
  631. goBuy(address) {
  632. //弹出交易密码界面
  633. // this.show_key = true;
  634. this.userAddress = address;
  635. _data.localData('data_user_address', address);
  636. //去支付
  637. let _this = this;
  638. let params = this.userAddress;
  639. params.post_id = this.post_id;
  640. let circle_data = _data.localData('circle_data');
  641. let data = circle_data[_this.post_index_id];
  642. let small_pic = this.staticPath + data.post_id + '/' + data.content.value[0].replace('_thumb', '');
  643. params.small_pic = small_pic;
  644. _get.payCicleOrder(params, function(ret) {
  645. //更新本地朋友圈信息
  646. uni.showToast({
  647. title: '购买成功',
  648. icon: 'none',
  649. });
  650. _this.$refs.popup.close();
  651. }, function(ret) {
  652. uni.showToast({
  653. title: ret.msg,
  654. icon: 'none',
  655. });
  656. _this.show_key = false;
  657. })
  658. },
  659. hideFun() {
  660. this.show_key = false;
  661. },
  662. getPassword(e) {
  663. //去支付
  664. let _this = this;
  665. e.post_id = this.post_id;
  666. let params = Object.assign(e, this.userAddress);
  667. let circle_data = _data.localData('circle_data');
  668. let data = circle_data[_this.post_index_id];
  669. let small_pic = this.staticPath + data.post_id + '/' + data.content.value[0].replace('_thumb', '');
  670. e.small_pic = small_pic;
  671. _get.payCicleOrder(params, function(ret) {
  672. //更新本地朋友圈信息
  673. uni.showToast({
  674. title: '购买成功',
  675. icon: 'none',
  676. });
  677. _this.show_key = false;
  678. _this.$refs.payKeyboard.cleanNum();
  679. _this.$refs.popup.close();
  680. }, function(ret) {
  681. uni.showToast({
  682. title: ret.msg,
  683. icon: 'none',
  684. });
  685. _this.show_key = false;
  686. _this.$refs.payKeyboard.cleanNum();
  687. })
  688. },
  689. open(index) {
  690. let data = this.posts[index];
  691. console.log(this.userAddress)
  692. this.goods_name = data.content.text;
  693. this.small_pic = this.staticPath + data.post_id + '/' + data.content.value[0].replace('_thumb', '');
  694. this.amount = data.pay_amount;
  695. this.post_id = data.post_id;
  696. this.post_index_id = index;
  697. this.$refs.popup.open();
  698. },
  699. fullscreenchange() {
  700. console.log(1111111111111)
  701. }
  702. },
  703. watch: {
  704. },
  705. }
  706. </script>
  707. <style scoped>
  708. @import url("../../static/css/push/circle.css");
  709. #moments {
  710. min-height: 100vh;
  711. }
  712. .del-icon {
  713. color: #5194ec;
  714. margin-left: 20rpx;
  715. }
  716. page {
  717. background: #FFFFFF;
  718. min-height: 100vh;
  719. }
  720. .page {
  721. position: relative;
  722. }
  723. .pay_view {
  724. margin: 15upx 0;
  725. text-align: right;
  726. }
  727. .new_msg {
  728. text-align: center;
  729. color: #36648b;
  730. font-weight: bold;
  731. }
  732. .action_main {
  733. position: fixed;
  734. top: 120upx;
  735. /* #ifndef H5 */
  736. top: 15px;
  737. /* #endif */
  738. width: 750upx;
  739. height: 1080upx;
  740. z-index: 10000;
  741. }
  742. .action_base {
  743. position: absolute;
  744. right: 15upx;
  745. width: 300upx;
  746. top: 120upx;
  747. background: #36363d;
  748. border-radius: 10upx;
  749. }
  750. .sj {
  751. position: fixed;
  752. top: -28upx;
  753. right: 26upx;
  754. /* #ifdef APP-PLUS */
  755. top: 3upx;
  756. right: 20upx;
  757. /* #endif */
  758. width: 0;
  759. height: 0;
  760. border-left: 20upx solid transparent;
  761. border-right: 20upx solid transparent;
  762. border-bottom: 20upx solid #36363d;
  763. }
  764. .action_item {
  765. color: #e5e5e5;
  766. height: 100upx;
  767. line-height: 100upx;
  768. margin-left: 45upx;
  769. border-bottom: 1px solid #3e3e3e;
  770. }
  771. .action_icon {
  772. width: 45upx;
  773. height: 45upx;
  774. display: inline-block;
  775. vertical-align: middle;
  776. }
  777. .action_item:last-child {
  778. border: none;
  779. }
  780. .action_item_text {
  781. font-size: 30upx;
  782. }
  783. .showVedio {
  784. position: fixed;
  785. z-index: 999;
  786. }
  787. .cloneBut {
  788. position: relative;
  789. font-size: 24px;
  790. color: red;
  791. margin-left: 30px;
  792. margin-top: 80px;
  793. height: 30px;
  794. width: 30px;
  795. }
  796. .paragraph {
  797. word-break: break-all;
  798. }
  799. </style>
  800. <style>
  801. .uni-page-head-transparent .uni-page-head-btn {
  802. background-color: rgba(0, 0, 0, 0) !important;
  803. }
  804. </style>