mypublish.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <template>
  2. <view>
  3. <view class="flex content1">
  4. <view class=" search-wrap">
  5. <view class="search flex justify-space-between align-item-center flex-between" @click="search">
  6. <view class="left flex align-item-center">
  7. <image class="dSLComVueTopLeftImg" style="width: 30rpx;height: 30rpx;flex: none;"
  8. src="@/static/image/card/search.png"></image>
  9. <view class="search-val"> {{searchVal?searchVal:'搜索店铺或服务 '}}</view>
  10. </view>
  11. <view class="right">
  12. <image style='width:32rpx;height:32rpx;' v-if="searchVal" @click.stop="delSearchVal"
  13. src="@/static/image/card/searchdel.png" mode="widthFix"></image>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <mescroll-uni :up="upOption" :down="downOption" ref="mescrollRef" @init="mescrollInit" @up="upCallback"
  19. @down="downCallback" :top="108">
  20. <view class='findItem' v-for='item in findList'>
  21. <view style='align-items: flex-start;' class='flex'>
  22. <view class="left">
  23. <view class='cover'>
  24. <u--image radius='4' :showLoading="true" :src="item.coverImage" width="86px"
  25. height="86px" @click="click"></u--image>
  26. </view>
  27. </view>
  28. <view class="right">
  29. <view class='flex'>
  30. <view class='flex'>
  31. <view class="main-body">
  32. {{item.mainBody=="商铺"?'商铺':'个人'}}
  33. </view>
  34. <view class='name'>{{item.shopNames}}</view>
  35. </view>
  36. <view><view class='iconfont applet-androidgengduo'></view></view>
  37. </view>
  38. <view class='description'>
  39. <mote-lines-divide :dt="item.serviceDescription" :line="3" expandText="展开"
  40. foldHint="收起" />
  41. </view>
  42. </view>
  43. </view>
  44. <view class='address flex justify-space-between'>
  45. <view class='flex'>
  46. <view class='iconfont applet-dizhi'></view>
  47. <view @click.stop="toShopDetail(item)">{{item.detailedAddress}}</view>
  48. </view>
  49. <view class='flex'>
  50. <view @click='edit(item)' class='default_button'>编辑</view>
  51. <view @click='del(item)' class='default_button'>删除</view>
  52. </view>
  53. </view>
  54. </view>
  55. </mescroll-uni>
  56. </view>
  57. </template>
  58. <script>
  59. var that
  60. import MoteLinesDivide from "@/components/text-over-flow/text-over-flow.vue"
  61. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  62. export default {
  63. components: {
  64. MoteLinesDivide,
  65. },
  66. mixins: [MescrollMixin],
  67. data() {
  68. return {
  69. searchVal:'',
  70. findList:[],
  71. handleList:[],
  72. curPageLen:0,
  73. totalPage:0,
  74. currectData:{},
  75. }
  76. },
  77. onLoad() {
  78. that = this
  79. },
  80. onShow() {
  81. if (uni.getStorageSync("search_val")) {
  82. this.searchVal = uni.getStorageSync("search_val")
  83. this.mescroll.resetUpScroll()
  84. }
  85. },
  86. methods: {
  87. edit(item){
  88. uni.navigateTo({
  89. url: "/pageA/find/edit?id="+item.id
  90. })
  91. },
  92. del(item){
  93. that.currectData = item
  94. uni.showModal({
  95. title: '提示',
  96. content: '确定删除发布内容?',
  97. success (res) {
  98. if (res.confirm) {
  99. that.$u.debounce(that.delSubmit, 500)
  100. } else if (res.cancel) {
  101. console.log('用户点击取消')
  102. }
  103. }
  104. })
  105. },
  106. delSubmit() {
  107. uni.showLoading({
  108. title: '加载中',
  109. mask: true
  110. })
  111. this.$request.baseRequest('admin.tourism.productManagement', 'delete', {
  112. id: this.currectData.id
  113. }, failres => {
  114. uni.showToast({
  115. icon: "none",
  116. title: failres.errmsg,
  117. duration: 3000
  118. });
  119. uni.hideLoading()
  120. }).then(res => {
  121. uni.showToast({
  122. icon: "success",
  123. title: '删除成功!',
  124. duration: 2000
  125. });
  126. that.mescroll.resetUpScroll()
  127. })
  128. },
  129. toShopDetail(val){
  130. console.log(val)
  131. uni.navigateTo({
  132. url: "/pageA/food/detailMap?val="+JSON.stringify(val)
  133. })
  134. },
  135. delSearchVal() {
  136. this.searchVal = ''
  137. uni.removeStorageSync("search_val")
  138. that.mescroll.resetUpScroll()
  139. },
  140. search() {
  141. // if (this.userInfo.phone) {
  142. uni.navigateTo({
  143. url: "/pageA/find/search"
  144. })
  145. // } else {
  146. // this.showAuthorizePhone = true
  147. // }
  148. },
  149. async upCallback(page) {
  150. // if (uni.getStorageSync("userInfo").id) {
  151. uni.showLoading({
  152. title: '数据加载中'
  153. })
  154. var finddata = await that.getfindList(page)
  155. if (page.num == 1) that.findList = [], that.handleList = [];
  156. that.curPageLen = finddata.data.items.length;
  157. that.handleList = finddata.data.items
  158. that.totalPage = finddata.data.total;
  159. if (that.handleList.length > 0) {
  160. that.findList = that.handleList
  161. }
  162. uni.hideLoading()
  163. that.$nextTick(() => {
  164. that.mescroll.endBySize(that.curPageLen, that.totalPage)
  165. });
  166. // }
  167. },
  168. getfindList(page) {
  169. return new Promise((resolve, reject) => {
  170. that.$request.baseRequest('admin.tourism.productManagement', 'list', {
  171. page: page.num,
  172. limit: page.size,
  173. searchKeyWord: this.searchVal,
  174. myFlag:1,
  175. // classify: this.typeName
  176. }, failres => {
  177. uni.showToast({
  178. icon: "none",
  179. title: failres.errmsg,
  180. duration: 3000
  181. });
  182. }).then(res => {
  183. resolve(res)
  184. })
  185. })
  186. },
  187. }
  188. }
  189. </script>
  190. <style lang='scss' scoped>
  191. .content1 {
  192. position: fixed;
  193. top: 0;
  194. left: 0;
  195. padding: 20rpx;
  196. background-color: #fff;
  197. z-index: 99;
  198. width: 100vw;
  199. .search {
  200. // color: #9199af;
  201. // background: #f9d27d;
  202. border-radius: 50rpx;
  203. padding: 10rpx 0 10rpx 30rpx;
  204. box-sizing: border-box;
  205. margin-right: 20rpx;
  206. }
  207. .left {
  208. width: 80%;
  209. view {
  210. height: 40rpx;
  211. line-height: 40rpx;
  212. white-space: nowrap;
  213. overflow: scroll;
  214. position: relative;
  215. margin-left: 20rpx;
  216. color: #9199af;
  217. }
  218. }
  219. .right {
  220. // width:14%;
  221. margin-right: 20rpx
  222. }
  223. }
  224. .search-wrap {
  225. width: 100%;
  226. background: #f9f9f9;
  227. // border: 1px solid #f9d27d;
  228. border-radius: 50rpx;
  229. }
  230. .findItem {
  231. background: #fff;
  232. margin: 10rpx;
  233. border-radius: 20rpx;
  234. padding: 20rpx;
  235. font-size: 32rpx;
  236. .main-body {
  237. color: #E95700;
  238. background: #FDF2E5;
  239. font-size: 12px;
  240. padding: 6rpx 14rpx;
  241. box-sizing: border-box;
  242. border-radius: 10rpx;
  243. width:80rpx;
  244. }
  245. .left {
  246. margin-right: 20rpx;
  247. .cover {
  248. border-radius: 8rpx;
  249. }
  250. }
  251. .name {
  252. font-size: 30rpx;
  253. color: #333;
  254. margin-left: 10rpx;
  255. overflow-x: scroll;
  256. white-space: nowrap;
  257. width: 49vw;
  258. font-weight: 600;
  259. letter-spacing: 3rpx;
  260. }
  261. .description {
  262. color: #333;
  263. margin-top: 10rpx;
  264. width: 67vw;
  265. font-size: 28rpx;
  266. }
  267. .address {
  268. margin-top: 20rpx;
  269. width: 100%;
  270. font-size: 28rpx;
  271. color: #999;
  272. }
  273. }
  274. .applet-dianpu1 {
  275. font-size: 44rpx;
  276. color: #eaad1a;
  277. }
  278. .applet-dizhi {
  279. font-size: 38rpx;
  280. color: #393733;
  281. }
  282. </style>