index.vue 31 KB

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