index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <template>
  2. <view class="top-cont">
  3. <view class="content">
  4. <view class="user-info">
  5. <view class="left">
  6. <view class="name-phone">
  7. <view class="name">{{user.nickName}}</view>
  8. <view class="phone" v-if="user!=null">{{utils.parsePhone(user.phonenumber)}}</view>
  9. </view>
  10. </view>
  11. <view class="msg-box" >
  12. {{user.deptName}}
  13. </view>
  14. </view>
  15. <!-- 常用工具 -->
  16. <view class="used-tools">
  17. <view class="title">常用工具</view>
  18. <view class="tools-list">
  19. <view class="item" @click="toCreateOrder()">
  20. <image src="https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736947748277.png" mode=""></image>
  21. <text class="text">商品制单</text>
  22. </view>
  23. <view class="item" @click="toCreateCoupon()">
  24. <image src="https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736947748287.png" mode=""></image>
  25. <text class="text">制单优惠券</text>
  26. </view>
  27. <view class="item" @click="toPay()">
  28. <image src="../static/images/wecha_pay.png" mode=""></image>
  29. <text class="text">微信收款</text>
  30. </view>
  31. <view class="item" @click="alipay()">
  32. <image src="../static/images/money.png" mode=""></image>
  33. <text class="text">支付宝收款</text>
  34. </view>
  35. <view class="item" @click="toOrder()">
  36. <image src="https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736947748289.png" mode=""></image>
  37. <text class="text">我的订单</text>
  38. </view>
  39. <view class="item" @click="toPackage()">
  40. <image src="https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736947748277.png" mode=""></image>
  41. <text class="text">商品套餐</text>
  42. </view>
  43. <view class="item" @click="toCoupon()">
  44. <image src="https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736947748288.png" mode=""></image>
  45. <text class="text">套餐优惠券</text>
  46. </view>
  47. </view>
  48. </view>
  49. <!-- 退出登录按钮 -->
  50. <view class="log-out" @click="logout">退出登录</view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import {getUserInfo,getQrImg} from '@/api/companyUser'
  56. export default {
  57. data() {
  58. return {
  59. user:null,
  60. };
  61. },
  62. onLoad() {
  63. console.log("onload")
  64. },
  65. onShow() {
  66. console.log("onshow")
  67. this.getUserInfo()
  68. },
  69. methods: {
  70. alipay(){
  71. // var url="http://alipay.yjf.runtzh.com/#/?companyId="+this.user.companyId+"&companyUserId="+this.user.userId
  72. // uni.setClipboardData({
  73. // data:url,
  74. // success:()=>{
  75. // uni.showToast({
  76. // title:'收款地址已复制到剪切板',
  77. // icon:'none'
  78. // })
  79. // }
  80. // });
  81. uni.navigateTo({
  82. url:'/pages_company/alipayImg'
  83. })
  84. },
  85. toCard(){
  86. uni.navigateTo({
  87. url:'/pages_company/card?cardId='+this.user.cardId
  88. })
  89. },
  90. toCreateOrder(){
  91. uni.navigateTo({
  92. url:'/pages_company/order/productList'
  93. })
  94. },
  95. toPay(){
  96. uni.navigateTo({
  97. url:'/pages_user/user/pay?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  98. })
  99. },
  100. toOrder(){
  101. uni.navigateTo({
  102. url:'/pages_company/storeOrder?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  103. })
  104. },
  105. toPackage(){
  106. uni.navigateTo({
  107. url:'/pages_company/storeProductPackage?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  108. })
  109. },
  110. toCoupon(){
  111. uni.navigateTo({
  112. url:'/pages_company/coupon'
  113. })
  114. },
  115. toCreateCoupon(){
  116. uni.navigateTo({
  117. url:'/pages_company/order/coupon'
  118. })
  119. },
  120. toCreateOrderCoupon(){
  121. uni.navigateTo({
  122. url:'/pages_company/order/coupon'
  123. })
  124. },
  125. getUserInfo(){
  126. var data={token:uni.getStorageSync('CompanyUserToken')}
  127. getUserInfo(data).then(
  128. res => {
  129. if(res.code==200){
  130. this.user=res.data;
  131. }
  132. else if(res.code==403){
  133. uni.setStorageSync('CompanyUserToken',null);
  134. uni.navigateBack({
  135. delta:-1
  136. })
  137. }else{
  138. uni.showToast({
  139. icon:'none',
  140. title: res.msg,
  141. });
  142. }
  143. },
  144. rej => {}
  145. );
  146. },
  147. logout(){
  148. uni.showModal({
  149. title:"提示",
  150. content:"确认退出登录吗?",
  151. showCancel:true,
  152. cancelText:'取消',
  153. confirmText:'确定',
  154. success:res=>{
  155. if(res.confirm){
  156. uni.setStorageSync('CompanyUserToken',null);
  157. uni.navigateBack({
  158. delta:-1
  159. })
  160. }else{
  161. }
  162. }
  163. })
  164. },
  165. // 跳转页面
  166. navgetTo(url) {
  167. this.utils.isLogin().then(res => {
  168. if(res){
  169. uni.navigateTo({
  170. url: url
  171. })
  172. }
  173. })
  174. },
  175. }
  176. }
  177. </script>
  178. <style lang="scss">
  179. .content{
  180. margin: 20upx 0upx;
  181. padding: 0 20upx;
  182. .user-info{
  183. padding: 30upx;
  184. display: flex;
  185. align-items: center;
  186. justify-content: space-between;
  187. .left{
  188. position: relative;
  189. display: flex;
  190. .head-img{
  191. width: 120upx;
  192. height: 120upx;
  193. border-radius: 50%;
  194. overflow: hidden;
  195. margin-right: 30upx;
  196. border: 4upx solid #FFFFFF;
  197. box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  198. image{
  199. width: 100%;
  200. height: 100%;
  201. }
  202. }
  203. .name-phone{
  204. padding-top: 15upx;
  205. .name{
  206. font-size: 36upx;
  207. font-family: PingFang SC;
  208. font-weight: bold;
  209. color: #111111;
  210. line-height: 1;
  211. }
  212. .phone{
  213. font-size: 28upx;
  214. font-family: PingFang SC;
  215. font-weight: 500;
  216. color: #666666;
  217. line-height: 1;
  218. margin-top: 30upx;
  219. }
  220. }
  221. }
  222. .msg-box{
  223. padding: 5rpx 15upx;
  224. height: 30upx;
  225. line-height: 30upx;
  226. font-size: 22upx;
  227. font-family: PingFang SC;
  228. font-weight: 500;
  229. color: #FFFFFF;
  230. border-radius: 8rpx;
  231. background-color: #018C39;
  232. }
  233. }
  234. .used-tools{
  235. box-sizing: border-box;
  236. background: #FFFFFF;
  237. border-radius: 16upx;
  238. padding: 40upx 30upx;
  239. .title{
  240. font-size: 32upx;
  241. font-family: PingFang SC;
  242. font-weight: bold;
  243. color: #222222;
  244. line-height: 1;
  245. }
  246. .tools-list{
  247. margin-top: 50upx;
  248. display: flex;
  249. flex-wrap: wrap;
  250. width: 100%;
  251. .item{
  252. box-sizing: border-box;
  253. width: 25%;
  254. display: flex;
  255. flex-direction: column;
  256. align-items: center;
  257. justify-content: center;
  258. margin-bottom: 50upx;
  259. position: relative;
  260. image{
  261. width: 44upx;
  262. height: 44upx;
  263. }
  264. .text{
  265. font-size: 24upx;
  266. font-family: PingFang SC;
  267. font-weight: 500;
  268. color: #111111;
  269. line-height: 1;
  270. margin-top: 20upx;
  271. }
  272. .contact-btn{
  273. display: inline-block;
  274. position: absolute;
  275. top: 0;
  276. left: 0;
  277. width: 100%;
  278. height: 100%;
  279. opacity: 0;
  280. }
  281. }
  282. }
  283. }
  284. .log-out{
  285. height: 80upx;
  286. line-height: 80upx;
  287. text-align: center;
  288. font-size: 26upx;
  289. font-family: PingFang SC;
  290. font-weight: 500;
  291. color: #666666;
  292. background: #FFFFFF;
  293. border-radius: 16upx;
  294. margin-top: 20upx;
  295. }
  296. }
  297. </style>