list2.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886
  1. <template>
  2. <view class="app-content" style="background:white;">
  3. <view class="modern-tabs-container">
  4. <view class="modern-tabs">
  5. <view class="modern-tab" :class="{ 'active': globalLookStock === 0 }" @click="changeHasStock(0)">
  6. <view class="tab-content">
  7. <text class="tab-text">全部</text>
  8. </view>
  9. </view>
  10. <view class="modern-tab" :class="{ 'active': globalLookStock === 1 }" @click="changeHasStock(1)">
  11. <view class="tab-content">
  12. <text class="tab-text">有库存</text>
  13. </view>
  14. </view>
  15. <view class="modern-tab" :class="{ 'active': globalLookStock === 2 }" @click="changeHasStock(2)">
  16. <view class="tab-content">
  17. <text class="tab-text">没库存</text>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="billing_box_bg">
  23. <view class="input-wrap">
  24. <view style="padding:0upx 0upx 0upx 0upx;margin-right:8upx;" >
  25. <button class="admin-button-com middle blue" @click="selectFlowerNumFn()">图片分类</button>
  26. </view>
  27. <view class="search-bar">
  28. <app-search-module v-model="globalPy" ref="globalSearchRef" placeholder="这里搜索" @input="globalSearch"/>
  29. </view>
  30. <view style="padding:0 0upx 0 8upx;" >
  31. <button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/ptItem/itemList' })">添花材</button>
  32. </view>
  33. </view>
  34. <button class="admin-button-com middle blue" @click="refreshItem()" style="position: absolute;top:245upx;right:24upx;z-index:99;">刷 新</button>
  35. <view class="scroll-middle_bx">
  36. <scroll-view scroll-y scroll-with-animation class="tab-view">
  37. <div v-for="(item, index) in globalClassData" :key="index" class="tab-bar-item" :class="[globalClassIndex == index ? 'active' : '']" :data-current="index" @tap.stop="globalSwitchClass(index,item)">
  38. <text style="text-align: center;">{{ item.name || "" }}</text>
  39. </div>
  40. </scroll-view>
  41. <scroll-view scroll-y class="right-box" :scroll-top="globalScrollTopPlace" @scroll="globalGetScroll" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
  42. lower-threshold="120" @scrolltolower="globalScrollBottom">
  43. <block v-if="!$util.isEmpty(globalItemData)">
  44. <view class="item_list_bx selectAll">
  45. <view v-if="!$util.isEmpty(globalItemData)">
  46. <template v-for="(productItem, productIndex) in globalItemData">
  47. <view class="item_list_title" v-if="productItem.className && productItem.className!=''">{{ productItem.className }}</view>
  48. <!-- 下面这个key显示有问题,不要动,动了好像会有问题!!!! -->
  49. <view class="item-row item-row--h260" :class="{ 'item-row--remark': productItem.itemRemark }" :key="productIndex">
  50. <ItemStock :info="productItem" @moreAction="moreAction"
  51. @doPrintLabel="doPrintLabel" @cancelDiscountFn="cancelDiscountFn" @cancelFullOff="cancelFullOff"
  52. :ref="`productRef${productItem.id}`" @hideChangeFn="hideChangeFn"
  53. @cancelPreSellFn="cancelPreSellFn" @breakSingleItem="breakSingleItem"
  54. @remarkCleared="syncItemRemark($event, '')">
  55. </ItemStock>
  56. </view>
  57. </template>
  58. </view>
  59. <view v-else>
  60. <view style="height:260upx;text-align:center;color:#CCCCCC;position: relative;">
  61. <view style="position: absolute;margin:auto;top:130upx;left:0;right:0;bottom:0;">暂无花材</view>
  62. </view>
  63. </view>
  64. </view>
  65. </block>
  66. <block v-else>
  67. <view style="width:100%">
  68. <app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(globalItemData)" />
  69. </view>
  70. </block>
  71. </scroll-view>
  72. </view>
  73. </view>
  74. <modal-module :show="printLabelShow" @click="dialogInputConfirm" :maskClosable="true" title="数量" padding="30rpx 30rpx" >
  75. <template v-slot:content>
  76. <div class="app-modal-input-wrap">
  77. <div class="inp-list-line">
  78. <div class="line-input">
  79. <input type="number" ref="input" style="width:61.8%;text-align:center;" @blur="printBlur" :focus="printFocus" v-model="printNum" :adjust-position="false" class="inp-input" />
  80. </div>
  81. </div>
  82. </div>
  83. </template>
  84. </modal-module>
  85. <modal-module :show="moveLabelShow" @click="confirmToLosing" :maskClosable="true" title="挪动数量" padding="30rpx 30rpx" >
  86. <template v-slot:content>
  87. <div class="app-modal-input-wrap">
  88. <div class="inp-list-line">
  89. <div class="line-input">
  90. <input type="digit" ref="input" style="width:61.8%;text-align:center;" v-model="moveNum" @focus="moveNum=''" :adjust-position="false" class="inp-input" />
  91. </div>
  92. </div>
  93. </div>
  94. </template>
  95. </modal-module>
  96. <uni-popup ref="globalClassImgRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
  97. <view style="display:flex;padding:20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
  98. <view v-for="(item, index) in globalClassData" :key="index" @tap.stop="globalChangeClass(index,item)" style="margin-bottom:20upx;margin-left:3upx;">
  99. <image :src="item.cover" style="width:120upx;height:120upx;border-radius:10upx;"></image>
  100. <view style="margin-top:5upx;overflow: hidden;white-space: nowrap;width:120upx;text-align:center;">{{item.name}}</view>
  101. </view>
  102. </view>
  103. </uni-popup>
  104. <uni-popup ref="rightShowMore" background-color="#fff" type="center" :animation="true" class="class-popup-style">
  105. <view class="action-popup-container">
  106. <view class="action-button-item">
  107. <button class="action-button" @click="costChange()">成本变动记录</button>
  108. </view>
  109. <view class="action-button-item">
  110. <button class="action-button" @click="priceChange()">价格变动记录</button>
  111. </view>
  112. <view class="action-button-item">
  113. <button class="action-button" @click="varietyManage()">多颜色</button>
  114. </view>
  115. <view class="action-button-item">
  116. <button class="action-button" @click="copyCreate()">复制新建</button>
  117. </view>
  118. <view class="action-button-item">
  119. <button class="action-button" @click="editDesc()">图文介绍</button>
  120. </view>
  121. <view class="action-button-item">
  122. <button class="action-button" @click="shareItem()">分享到微信</button>
  123. </view>
  124. <view class="action-button-item">
  125. <button class="action-button" @click="getMyPoster()">生成海报</button>
  126. </view>
  127. <view class="action-button-item">
  128. <button class="action-button" @click="orderRecord()">下单记录</button>
  129. </view>
  130. <view class="action-button-item">
  131. <button class="action-button" @click="onStockChange()">路上库存变动</button>
  132. </view>
  133. <view class="action-button-item">
  134. <button class="action-button" @click="preSell()">预售</button>
  135. </view>
  136. <view class="action-button-item">
  137. <button class="action-button" @click="doWaste()">报损</button>
  138. </view>
  139. <view class="action-button-item">
  140. <button class="action-button" @click="doPart()">拆散</button>
  141. </view>
  142. <view class="action-button-item">
  143. <button class="action-button" @click="sendStock()">分配库存</button>
  144. </view>
  145. <view class="action-button-item">
  146. <button class="action-button" @click="delItem()">删除</button>
  147. </view>
  148. <view class="action-button-item">
  149. <button class="action-button" @click="addItemRemark()">增加备注</button>
  150. </view>
  151. <view class="action-button-item">
  152. <button class="action-button" @click="clearItemRemarkFn()">清除备注</button>
  153. </view>
  154. <view class="action-button-item">
  155. <button class="action-button" @click="moveToLose()">挪到处理区</button>
  156. </view>
  157. <view class="action-button-item cancel">
  158. <button class="action-button cancel" @click="closeRightShow()">取消</button>
  159. </view>
  160. </view>
  161. </uni-popup>
  162. <item-poster-popup ref="itemPosterPopup" :poster-url="posterUrl" @close="closePoster" @save="downloadPosterImg" />
  163. <modal-module :show="wasteShow" @click="wasteConfirm" :maskClosable="true" title="报损数量" padding="30rpx 30rpx" >
  164. <template v-slot:content>
  165. <view class="app-modal-input-wrap">
  166. <view class="inp-list-line">
  167. <view class="line-input">
  168. <input type="number" ref="input" style="width:61.8%;text-align:center;" @blur="wasteBlur" :focus="wasteFocus" v-model="wasteNum" :adjust-position="false" class="inp-input" />
  169. </view>
  170. </view>
  171. </view>
  172. </template>
  173. </modal-module>
  174. <modal-module :show="partShow" @click="partConfirm" :maskClosable="true" title="拆散数量" padding="30rpx 30rpx" >
  175. <template v-slot:content>
  176. <view class="app-modal-input-wrap">
  177. <view class="inp-list-line">
  178. <view class="line-input">
  179. <input type="number" ref="input" style="width:61.8%;text-align:center;" @blur="partBlur" :focus="partFocus" v-model="partNum" :adjust-position="false" class="inp-input" />
  180. </view>
  181. </view>
  182. </view>
  183. </template>
  184. </modal-module>
  185. <modal-module :show="remarkShow" @click="remarkConfirm" :maskClosable="true" title="花材备注" padding="30rpx 30rpx" >
  186. <template v-slot:content>
  187. <view class="app-modal-input-wrap">
  188. <view class="inp-list-line">
  189. <view class="line-input">
  190. <input type="text" style="width:90%;text-align:center;" @blur="remarkBlur" :focus="remarkFocus" v-model="remarkText" maxlength="200" :adjust-position="false" class="inp-input" placeholder="请输入备注" />
  191. </view>
  192. </view>
  193. </view>
  194. </template>
  195. </modal-module>
  196. </view>
  197. </template>
  198. <script>
  199. import AppSearchModule from "@/components/module/app-search";
  200. import AppWrapperEmpty from "@/components/app-wrapper-empty";
  201. import ItemStock from "./components/item2";
  202. import ItemPosterPopup from '@/components/item-poster-popup.vue'
  203. import itemPosterMixin from "./mixins/itemPosterMixin";
  204. import productMins from "@/mixins/product2";
  205. import { mapGetters } from "vuex";
  206. import { getWeixinId } from "@/api/invite";
  207. import { print,cancelDiscountPrice,cancelPreSell,delStatusUpdate,cancelFullOffFn } from '@/api/product';
  208. import { breakItem,changeFrontHide,applyAuth,changeHalf,moveToLosing,updateItemRemark,clearItemRemark } from '@/api/item'
  209. import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue';
  210. import ModalModule from "@/components/plugin/modal"
  211. import { partItem } from "@/api/part"
  212. import { wastage } from "@/api/order"
  213. export default {
  214. name: "list",
  215. components: {
  216. AppSearchModule,
  217. AppWrapperEmpty,
  218. ItemStock,
  219. ItemPosterPopup,
  220. uniPopup,
  221. ModalModule
  222. },
  223. mixins: [productMins, itemPosterMixin],
  224. data() {
  225. return {
  226. autoLoad: false,
  227. selectJobType: "stock",
  228. tabIndex: 0,
  229. getAppIdList:{},
  230. status:0,
  231. delStatus:0,
  232. printItemId:0,
  233. printType:0,
  234. printLabelShow:false,
  235. moveLabelShow:false,
  236. printNum:'',
  237. moveNum:'',
  238. printFocus:false,
  239. warning:0,
  240. currentInfo:{},
  241. wasteNum:'',
  242. wasteShow:false,
  243. wasteFocus:false,
  244. partNum:'',
  245. partShow:false,
  246. partFocus:false,
  247. remarkShow: false,
  248. remarkText: '',
  249. remarkFocus: false
  250. };
  251. },
  252. computed:{
  253. ...mapGetters(["getMyShopInfo","getLoginInfo"]),
  254. ...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo" })
  255. },
  256. onLoad() {
  257. this.initItem()
  258. let that = this
  259. getWeixinId().then(res => {
  260. that.getAppIdList = res.data
  261. })
  262. },
  263. methods: {
  264. doPart(){
  265. this.closeRightShow()
  266. this.partShow = true
  267. let that = this
  268. setTimeout(x => {
  269. this.$nextTick(() => {
  270. that.partFocus = true
  271. })
  272. }, 300)
  273. },
  274. partBlur(){
  275. this.partFocus = false
  276. },
  277. closePartPop(){
  278. this.partShow = false
  279. this.partFocus = false
  280. this.partNum = ''
  281. },
  282. partConfirm(val){
  283. let that = this
  284. if (val.index == 0) {
  285. this.closePartPop()
  286. return
  287. }
  288. if(Number(that.partNum)<0){
  289. that.$msg('请填写数量')
  290. return false
  291. }
  292. let product = [{ productId:this.currentInfo.id,bigNum:that.partNum,smallNum:null,classId:0,itemId:this.currentInfo.itemId,ratio:this.currentInfo.ratio }]
  293. that.$util.confirmModal({content:'确认拆散?'},() => {
  294. partItem({product:JSON.stringify(product),remark:''}).then((res) => {
  295. if(res.code == 1){
  296. that.closePartPop()
  297. that.$msg('拆散成功')
  298. }
  299. })
  300. })
  301. },
  302. doWaste(){
  303. this.closeRightShow()
  304. this.wasteShow = true
  305. let that = this
  306. setTimeout(x => {
  307. this.$nextTick(() => {
  308. that.wasteFocus = true
  309. })
  310. }, 300)
  311. },
  312. wasteBlur(){
  313. this.wasteFocus = false
  314. },
  315. closeWastePop(){
  316. this.wasteShow = false
  317. this.wasteFocus = false
  318. this.wasteNum = ''
  319. },
  320. wasteConfirm(val){
  321. let that = this
  322. if (val.index == 0) {
  323. this.closeWastePop()
  324. return
  325. }
  326. if(Number(that.wasteNum)<0){
  327. that.$msg('请填写数量')
  328. return false
  329. }
  330. let product = [{ productId:this.currentInfo.id,bigNum:that.wasteNum,smallNum:null,classId:0,itemId:this.currentInfo.itemId,ratio:this.currentInfo.ratio }]
  331. that.$util.confirmModal({content:'确认报损?'},() => {
  332. wastage({product:JSON.stringify(product),remark:''}).then((res) => {
  333. if(res.code == 1){
  334. that.closeWastePop()
  335. that.$msg('报损成功')
  336. }
  337. });
  338. })
  339. },
  340. moveToLose(){
  341. this.moveLabelShow = true
  342. this.moveNum = this.currentInfo.stock?parseFloat(this.currentInfo.stock):0
  343. },
  344. confirmToLosing(val){
  345. let that=this;
  346. if (val.index == 0) {
  347. that.moveLabelShow = false
  348. that.moveNum = ''
  349. return
  350. }
  351. that.$util.confirmModal({content:'确定挪动?'},() => {
  352. moveToLosing({id:this.currentInfo.id,num:that.moveNum}).then(res=>{
  353. if(res.code == 1){
  354. that.$msg(res.msg)
  355. that.moveLabelShow = false
  356. that.moveNum = ''
  357. that.closeRightShow()
  358. }
  359. })
  360. })
  361. },
  362. goSearchFn(){
  363. this.searchFn()
  364. },
  365. changeHasStock(check){
  366. this.globalLookStock = check
  367. this.reGetGlobalProductList()
  368. },
  369. initItem(){
  370. this.globalRequestType = 'itemList'
  371. this.initData()
  372. uni.hideLoading()
  373. },
  374. refreshItem(){
  375. this.reGetGlobalProductList()
  376. },
  377. hideChangeFn(item,status){
  378. let that = this
  379. changeFrontHide({id:item.id,status:status}).then(res=>{
  380. if(res.code == 1){
  381. that.$refs[`productRef${item.id}`][0].frontHide = status
  382. }
  383. })
  384. },
  385. cancelPreSellFn(item){
  386. let that = this
  387. this.$util.confirmModal({content:'确认取消预售?'},() => {
  388. cancelPreSell({id:item.id}).then(res=>{
  389. if(res.code == 1){
  390. that.$msg(res.msg)
  391. }
  392. })
  393. })
  394. },
  395. cancelDiscountFn(item){
  396. let that = this
  397. this.$util.confirmModal({content:'确认取消特价?'},() => {
  398. cancelDiscountPrice({id:item.id}).then(res=>{
  399. if(res.code == 1){
  400. that.$msg(res.msg)
  401. }
  402. })
  403. })
  404. },
  405. cancelFullOff(item){
  406. let that = this
  407. this.$util.confirmModal({content:'确认取消满减?'},() => {
  408. cancelFullOffFn({id:item.id}).then(res=>{
  409. if(res.code == 1){
  410. that.$msg(res.msg)
  411. }
  412. })
  413. })
  414. },
  415. sendStock(){
  416. this.pageTo({url: '/admin/item/sendStock?id='+this.currentInfo.id+'&price='+this.currentInfo.price+'&stock='+this.currentInfo.stock+'&name='+this.currentInfo.name,type:2})
  417. },
  418. selectFlowerNumFn(){
  419. this.$refs.globalClassImgRef.open('top')
  420. },
  421. printBlur() {
  422. this.printFocus = false
  423. },
  424. doPrintLabel(id,type){
  425. this.printItemId = id
  426. this.printType = type
  427. this.printLabelShow = true
  428. this.printNum = null
  429. setTimeout(x => {
  430. this.$nextTick(() => this.setFocus())
  431. }, 200)
  432. },
  433. setFocus() {
  434. this.printFocus = true
  435. },
  436. dialogInputConfirm(val) {
  437. let that=this;
  438. if (val.index == 0) {
  439. that.printLabelShow = false
  440. that.printFocus = false
  441. return
  442. }
  443. let currentNum = this.printNum
  444. let itemId = this.printItemId
  445. if (currentNum == null) {
  446. that.$msg('请填写数量')
  447. that.printFocus = true
  448. return
  449. }
  450. if (currentNum <= 0) {
  451. that.$msg('数量不能小于1')
  452. that.printFocus = true
  453. return
  454. }
  455. if (itemId == 0) {
  456. that.$msg('打印的花材id出错')
  457. that.printLabelShow = false
  458. that.printFocus = false
  459. return
  460. }
  461. print({id:itemId,num:currentNum,type:this.printType}).then(res=>{
  462. if(res.code == 1){
  463. that.printLabelShow = false
  464. that.printFocus = false
  465. uni.showToast({ title: '操作成功', duration: 1500 })
  466. } else if(res.code == 0){
  467. that.printLabelShow = false
  468. that.printFocus = false
  469. that.$msg(res.msg)
  470. }
  471. })
  472. },
  473. addItemRemark(){
  474. this.closeRightShow()
  475. this.remarkText = this.currentInfo.itemRemark || ''
  476. this.remarkShow = true
  477. let that = this
  478. setTimeout(() => {
  479. that.$nextTick(() => {
  480. that.remarkFocus = true
  481. })
  482. }, 300)
  483. },
  484. remarkBlur(){
  485. this.remarkFocus = false
  486. },
  487. closeRemarkPop(){
  488. this.remarkShow = false
  489. this.remarkFocus = false
  490. this.remarkText = ''
  491. },
  492. remarkConfirm(val){
  493. let that = this
  494. if (val.index == 0) {
  495. this.closeRemarkPop()
  496. return
  497. }
  498. const text = (that.remarkText || '').trim()
  499. if (!text) {
  500. that.$msg('请填写备注')
  501. return
  502. }
  503. updateItemRemark({ id: that.currentInfo.id, itemRemark: text }).then(res => {
  504. if (res.code == 1) {
  505. that.syncItemRemark(that.currentInfo.id, text)
  506. that.closeRemarkPop()
  507. that.$msg(res.msg || '保存成功')
  508. }
  509. })
  510. },
  511. clearItemRemarkFn(){
  512. let that = this
  513. this.closeRightShow()
  514. if (!that.currentInfo.itemRemark) {
  515. that.$msg('暂无备注')
  516. return
  517. }
  518. that.$util.confirmModal({ content: '确定清除备注?' }, () => {
  519. clearItemRemark({ id: that.currentInfo.id }).then(res => {
  520. if (res.code == 1) {
  521. that.syncItemRemark(that.currentInfo.id, '')
  522. that.$msg(res.msg || '清除成功')
  523. }
  524. })
  525. })
  526. },
  527. syncItemRemark(id, itemRemark){
  528. this.currentInfo.itemRemark = itemRemark
  529. if (!this.$util.isEmpty(this.globalItemData)) {
  530. this.globalItemData.forEach((item, index) => {
  531. if (item.id == id) {
  532. this.$set(this.globalItemData[index], 'itemRemark', itemRemark)
  533. }
  534. })
  535. }
  536. },
  537. closeRightShow(){
  538. this.$refs.rightShowMore.close()
  539. },
  540. costChange(){
  541. this.closeRightShow()
  542. this.pageTo({url: '/admin/changePrice/costChangeList?id='+this.currentInfo.id})
  543. },
  544. ptAuth(){
  545. let that = this
  546. that.$util.confirmModal({content:'确认申请?'},() => {
  547. applyAuth({id:this.currentInfo.id}).then(res=>{
  548. if(res.code == 1){
  549. that.closeRightShow()
  550. that.$msg('已提交申请')
  551. }
  552. })
  553. })
  554. },
  555. delItem(){
  556. let that = this
  557. that.$util.confirmModal({content:'确认删除?'},() => {
  558. delStatusUpdate({id:this.currentInfo.id,delStatus:1}).then(res=>{
  559. if(res.code == 1){
  560. that.closeRightShow()
  561. that.$msg('删除成功')
  562. }
  563. })
  564. })
  565. },
  566. onStockChange(){
  567. this.closeRightShow()
  568. this.pageTo({url: '/pagesStorehouse/stockWarn/onStockChange?id='+this.currentInfo.id+'&name='+this.currentInfo.name})
  569. },
  570. priceChange(){
  571. this.closeRightShow()
  572. this.pageTo({url: '/admin/changePrice/changeList?id='+this.currentInfo.id})
  573. },
  574. varietyManage(){
  575. this.closeRightShow()
  576. this.pageTo({url: "/admin/item/xjSelect?itemId="+this.currentInfo.id})
  577. },
  578. copyCreate(){
  579. this.closeRightShow()
  580. this.pageTo({url: '/admin/item/copy?id='+this.currentInfo.id})
  581. },
  582. orderRecord(){
  583. this.closeRightShow()
  584. this.pageTo({url: "/admin/order/itemOrder?productId="+this.currentInfo.id})
  585. },
  586. preSell(){
  587. this.closeRightShow()
  588. this.pageTo({url: "/admin/item/presell?id="+this.currentInfo.id})
  589. },
  590. moreAction(item){
  591. this.currentInfo = item
  592. this.$refs.rightShowMore.open('top')
  593. },
  594. shareItem() {
  595. let that = this
  596. let id = this.currentInfo.id
  597. this.closeRightShow()
  598. // #ifdef MP-WEIXIN
  599. console.log('pages/item/detail?shopId='+ that.loginInfo.shopId+'&id=0&ghsShopAdminId='+that.loginInfo.shopAdminId+'&id='+id)
  600. uni.navigateToMiniProgram({
  601. //姜枫-2021.04.13
  602. appId: that.getAppIdList.mall.miniAppId,
  603. path: 'pages/item/detail?shopId='+ that.loginInfo.shopId+'&ghsShopAdminId='+that.loginInfo.shopAdminId+'&id='+id,
  604. //develop 开发版 trial 体验版 release 正式版
  605. envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
  606. extraData: {
  607. 'shopId': that.loginInfo.shopId,
  608. 'id': 0,
  609. 'name':'',
  610. },
  611. success (res) {
  612. }
  613. })
  614. // #endif
  615. // #ifdef APP-PLUS
  616. if(plus.runtime.isApplicationExist({pname:'com.tencent.mm',action:'weixin://'})){
  617. var sweixin
  618. plus.share.getServices(function(s){
  619. for (var i = 0; i < s.length; i++) {
  620. var t = s[i];
  621. if (t.id == 'weixin') {
  622. sweixin = t;
  623. }
  624. }
  625. let miniOriginalId = that.dictInfo.miniOriginalId && that.dictInfo.miniOriginalId.current && that.dictInfo.miniOriginalId.current.mall ? that.dictInfo.miniOriginalId.current.mall : ''
  626. if (sweixin) { //&& sweixin.nativeClient
  627. sweixin.launchMiniProgram({
  628. id: miniOriginalId,
  629. path: 'pages/item/detail?shopId='+ that.loginInfo.shopId+'&ghsShopAdminId='+that.loginInfo.shopAdminId+'&id='+id,
  630. type: 0
  631. });
  632. } else {
  633. that.$msg('没有找到微信服务');
  634. return false;
  635. }
  636. }, function(e){
  637. that.$msg("没有找到微信服务哦")
  638. //that.$msg("获取微信失败:" + e.message)
  639. //console.log(JSON.stringify(e));
  640. });
  641. }else{
  642. this.$msg("请安装微信,再打开小程序")
  643. return false
  644. }
  645. // #endif
  646. },
  647. affirm(val) {
  648. if (val.index === 0) {
  649. this.modalCancel();
  650. } else {
  651. }
  652. },
  653. editDesc() {
  654. this.closeRightShow()
  655. this.pageTo({url: '/admin/item/picTextAdd-Edit?itemId='+this.currentInfo.id})
  656. }
  657. }
  658. };
  659. </script>
  660. <style lang="scss" scoped>
  661. @import '@/static/css/item-list-row.scss';
  662. .app-content {
  663. display: flex;
  664. flex-direction: column;
  665. height: 100vh;
  666. overflow: hidden;
  667. }
  668. .modern-tabs-container {
  669. flex-shrink: 0;
  670. }
  671. .billing_box_bg {
  672. flex: 1;
  673. display: flex;
  674. background:white;
  675. flex-direction: column;
  676. overflow: hidden;
  677. .input-wrap {
  678. flex-shrink: 0;
  679. display: flex;
  680. padding: 10upx 20upx 22upx 13upx;
  681. .search-bar {
  682. flex: 1;
  683. }
  684. }
  685. .scroll-middle_bx {
  686. flex: 1;
  687. display: flex;
  688. width: 100%;
  689. height: 100%;
  690. overflow: hidden;
  691. }
  692. .tab-view {
  693. width: 170upx;
  694. flex-shrink: 0;
  695. background-color: #f0f2f6;
  696. .tab-bar-item {
  697. position: relative;
  698. width: 170upx;
  699. height: 90upx;
  700. box-sizing: border-box;
  701. display: flex;
  702. align-items: center;
  703. justify-content: center;
  704. font-size: 26upx;
  705. color: #444;
  706. font-weight: 400;
  707. &:last-child{
  708. margin-bottom: 110upx;
  709. }
  710. }
  711. .active {
  712. position: relative;
  713. color: $mainColor;
  714. font-size: 26upx;
  715. background: #fff;
  716. }
  717. .active::before {
  718. content: "";
  719. position: absolute;
  720. border-left: 8upx solid $mainColor;
  721. height: 100%;
  722. left: 0;
  723. }
  724. }
  725. .right-box {
  726. flex: 1;
  727. box-sizing: border-box;
  728. }
  729. .item_list_bx {
  730. padding: 40upx 16upx;
  731. }
  732. .item_list_title {
  733. margin-bottom: 20upx;
  734. font-size: 30upx;
  735. font-weight: bold;
  736. color: #067a40;
  737. }
  738. }
  739. .class-popup-style{
  740. z-index:999999;
  741. }
  742. .action-popup-container {
  743. display: grid;
  744. grid-template-columns: 1fr 1fr;
  745. gap: 24upx;
  746. padding: 50upx 40upx 60upx 40upx;
  747. max-height: 99vh;
  748. overflow-y: auto;
  749. width: 92vw;
  750. max-width: 650upx;
  751. margin: 0 auto;
  752. }
  753. .modern-tabs-container {
  754. padding: 0;
  755. background-color: #f8f9fa;
  756. width: 100%;
  757. flex-shrink: 0;
  758. }
  759. .modern-tabs {
  760. display: flex;
  761. background-color: #ffffff;
  762. padding: 6upx;
  763. box-shadow: 0 2upx 12upx rgba(0, 0, 0, 0.06);
  764. border: 2upx solid #f0f2f5;
  765. position: relative;
  766. z-index: 5;
  767. width: 100%;
  768. }
  769. .modern-tab {
  770. flex: 1;
  771. text-align: center;
  772. padding: 30upx 0;
  773. position: relative;
  774. transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  775. border-radius: 12upx;
  776. margin: 0 2upx;
  777. background-color: #e2dfdf; /* 未选中态背景 */
  778. border: 2upx solid #f2f4f7; /* 未选中态边框 */
  779. box-shadow: none;
  780. .tab-content {
  781. display: flex;
  782. flex-direction: column;
  783. align-items: center;
  784. justify-content: center;
  785. }
  786. .tab-icon {
  787. font-size: 32upx;
  788. margin-bottom: 4upx;
  789. display: block;
  790. opacity: 0.85; /* 未选中态图标降低对比 */
  791. }
  792. &.active .tab-icon {
  793. filter: brightness(1.15);
  794. opacity: 1;
  795. }
  796. .tab-text {
  797. font-size: 30upx;
  798. color: #666;
  799. font-weight: 700;
  800. }
  801. &.active {
  802. background: #09C567;
  803. .tab-text {
  804. color: #ffffff;
  805. font-weight: 700;
  806. font-size: 30upx;
  807. }
  808. }
  809. /* H5 未选中态悬停效果(其它端不影响) */
  810. &:not(.active):hover {
  811. background-color: #f6f7f9;
  812. border-color: #e9ecef;
  813. }
  814. }
  815. .action-button-item {
  816. &.cancel {
  817. grid-column: 1 / -1;
  818. margin-top: 30upx;
  819. }
  820. }
  821. .action-button {
  822. width: 100%;
  823. height: 120upx;
  824. border: 2upx solid #d0d7de;
  825. border-radius: 16upx;
  826. background: #ffffff;
  827. color: #24292f;
  828. font-size: 34upx;
  829. font-weight: 600;
  830. display: flex;
  831. align-items: center;
  832. justify-content: center;
  833. box-shadow: 0 4upx 12upx rgba(0, 0, 0, 0.1);
  834. transition: all 0.15s ease;
  835. line-height: 1.2;
  836. &:active {
  837. background: #f6f8fa;
  838. transform: scale(0.96);
  839. border-color: #8c959f;
  840. }
  841. &.cancel {
  842. background: #f6f8fa;
  843. color: #656d76;
  844. border-color: #d0d7de;
  845. font-size: 32upx;
  846. &:active {
  847. background: #eaeef2;
  848. border-color: #8c959f;
  849. }
  850. }
  851. }
  852. </style>