index.vue 33 KB

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