index.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108
  1. <template>
  2. <view class="container" :data-theme="theme">
  3. <!-- :style="userInfo.avatar?{ backgroundImage: `url(${userInfo.avatar})` }: ''" -->
  4. <!-- #ifdef MP || APP -->
  5. <NavBar navTitle="个人主页" :isBackgroundColor="false" iconColor='#fff'></NavBar>
  6. <!-- #endif -->
  7. <view class="header">
  8. <view class="header-bg" :style="{'background-image': userInfo.avatar}">
  9. <img :src="userInfo.avatar" alt="">
  10. <view class="header-bg-mc"></view>
  11. </view>
  12. <view class="user_wrapper flex-between-center">
  13. <image v-if="userInfo.userLevelIcon" class="level_icon" :src="userInfo.userLevelIcon" alt="">
  14. <view class="flex-y-center row-middle">
  15. <image :src="userInfo.avatar || urlDomain+'crmebimage/presets/morenT.png'" class="picture">
  16. </image>
  17. <view class="user_text flex-1">
  18. <view class="name acea-row">
  19. <text>{{userInfo.isLogoff ? "用户已注销": (userInfo.nickname || '')}}</text>
  20. </view>
  21. <!-- <view v-if="userInfo.id" class="user_id">ID: {{userInfo.id || ''}}</view> -->
  22. <view class="flex-between-center mt-16" @click="onEdit('school')">
  23. <view class="user_id">学校: {{school || '暂无'}}</view>
  24. <text v-show="userInfo.id==uid" class="ml10 iconfont icon-fabuzhongcao"></text>
  25. </view>
  26. </view>
  27. </view>
  28. <view v-if="id && id!=uid" @click.stop="followAuthor">
  29. <button v-if="!userInfo.isConcerned" class="follow_btn focus">
  30. <text class="iconfont icon-jiahao2"></text>关注
  31. </button>
  32. <button v-else class="follow_btn focused">已关注</button>
  33. </view>
  34. <view v-if="userInfo.id==uid">
  35. <navigator hover-class="none" :url="`/pages/discover/discover_release/index?fair=${true}`" class="follow_btn focus bg-color">
  36. 去发布
  37. </navigator>
  38. </view>
  39. </view>
  40. <view class="acea-row plant_info" @click="onEdit('signature')">
  41. <view v-if="!userInfo.signature && userInfo.id==uid">点击可编辑个性签名</view>
  42. <view class="" v-if="userInfo.signature" style="width: 92%;">
  43. <view class="acea-row" v-if="userInfo.isMore || userInfo.signature.length<=30">
  44. <text class="signature">{{userInfo.signature}}</text>
  45. <text v-if="userInfo.isMore" class="more" @click.stop="moreTap">收起</text>
  46. </view>
  47. <view v-else class="acea-row">
  48. <text class="info signature">{{userInfo.signature.slice(0,23)}}...</text>
  49. <text class="more" @click.stop="moreTap"> 展开</text>
  50. </view>
  51. </view>
  52. <text v-show="userInfo.id==uid" class="ml10 iconfont icon-fabuzhongcao"></text>
  53. </view>
  54. <view class="plant_info" style="padding-bottom: 30rpx;">
  55. <view class="count_wrapper acea-row">
  56. <navigator :url="!id ? '/pages/discover/discover_follow/index?type=follow' : ''" class="item" hover-class="none">
  57. <text class="mr10">{{userInfo.concernedNum}}</text> 关注
  58. </navigator>
  59. <navigator :url="!id ? '/pages/discover/discover_follow/index?type=fans' : ''" class="item" hover-class="none">
  60. <text class="mr10">{{userInfo.fansNum}}</text> 粉丝
  61. </navigator>
  62. <view class="item">
  63. <text class="mr10">{{userInfo.likeNum}}</text> 获赞
  64. </view>
  65. </view>
  66. </view>
  67. <view v-if="!id && isShow" class="tab_count relative">
  68. <text @click.stop="changeTab(0)" :class="tab==0 ? 'on' : ''">我发布的</text>
  69. <text @click.stop="changeTab(1)" :class="tab==1 ? 'on' : ''">我想要的</text>
  70. <text @click.stop="changeTab(2)" :class="tab==2 ? 'on' : ''">我收藏的</text>
  71. <text @click.stop="changeTab(3)" :class="tab==3 ? 'on' : ''">我购买的</text>
  72. </view>
  73. </view>
  74. <view class="main">
  75. <view class="tab-conts">
  76. <view v-if="list.length > 0 && tab!==3" class="goods-wrap flex-1">
  77. <view class="goods">
  78. <!-- <WaterfallsFlow v-if="list.length" :wfList="list" :fromType="1" fromTo="home">
  79. </WaterfallsFlow> -->
  80. <WaterfallsFlow :wfList='list' :type="1" :isDynamics="true" :userFair="true" :isManage="manage">
  81. <template slot-scope="{item}">
  82. <WaterfallsFlowItem :item="item" :type="1" :isStore="1" />
  83. </template>
  84. </WaterfallsFlow>
  85. </view>
  86. </view>
  87. <view class='my-order' v-else>
  88. <view class='list'>
  89. <view class='item' v-for="(item,index) in list" :key="index">
  90. <view class='title acea-row row-between-wrapper'>
  91. <view class="acea-row row-middle">
  92. <view v-if="item.merName">
  93. <navigator :url="`/pages/merchant/home/index?merId=${item.merId}`" hover-class="none">
  94. <text class='iconfont icon-shangjiadingdan mr10'></text>
  95. <text class="mr10">{{item.merName}}</text>
  96. <text class='iconfont icon-xiangyou'></text>
  97. </navigator>
  98. </view>
  99. <view v-else>
  100. <text class="mr10">{{item.orderNo}}</text>
  101. </view>
  102. </view>
  103. <view v-if="item.refundStatus == 3" class='font_color'>已退款</view>
  104. <template v-else>
  105. <view class='font_color'>{{item.status | orderStatusFilter}}</view>
  106. </template>
  107. </view>
  108. <view v-for="(items,indexs) in item.orderInfoList" :key="indexs">
  109. <view @click='goOrderDetails(item)' class='item-info acea-row row-between row-top'>
  110. <view class='pictrue'>
  111. <easy-loadimage mode="widthFix" :image-src="items.image"></easy-loadimage>
  112. </view>
  113. <view class='text acea-row row-between'>
  114. <view class="nameBox">
  115. <view class='name line2'>
  116. <span v-if="Number(item.type) > 0 && Number(item.type) < 3" class="activity bg_color">{{item.type | orderTypeFilter}}</span>
  117. <span v-if="Number(item.secondType) === 1" class="activity bg_color">积分</span>
  118. <span>{{items.productName}}</span>
  119. </view>
  120. <view class="sku line1">{{items.sku}}</view>
  121. </view>
  122. <view class='money'>
  123. <view>¥{{items.price}}</view>
  124. <view>x{{items.payNum}}</view>
  125. </view>
  126. </view>
  127. </view>
  128. <view v-if="items.applyRefundNum && item.refundStatus > -1" class="text-24rpx font-color oppoSans-R mr-20px px-30 mt-14">
  129. 售后申请数量:{{ items.applyRefundNum }}
  130. </view>
  131. </view>
  132. <view class='totalPrice' :class="item.status===0?'no-border':''">{{item.totalNum}}
  133. 件商品,总金额
  134. <text class='money semiBold'> ¥{{item.payPrice}}</text>
  135. </view>
  136. <!-- <view v-if="item.status===0" class="mx-20 flex">
  137. <view class="tips w-full px-20 f-s-26">
  138. 付款提醒<text class="ml-20 text-999">请在{{item.expirationTime}}前完成支付!</text>
  139. </view>
  140. </view> -->
  141. <!-- 订单状态(0:待支付,1:待发货,2:部分发货, 3:待核销,4:待收货,5:已收货,6:已完成,9:已取消) -->
  142. <view class='bottom acea-row row-right row-middle'>
  143. <view class='bnt cancelBnt' v-if="item.status === 0" @click='cancelOrder(index,item.orderNo)'>
  144. 取消订单
  145. </view>
  146. <view class='bnt bg_color' v-if="item.status === 0" @click='goPay(item)'>
  147. 立即付款
  148. </view>
  149. <view class='bnt bg_color' v-if="((item.paid || item.status == 9)&&item.type!=2)||(item.type==2&&item.groupBuyRecordStatus!==0)"
  150. @click='goOrderDetails(item)'>
  151. 查看详情</view>
  152. <view class='bnt cancelBnt' v-if="item.status==6 || item.status==9" @click='delOrder(item.orderNo,index)'>
  153. 删除订单
  154. </view>
  155. </view>
  156. </view>
  157. </view>
  158. </view>
  159. <view class="empty-boxs noContent" v-if="list.length == 0 && !loading">
  160. <emptyPage title="暂无更多内容~" mTop="13%" :imgSrc="urlDomain+'crmebimage/presets/noguanzhu.png'">
  161. </emptyPage>
  162. </view>
  163. <view class='loadingicon acea-row row-center-wrapper'>
  164. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>
  165. <view class="end" :hidden="loading || list.length == 0"><text :class="loaded ? 'loaded' : ''">{{loadTitle}}</text>
  166. </view>
  167. </view>
  168. </view>
  169. </view>
  170. <uni-popup ref="inputDialog" type="dialog">
  171. <view v-if="isShowSignature" class="tui-modal-custom">
  172. <view class="fs-32 fw-500 lh-44rpx text-center">{{fieldStr == 'signature' ? '编辑简介' : '编辑学校'}}</view>
  173. <view class="mt-24 bg--w111-f5f5f5 rd-16rpx p-24">
  174. <textarea v-if="fieldStr == 'signature'" class="w-full fs-26 h-342" ref="myTextarea" v-model="signature" :focus="focus"
  175. :always-embed="true" :adjust-position="true" cursor-spacing="85rpx" placeholder="请输入内容" :maxlength="100" name="desc" />
  176. <input v-if="fieldStr == 'school'" class="placeholder" type='text' v-model='school' :focus="focus"
  177. placeholder='请输入学校' placeholder-class='placeholder'></input>
  178. </view>
  179. <view class="flex-between-center mt-40">
  180. <view class="w-244 h-72 rd-36rpx flex-center fs-26 font-color close-btn" @tap="handleInputClose">取消
  181. </view>
  182. <view class="w-244 h-72 rd-36rpx flex-center bg-color text--w111-fff fs-26"
  183. @tap="handleInputConfirm">保存
  184. </view>
  185. </view>
  186. </view>
  187. </uni-popup>
  188. </view>
  189. </template>
  190. <script>
  191. // +----------------------------------------------------------------------
  192. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  193. // +----------------------------------------------------------------------
  194. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  195. // +----------------------------------------------------------------------
  196. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  197. // +----------------------------------------------------------------------
  198. // | Author: CRMEB Team <admin@crmeb.com>
  199. // +----------------------------------------------------------------------
  200. import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
  201. import WaterfallsFlowItem from '@/components/discoverFlowItem/discoverFlowItem.vue'
  202. import emptyPage from '@/components/emptyPage.vue';
  203. import NavBar from '@/components/navBar.vue';
  204. import {
  205. userHomeApi,
  206. myHomeApi,
  207. authorNoteApi,
  208. mySecondHandListApi,
  209. myLikeListApi,
  210. secondHandListApi,
  211. secondHandFollowListApi,
  212. editSignatureApi,
  213. editSchoolApi
  214. } from '@/api/discover.js';
  215. import {
  216. getSecondHandDetail,
  217. secondHandTake,
  218. secondHandDel,
  219. secondHandCancel,
  220. secondHandStatusImgApi,
  221. secondHandSend,
  222. secondHandOrderList
  223. } from '@/api/secondHand.js';
  224. import {
  225. ProductTypeEnum,
  226. } from "@/enums/productEnums";
  227. import {
  228. Debounce
  229. } from '@/utils/validate.js';
  230. import {
  231. toLogin
  232. } from '@/libs/login.js';
  233. import {
  234. mapGetters
  235. } from "vuex";
  236. import {
  237. discoverFollowAuthor
  238. } from '@/libs/follow.js';
  239. import easyLoadimage from '@/components/base/easy-loadimage.vue';
  240. const app = getApp();
  241. let sysHeight = uni.getSystemInfoSync().statusBarHeight;
  242. export default {
  243. components: {
  244. WaterfallsFlow,
  245. WaterfallsFlowItem,
  246. emptyPage,
  247. NavBar,
  248. easyLoadimage
  249. },
  250. data() {
  251. return {
  252. sysHeight: sysHeight,
  253. urlDomain: this.$Cache.get("imgHost"),
  254. theme: app.globalData.theme,
  255. ProductTypeEnum: ProductTypeEnum,
  256. list: [], // 内容列表
  257. loadTitle: '加载更多',
  258. loading: false,
  259. loaded: false,
  260. isShowAuth: false, //是否隐藏授权
  261. isAuto: false, //没有授权的不会自动授权
  262. userInfo: {},
  263. where: {
  264. page: 1,
  265. limit: 10
  266. },
  267. tab: 0,
  268. id: '', //作者id
  269. isShow: false,
  270. focus: false,
  271. isShowSignature: false, // 是否显示简介编辑内容
  272. signature: '', //弹窗中的签名
  273. school: '',
  274. fieldStr: '',
  275. manage: 1
  276. }
  277. },
  278. created() {},
  279. computed: {
  280. ...mapGetters(['isLogin', 'uid']),
  281. },
  282. watch: {},
  283. onLoad: function(options) {
  284. this.id = options.id ? options.id : '';
  285. },
  286. onShow() {
  287. // if (this.id) {
  288. // this.isShow = false
  289. // this.getUserHome(this.id);
  290. // this.authorNoteList();
  291. // } else {
  292. this.isShow = true
  293. this.getMyHome();
  294. this.myNoteList();
  295. // }
  296. },
  297. onReady() {},
  298. mounted: function() {},
  299. methods: {
  300. moreTap() {
  301. this.$set(this.userInfo, 'isMore', !this.userInfo.isMore)
  302. },
  303. //个性签名取消
  304. handleInputClose() {
  305. this.$refs.inputDialog.close()
  306. this.isShowSignature = false;
  307. },
  308. //个性签名保存
  309. handleInputConfirm() {
  310. const api = this.fieldStr == 'signature' ? editSignatureApi({signature: this.signature}) : editSchoolApi({school: this.school});
  311. api.then(res => {
  312. uni.showToast({
  313. title: res.data,
  314. icon: 'none'
  315. })
  316. this.getMyHome();
  317. }).catch(err => {
  318. uni.showToast({
  319. title: err,
  320. icon: 'none'
  321. })
  322. });
  323. // 关闭窗口后,恢复默认内容
  324. this.$refs.inputDialog.close()
  325. this.isShowSignature = false;
  326. },
  327. //编辑个性签名
  328. onEdit(str) {
  329. if (this.userInfo.id == this.uid) {
  330. this.fieldStr = str;
  331. this.isShowSignature = true;
  332. this.signature = this.userInfo.signature;
  333. this.$refs.inputDialog.open();
  334. }
  335. },
  336. //回退页面之后重新加载页面
  337. reFresh() {
  338. this.loading = false;
  339. this.loaded = false;
  340. this.where = {
  341. page: 1,
  342. limit: 10
  343. }
  344. this.list = []
  345. // if (this.id) {
  346. // this.getUserHome(this.id);
  347. // this.authorNoteList();
  348. // } else {
  349. this.getMyHome();
  350. this.myNoteList();
  351. // }
  352. },
  353. //获取我的用户信息
  354. getMyHome() {
  355. myHomeApi().then(res => {
  356. console.log(res.data)
  357. this.userInfo = res.data;
  358. this.signature = this.userInfo.signature
  359. this.school = this.userInfo.school
  360. this.isMore = false;
  361. }).catch(err => {
  362. uni.showToast({
  363. title: err,
  364. icon: 'none'
  365. })
  366. });
  367. },
  368. /**
  369. * 去订单详情
  370. */
  371. goOrderDetails: function(item, status) {
  372. if (!item.orderNo) return this.$util.Tips({
  373. title: '缺少订单号无法查看订单详情'
  374. });
  375. //虚拟商品
  376. if (item.secondType === this.ProductTypeEnum.CloudDrive || item.secondType === this.ProductTypeEnum
  377. .CardPassword) {
  378. // #ifdef MP
  379. uni.navigateTo({
  380. url: '/pages/goods/virtual_order_details/index?orderNo=' + item.orderNo
  381. })
  382. // #endif
  383. // #ifndef MP
  384. uni.navigateTo({
  385. animationType: animationType.type,
  386. animationDuration: animationType.duration,
  387. url: '/pages/goods/virtual_order_details/index?orderNo=' + item.orderNo
  388. })
  389. // #endif
  390. } else {
  391. // #ifdef MP
  392. uni.navigateTo({
  393. url: '/pages/goods/order_details/index?orderNo=' + item.orderNo + '&orderType=secondHand'
  394. })
  395. // #endif
  396. // #ifndef MP
  397. uni.navigateTo({
  398. animationType: animationType.type,
  399. animationDuration: animationType.duration,
  400. url: '/pages/goods/order_details/index?orderNo=' + item.orderNo + "'&orderType=secondHand'
  401. })
  402. // #endif
  403. }
  404. },
  405. //逛逛用户主页
  406. getUserHome(id) {
  407. userHomeApi(id).then(res => {
  408. this.userInfo = res.data
  409. }).catch(err => {
  410. uni.showToast({
  411. title: err,
  412. icon: 'none'
  413. })
  414. });
  415. },
  416. // 关注作者
  417. followAuthor: function() {
  418. if (this.isLogin) {
  419. if (this.userInfo.isLogoff) return;
  420. discoverFollowAuthor(this.id).then(() => {
  421. this.$set(this.userInfo, 'isConcerned', !this.userInfo.isConcerned);
  422. });
  423. } else {
  424. toLogin();
  425. }
  426. },
  427. changeTab(tab) {
  428. this.tab = tab
  429. this.where.page = 1
  430. this.loaded = this.loading = false
  431. this.list = []
  432. if (tab === 0) {
  433. this.manage = 1;
  434. this.myNoteList();
  435. } else if (tab === 1) {
  436. this.manage = 0;
  437. this.myLikeList();
  438. } else if (tab === 2) {
  439. this.manage = 0;
  440. this.myFollowList()
  441. } else {
  442. this.manage = 0;
  443. this.myOrderList()
  444. }
  445. },
  446. // 获取我购买的作品
  447. myOrderList: function() {
  448. let that = this;
  449. if (that.loaded || that.loading) return;
  450. that.loading = true;
  451. that.loadTitle = '';
  452. that.where.status = -1;
  453. secondHandOrderList(that.where).then(res => {
  454. let list = res.data.list;
  455. let goods = that.$util.SplitArray(list, that.list);
  456. that.loaded = list.length < that.where.limit;
  457. that.loading = false;
  458. that.loadTitle = that.loaded ? '到底了' : '加载更多';
  459. that.$set(that, 'list', goods);
  460. that.$set(that.where, 'page', that.where.page + 1);
  461. }).catch(err => {
  462. that.loading = false;
  463. uni.showToast({
  464. title: err,
  465. icon: 'none'
  466. })
  467. })
  468. },
  469. // 获取我的收藏作品
  470. myFollowList: function() {
  471. let that = this;
  472. if (that.loaded || that.loading) return;
  473. that.loading = true;
  474. that.loadTitle = '';
  475. secondHandFollowListApi(that.where).then(res => {
  476. let list = res.data.list;
  477. let goods = that.$util.SplitArray(list, that.list);
  478. that.loaded = list.length < that.where.limit;
  479. that.loading = false;
  480. that.loadTitle = that.loaded ? '到底了' : '加载更多';
  481. that.$set(that, 'list', goods);
  482. that.$set(that.where, 'page', that.where.page + 1);
  483. }).catch(err => {
  484. that.loading = false;
  485. uni.showToast({
  486. title: err,
  487. icon: 'none'
  488. })
  489. })
  490. },
  491. // 获取我的点赞作品
  492. myLikeList: function() {
  493. let that = this;
  494. if (that.loaded || that.loading) return;
  495. that.loading = true;
  496. that.loadTitle = '';
  497. secondHandListApi(that.where).then(res => {
  498. let list = res.data.list;
  499. let goods = that.$util.SplitArray(list, that.list);
  500. that.loaded = list.length < that.where.limit;
  501. that.loading = false;
  502. that.loadTitle = that.loaded ? '到底了' : '加载更多';
  503. that.$set(that, 'list', goods);
  504. that.$set(that.where, 'page', that.where.page + 1);
  505. }).catch(err => {
  506. that.loading = false;
  507. uni.showToast({
  508. title: err,
  509. icon: 'none'
  510. })
  511. })
  512. },
  513. // 获取我的的作品
  514. myNoteList: function() {
  515. let that = this;
  516. if (that.loaded || that.loading) return;
  517. that.loading = true;
  518. that.loadTitle = '';
  519. mySecondHandListApi(that.where).then(res => {
  520. let list = res.data.list;
  521. let goods = that.$util.SplitArray(list, that.list);
  522. that.loaded = list.length < that.where.limit;
  523. that.loading = false;
  524. that.loadTitle = that.loaded ? '到底了' : '加载更多';
  525. that.$set(that, 'list', goods);
  526. that.$set(that.where, 'page', that.where.page + 1);
  527. }).catch(err => {
  528. that.loading = false;
  529. uni.showToast({
  530. title: err,
  531. icon: 'none'
  532. })
  533. })
  534. },
  535. // 作者的作品
  536. authorNoteList: function() {
  537. let that = this;
  538. if (that.loaded || that.loading) return;
  539. that.loading = true;
  540. that.loadTitle = '';
  541. this.where.authorId = this.id
  542. authorNoteApi(this.where.authorId, that.where).then(res => {
  543. let list = res.data.list;
  544. let goods = that.$util.SplitArray(list, that.list);
  545. that.loaded = list.length < that.where.limit;
  546. that.loading = false;
  547. that.loadTitle = that.loaded ? '到底了' : '加载更多';
  548. that.$set(that, 'list', goods);
  549. that.$set(that.where, 'page', that.where.page + 1);
  550. }).catch(err => {
  551. that.loading = false;
  552. uni.showToast({
  553. title: err,
  554. icon: 'none'
  555. })
  556. })
  557. },
  558. /**
  559. * 取消订单
  560. *
  561. */
  562. cancelOrder: function(index, orderNo) {
  563. let that = this;
  564. if (!orderNo) return that.$util.Tips({
  565. title: '缺少订单号无法取消订单'
  566. });
  567. uni.showModal({
  568. content: '确定取消该订单',
  569. cancelText: "取消",
  570. confirmText: "确定",
  571. showCancel: true,
  572. confirmColor: '#f55850',
  573. success: (res) => {
  574. if (res.confirm) {
  575. uni.showLoading({
  576. title: '正在取消中'
  577. });
  578. secondHandCancel(orderNo).then(res => {
  579. uni.hideLoading();
  580. return that.$util.Tips({
  581. title: '取消成功',
  582. icon: 'success'
  583. }, function() {
  584. that.getAllOrder();
  585. });
  586. }).catch(err => {
  587. return that.$util.Tips({
  588. title: err
  589. });
  590. });
  591. } else {
  592. }
  593. },
  594. })
  595. },
  596. /**
  597. * 打开支付组件
  598. *
  599. */
  600. goPay: Debounce(function(item) {
  601. uni.showLoading({
  602. title: '加载中...'
  603. });
  604. // 其他商品走正常流程,去支付收银台页面
  605. this.getToPayment('', item, 'secondHand')
  606. }),
  607. /**
  608. * 删除订单
  609. */
  610. delOrder: function(orderNo, index) {
  611. uni.showModal({
  612. content: '确定删除该订单',
  613. cancelText: "取消",
  614. confirmText: "确定",
  615. showCancel: true,
  616. confirmColor: '#f55850',
  617. success: (res) => {
  618. if (res.confirm) {
  619. let that = this;
  620. secondHandDel(orderNo).then(res => {
  621. that.getAllOrder();
  622. return that.$util.Tips({
  623. title: '删除成功',
  624. icon: 'success'
  625. });
  626. }).catch(err => {
  627. return that.$util.Tips({
  628. title: err
  629. });
  630. })
  631. } else {
  632. }
  633. },
  634. })
  635. },
  636. },
  637. onReachBottom() {
  638. // if (this.id) {
  639. // this.authorNoteList();
  640. // } else {
  641. if (this.tab === 0) {
  642. this.myNoteList();
  643. } else {
  644. this.myLikeList();
  645. }
  646. // }
  647. },
  648. onPullDownRefresh() {},
  649. // 滚动监听
  650. onPageScroll(e) {
  651. // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
  652. uni.$emit('scroll');
  653. }
  654. }
  655. </script>
  656. <style lang="scss" scoped>
  657. .close-btn {
  658. @include coupons_border_color(theme);
  659. }
  660. .tui-modal-custom {
  661. width: 600rpx;
  662. position: relative;
  663. box-sizing: border-box;
  664. padding: 40rpx;
  665. border-radius: 16px;
  666. background-color: #fff;
  667. z-index: 9999;
  668. .h-342 {
  669. min-height: 268rpx;
  670. max-height: 268rpx;
  671. ;
  672. overflow-y: scroll;
  673. }
  674. }
  675. .signature {
  676. overflow: hidden;
  677. display: -webkit-box;
  678. -webkit-line-clamp: 5;
  679. -webkit-box-orient: vertical;
  680. text-overflow: ellipsis;
  681. width: 88%;
  682. }
  683. .goods-wrap {
  684. padding-top: 24rpx;
  685. }
  686. .more {
  687. font-weight: 600;
  688. margin-left: 8rpx;
  689. }
  690. .container {
  691. background: #ffffff;
  692. min-height: 100vh;
  693. }
  694. .header-bg {
  695. position: absolute;
  696. width: 100%;
  697. height: 650rpx;
  698. top: 0;
  699. /* #ifdef MP || APP-PLUS */
  700. z-index: -1;
  701. /* #endif */
  702. /* #ifdef H5 */
  703. z-index: 0;
  704. /* #endif */
  705. z-index: 0;
  706. filter: blur(0);
  707. overflow: hidden;
  708. img {
  709. width: 100%;
  710. height: 100%;
  711. filter: blur(16rpx);
  712. transform: scale(1.5);
  713. }
  714. .header-bg-mc {
  715. position: absolute;
  716. top: 0;
  717. width: 100%;
  718. height: 100%;
  719. background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.1) 39%, rgba(0, 0, 0, 0.7) 100%);
  720. }
  721. }
  722. .header {
  723. width: 750rpx;
  724. padding: 20rpx 0 0;
  725. box-sizing: border-box;
  726. background: linear-gradient(360deg, #72798E 0%, #384857 99%);
  727. opacity: 1;
  728. .tab_count {
  729. text-align: center;
  730. background: #ffffff;
  731. padding: 30rpx 0 15rpx 0;
  732. border-radius: 12px 12px 0 0;
  733. text {
  734. font-size: 28rpx;
  735. color: #999999;
  736. margin: 0 30rpx;
  737. position: relative;
  738. padding-bottom: 14rpx;
  739. &.on {
  740. font-size: 32rpx;
  741. color: #282828;
  742. font-weight: bold;
  743. &::after {
  744. content: "";
  745. width: 80%;
  746. height: 5rpx;
  747. @include main_bg_color(theme);
  748. position: absolute;
  749. bottom: 0;
  750. left: 12rpx;
  751. }
  752. .underline {
  753. opacity: 1;
  754. }
  755. }
  756. }
  757. }
  758. .user_wrapper {
  759. align-items: center;
  760. justify-content: space-between;
  761. padding: 0 34rpx;
  762. position: relative;
  763. .level_icon {
  764. position: absolute;
  765. width: 38rpx;
  766. height: 38rpx;
  767. margin: 4rpx 0 0 6rpx;
  768. border: none;
  769. z-index: 11;
  770. bottom: 2rpx;
  771. left: 124rpx;
  772. }
  773. .image,
  774. uni-image,
  775. image {
  776. width: 140rpx;
  777. height: 140rpx;
  778. border-radius: 100%;
  779. border: 4rpx solid #ffffff;
  780. }
  781. .user_text {
  782. margin-left: 30rpx;
  783. color: #FFFFFF;
  784. .name {
  785. font-size: 34rpx;
  786. font-weight: bold;
  787. align-items: center;
  788. }
  789. .user_id {
  790. text-overflow: ellipsis;
  791. white-space: nowrap;
  792. overflow: hidden;
  793. max-width: 300rpx;
  794. font-size: 24rpx;
  795. }
  796. }
  797. }
  798. .plant_info {
  799. position: relative;
  800. padding: 0 34rpx;
  801. margin-top: 30rpx;
  802. justify-content: space-between;
  803. color: #ffffff;
  804. font-size: 24rpx;
  805. .count_wrapper {
  806. color: #FFFFFF;
  807. font-size: 24rpx;
  808. .item {
  809. text-align: center;
  810. margin-right: 60rpx;
  811. &:last-child {
  812. margin-right: 0;
  813. }
  814. text {
  815. font-size: 30rpx;
  816. margin-top: 10rpx;
  817. }
  818. }
  819. }
  820. }
  821. .iconfont {
  822. font-size: 24rpx;
  823. margin-right: 12rpx;
  824. }
  825. .follow_btn {
  826. color: #ffffff;
  827. font-size: 26rpx;
  828. display: flex;
  829. align-items: center;
  830. justify-content: center;
  831. width: 146rpx;
  832. height: 62rpx;
  833. @include linear-gradient(theme);
  834. border-radius: 33rpx;
  835. .icon-fabu {
  836. font-size: 24rpx;
  837. }
  838. &.focused {
  839. background: transparent;
  840. color: #FFFFFF;
  841. border: 1px solid #FFFFFF;
  842. }
  843. }
  844. }
  845. .main {
  846. background: #ffffff;
  847. position: relative;
  848. }
  849. .goods {
  850. // display: flex;
  851. // flex-wrap: wrap;
  852. // justify-content: space-between;
  853. // width: 750rpx;
  854. padding: 0 24rpx;
  855. }
  856. .empty {
  857. margin: 130rpx 0 150rpx;
  858. text-align: center;
  859. image,
  860. uni-image {
  861. display: inline-block;
  862. width: 414rpx;
  863. height: 305rpx;
  864. }
  865. text {
  866. display: block;
  867. color: #999999;
  868. font-size: 26rpx;
  869. }
  870. }
  871. .end {
  872. margin-top: 50rpx 0;
  873. text-align: center;
  874. text {
  875. color: #999999;
  876. font-size: 22rpx;
  877. position: relative;
  878. &.loaded {
  879. &::before,
  880. &::after {
  881. content: "";
  882. display: inline-block;
  883. width: 22rpx;
  884. height: 1rpx;
  885. background: #999999;
  886. position: absolute;
  887. top: 18rpx;
  888. opacity: .5;
  889. }
  890. &::before {
  891. left: -30rpx;
  892. }
  893. &::after {
  894. right: -30rpx;
  895. }
  896. }
  897. }
  898. }
  899. .my-order .list {
  900. width: 690rpx;
  901. margin: 0 auto;
  902. }
  903. .my-order .list .item {
  904. background-color: #fff;
  905. border-radius: 14rpx;
  906. margin-bottom: 14rpx;
  907. }
  908. .my-order .list .item .title {
  909. height: 84rpx;
  910. padding: 0 24rpx;
  911. border-bottom: 1rpx solid #eee;
  912. font-size: 28rpx;
  913. color: #282828;
  914. }
  915. .my-order .list .item .title .sign {
  916. font-size: 24rpx;
  917. padding: 0 13rpx;
  918. height: 36rpx;
  919. margin-right: 15rpx;
  920. border-radius: 18rpx;
  921. @include coupons_border_color(theme);
  922. @include main_color(theme);
  923. }
  924. .my-order .list .item .item-info {
  925. padding: 0 30rpx;
  926. margin-top: 22rpx;
  927. }
  928. .my-order .list .item .item-info .pictrue {
  929. width: 120rpx;
  930. height: 120rpx;
  931. }
  932. .my-order .list .item .item-info .pictrue image {
  933. width: 100%;
  934. height: 100%;
  935. border-radius: 14rpx;
  936. overflow: hidden;
  937. }
  938. .my-order .list .item .item-info {
  939. .nameBox {
  940. position: relative;
  941. height: 120rpx;
  942. }
  943. .sku {
  944. font-size: 20rpx;
  945. position: absolute;
  946. bottom: 4rpx;
  947. width: 420rpx;
  948. }
  949. .text {
  950. width: 496rpx;
  951. font-size: 28rpx;
  952. color: #999;
  953. }
  954. }
  955. .my-order .list .item .item-info .text .name {
  956. width: 326rpx;
  957. color: #282828;
  958. }
  959. .my-order .list .item .item-info .text .money {
  960. text-align: right;
  961. }
  962. .font_color {
  963. @include main_color(theme);
  964. }
  965. .my-order .list .item .totalPrice {
  966. font-size: 26rpx;
  967. color: #282828;
  968. text-align: right;
  969. margin: 27rpx 0 0 30rpx;
  970. padding: 0 30rpx 30rpx 0;
  971. border-bottom: 1rpx solid #eee;
  972. }
  973. .my-order .list .item .totalPrice .money {
  974. font-size: 28rpx;
  975. font-weight: bold;
  976. @include price_color(theme);
  977. }
  978. .my-order .list .item .bottom {
  979. height: 107rpx;
  980. padding: 0 30rpx;
  981. }
  982. .my-order .list .item .bottom .bnt {
  983. width: 176rpx;
  984. height: 60rpx;
  985. text-align: center;
  986. line-height: 60rpx;
  987. color: #fff;
  988. border-radius: 50rpx;
  989. font-size: 27rpx;
  990. }
  991. .my-order .list .item .bottom .bnt.cancelBnt {
  992. border: 1rpx solid #ddd;
  993. color: #aaa;
  994. }
  995. .my-order .list .item .bottom .bnt~.bnt {
  996. margin-left: 17rpx;
  997. }
  998. .my-order {
  999. .header {
  1000. height: 250rpx;
  1001. padding: 0 30rpx;
  1002. }
  1003. }
  1004. .bg_color {
  1005. @include main_bg_color(theme);
  1006. }
  1007. .my-order .header .picTxt {
  1008. height: 190rpx;
  1009. }
  1010. .my-order .header .picTxt .text {
  1011. color: rgba(255, 255, 255, 0.8);
  1012. font-size: 26rpx;
  1013. font-family: 'Guildford Pro';
  1014. }
  1015. .my-order .header .picTxt .text .name {
  1016. font-size: 34rpx;
  1017. font-weight: bold;
  1018. color: #fff;
  1019. margin-bottom: 20rpx;
  1020. }
  1021. .my-order .header .picTxt .pictrue {
  1022. width: 120rpx;
  1023. height: 120rpx;
  1024. }
  1025. .my-order .header .picTxt .pictrue image {
  1026. width: 100%;
  1027. height: 100%;
  1028. }
  1029. </style>