Mall applet page display

——Homepage login (wx.login(), getPhoneNumber)

When entering the home page, load the product list data and display it on the page. Obtain token information from the cache to determine the user's login status. If the user is not logged in, call the login method of the WeChat applet to log in, obtain the unique openid information of the WeChat user, send it to the backend, and the backend returns the token and stores it locally. If the user has not authorized the mobile phone number, the button to authorize the mobile phone number will be displayed to allow the user to authorize the mobile phone number and pass the obtained code to the backend.

e5befb38d03e49bf9a97634361340880.pngf6936d6a0cd943e590000c45d592dd76.gif

<button class="btn   bg-gradual-myOrange" lang="zh_CN" open-type="getPhoneNumber"
					@getphonenumber="onGetPhoneNumber">绑定并登录</button>

 01f24f236b3f40abaddb954b7e9727e4.png

4a180d9bcc5e4b05b70fe67c6f1d1e3d.gif

2. The product list is displayed on the home page, click on the product to enter the details

After getting the product list on the homepage, package the individual products into components and reuse them. Each component is a new object and does not affect each other. In this way, v-model can be used to bind the number of products to ensure that the added The number of products in a will not affect the number of products in b, and the code in the homepage component is simplified for separation. When the product is clicked, the child component uses the this.$emit() method to trigger the function of the parent component, and passes the id of the product to the parent component, which is the home page, and the home page carries the id to jump to the product details page.

72377251b9eb4f97966417fa453d83e2.png

 ec9e7bbcec8e4f7ba762b2548a676c20.png

 7532bd2294f242bdac3811409c3821fb.gif

3. The home page hides the original navigation bar, customizes the navigation bar, and displays address information and the customer service entrance of the applet.

The home page generally displays the default address. When the user selects a new address on the home page, it will be used as the address for immediate purchase and order creation. The address interface has functions such as deleting addresses, setting default addresses, and adding addresses. When adding an address, obtain the user's geographical location permission, perform positioning, and obtain the user's address information.

dad87bd1fd26471f8c9c4b1cee994729.png

 92c42422818849b49fc25f22f826ec94.gif

 4. Click Buy Now on the home page to enter the order creation page.

According to the address information on the home page, determine the delivery method. If there is a store near the address, the delivery method can be self-pickup or door-to-door delivery; if there is no store nearby, the delivery method is express delivery. If the user has not paid, when returning to the home page, the user's unpaid order will be updated in time. If the user has already paid, it will jump to the order details page after the payment is successful.

f8b182ecf7b24211a1eef9ecbdac1823.gif

 3f8dc92fa3cc499f82577c4cb454829d.gif

 5. Click on the product on the home page to enter the product details page

On the product details page, use regular expressions to process the markdown details page information returned by the background.

bda9ff3b06be4280a1005433dfd1a3c6.png

 Listen to the scrolling event of the page and control the transparency of the top navigation. Calculate the height of some elements, and when the navigation is clicked, the page scrolls to a certain element.

c4b942c0d4584d588ef2e4559a3c8973.png

977dc2e76d0843428a7113b54a56a85d.png

d3bf5e23a1e04c94a7398dc98081ca22.png

And configure the function of forwarding this page

5b396794c32944189e8b3fee7b73a963.png

 203d9bd264f449eda3d66c2d237fe948.gif

Six my coupon list,

Use the swiper sliding component to display the coupons according to the status of received, used, etc. Click on the coupon to enter the product display where the coupon can be used, and make a waterfall effect

0c896095130941918afa98e5fd4ded77.png

 dc2f260f2fe74b83bb1956085bc38d63.gif

 Seven order list page

There are 7 states in the order list. Use vuex to share an object on the list page and the details page. This object displays different page information according to the order status, such as what button to display, etc., and customizes the data structure for rendering.

7b2931e8fb534e3bbf966483eba3e3cf.png

 5a7e218887c1477ab72c5c95009af97a.png

 1f523faf3f794f2588fe97191147c52d.gif

 There is a refund request function. If the user chooses a picture, first upload the picture to the Qiniu cloud server, obtain the information returned by the Qiniu cloud server, assemble it into a picture path, and send the picture to the backend.

77bd71e3adb2409a9e578dc214684930.gif

8. Encapsulate commonly used components for unified management and reuse

For commonly used functions, they are all encapsulated, such as tool functions such as conversion with timestamps,

1a6e7097003b413fad3a910ab51e46ca.png

 Frequently appearing pop-up boxes are also written in a component to distinguish between different types and display different components.

c91d31d8062542158b1205955b7d4897.png

4620c2f68bb7450b843e76d9f0efcb38.png

 bbcae51d1ca94432ada6236c7eefd2e5.gif

Guess you like

Origin blog.csdn.net/2201_75783276/article/details/131628964