index.vue 32 KB

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